00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef BZ_BLITZ_H
00028 #define BZ_BLITZ_H
00029
00030
00031
00032
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>
00048 #include <blitz/tuning.h>
00049 #include <blitz/tau.h>
00050
00051 #include <string>
00052 #include <stdio.h>
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
00092
00093
00094
00095 #ifdef _REENTRANT
00096 #ifndef BZ_THREADSAFE
00097 #define BZ_THREADSAFE
00098 #endif
00099 #endif
00100
00101
00102
00103
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>
00126
00127 #endif // BZ_BLITZ_H