blitz/blitz.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 /***************************************************************************
00003  * blitz/blitz.h      Includes all the important header files
00004  *
00005  * $Id: blitz.h,v 1.14 2005/05/18 23:35:55 julianc Exp $
00006  *
00007  * Copyright (C) 1997-2001 Todd Veldhuizen <tveldhui@oonumerics.org>
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License
00011  * as published by the Free Software Foundation; either version 2
00012  * of the License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  * 
00019  * Suggestions:          blitz-dev@oonumerics.org
00020  * Bugs:                 blitz-bugs@oonumerics.org    
00021  *
00022  * For more information, please see the Blitz++ Home Page:
00023  *    http://oonumerics.org/blitz/
00024  *
00025  ***************************************************************************/
00026 
00027 #ifndef BZ_BLITZ_H
00028 #define BZ_BLITZ_H
00029 
00030 /*
00031  * These symbols allow use of the IEEE and System V math libraries
00032  * (libm.a and libmsaa.a) on some platforms.
00033  */
00034 
00035 #ifdef BZ_ENABLE_XOPEN_SOURCE
00036  #ifndef _ALL_SOURCE
00037   #define _ALL_SOURCE
00038  #endif
00039  #ifndef _XOPEN_SOURCE
00040   #define _XOPEN_SOURCE
00041  #endif
00042  #ifndef _XOPEN_SOURCE_EXTENDED
00043   #define _XOPEN_SOURCE_EXTENDED 1
00044  #endif
00045 #endif
00046 
00047 #include <blitz/compiler.h>          // Compiler-specific directives
00048 #include <blitz/tuning.h>            // Performance tuning
00049 #include <blitz/tau.h>               // Profiling
00050 
00051 #include <string>
00052 #include <stdio.h>                   // sprintf, etc.
00053 
00054 #ifdef BZ_HAVE_STD
00055   #include <iostream>
00056   #include <iomanip>
00057 #else
00058   #include <iostream.h>
00059   #include <iomanip.h>
00060 #endif
00061 
00062 #ifdef BZ_MATH_FN_IN_NAMESPACE_STD 
00063   #include <cmath>
00064 #else
00065   #include <math.h>
00066 #endif
00067 
00068 #ifdef BZ_HAVE_COMPLEX
00069   #include <complex>
00070 #endif
00071 
00072 #define BZ_THROW                     // Needed in <blitz/numinquire.h>
00073 
00074 BZ_NAMESPACE(blitz)
00075 
00076 #ifdef BZ_HAVE_STD
00077  BZ_USING_NAMESPACE(std)
00078 #endif
00079 
00080 #ifdef BZ_GENERATE_GLOBAL_INSTANCES
00081  #define _bz_global
00082  #define BZ_GLOBAL_INIT(X)   =X
00083 #else
00084  #define _bz_global extern
00085  #define BZ_GLOBAL_INIT(X) 
00086 #endif
00087 
00088 BZ_NAMESPACE_END
00089 
00090 /*
00091  * Thread safety issues.
00092  * Compiling with -pthread under gcc, or -mt under solaris,
00093  * should automatically turn on BZ_THREADSAFE.
00094  */
00095 #ifdef _REENTRANT
00096  #ifndef BZ_THREADSAFE
00097   #define BZ_THREADSAFE
00098  #endif
00099 #endif
00100 
00101 /*
00102  * Which mutex implementation should be used for synchronizing
00103  * reference counts.   Currently only one option -- pthreads.
00104  */
00105 #ifdef BZ_THREADSAFE
00106 #define BZ_THREADSAFE_USE_PTHREADS
00107 #endif
00108 
00109 #ifdef BZ_THREADSAFE_USE_PTHREADS
00110  #include <pthread.h>
00111 
00112  #define BZ_MUTEX_DECLARE(name)   mutable pthread_mutex_t name;
00113  #define BZ_MUTEX_INIT(name)      pthread_mutex_init(&name,NULL);
00114  #define BZ_MUTEX_LOCK(name)      pthread_mutex_lock(&name);
00115  #define BZ_MUTEX_UNLOCK(name)    pthread_mutex_unlock(&name);
00116  #define BZ_MUTEX_DESTROY(name)   pthread_mutex_destroy(&name);
00117 #else
00118  #define BZ_MUTEX_DECLARE(name)
00119  #define BZ_MUTEX_INIT(name)
00120  #define BZ_MUTEX_LOCK(name)
00121  #define BZ_MUTEX_UNLOCK(name)
00122  #define BZ_MUTEX_DESTROY(name)
00123 #endif
00124 
00125 #include <blitz/bzdebug.h>           // Debugging macros
00126 
00127 #endif // BZ_BLITZ_H

Generated on Wed Oct 17 17:57:14 2007 for blitz by  doxygen 1.5.2