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
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef _TEUCHOS_CONFIGDEFS_HPP_
00037 #define _TEUCHOS_CONFIGDEFS_HPP_
00038
00043 #ifdef HAVE_CONFIG_H
00044
00045
00046
00047
00048
00049
00050
00051 #ifdef PACKAGE
00052 #undef PACKAGE
00053 #endif
00054
00055 #ifdef PACKAGE_NAME
00056 #undef PACKAGE_NAME
00057 #endif
00058
00059 #ifdef PACKAGE_BUGREPORT
00060 #undef PACKAGE_BUGREPORT
00061 #endif
00062
00063 #ifdef PACKAGE_STRING
00064 #undef PACKAGE_STRING
00065 #endif
00066
00067 #ifdef PACKAGE_TARNAME
00068 #undef PACKAGE_TARNAME
00069 #endif
00070
00071 #ifdef PACKAGE_VERSION
00072 #undef PACKAGE_VERSION
00073 #endif
00074
00075 #ifdef VERSION
00076 #undef VERSION
00077 #endif
00078
00079 #include "Teuchos_config.h"
00080
00081 #ifdef __cplusplus
00082
00083
00084
00085
00086
00087
00088
00089 #if HAVE_CSTDIO
00090 #include <cstdio>
00091 #elif HAVE_STDIO_H
00092 #include <stdio.h>
00093 #else
00094 #error "Found neither cstdio nor stdio.h"
00095 #endif
00096
00097 #if HAVE_CSTDARG
00098 #include <cstdarg>
00099 #elif HAVE_STDARG_H
00100 #include <stdarg.h>
00101 #else
00102 #error "Found neither cstdarg nor stdarg.h"
00103 #endif
00104
00105 #if HAVE_CSTDLIB
00106 #include <cstdlib>
00107 #elif HAVE_STDLIB_H
00108 #include <stdlib.h>
00109 #else
00110 #error "Found neither cstdlib nor stdlib.h"
00111 #endif
00112
00113 #if HAVE_STRING
00114 #include <string>
00115 #elif HAVE_STRING_H
00116 #include <string.h>
00117 #else
00118 #error "Found neither string nor string.h"
00119 #endif
00120
00121 #if HAVE_IOSTREAM
00122 #include <iostream>
00123 #elif HAVE_IOSTREAM_H
00124 #include <iostream.h>
00125 #else
00126 #error "Found neither iostream nor iostream.h"
00127 #endif
00128
00129 #if HAVE_IOSTREAM
00130 #include <fstream>
00131 #elif HAVE_IOSTREAM_H
00132 #include <fstream.h>
00133 #else
00134 #error "Found neither fstream nor fstream.h"
00135 #endif
00136
00137 #if HAVE_STDEXCEPT
00138 #include <stdexcept>
00139 #elif HAVE_STDEXCEPT_H
00140 #include <stdexcept.h>
00141 #else
00142 #error "Found neither stdexcept nor stdexcept.h"
00143 #endif
00144
00145 #ifdef HAVE_CASSERT
00146 #include <cassert>
00147 #else
00148 #include <assert.h>
00149 #endif
00150
00151 #ifdef HAVE_COMPLEX
00152 #include <complex>
00153 #elif defined(HAVE_COMPLEX_H)
00154 #include <complex.h>
00155 #endif
00156
00157 #ifdef HAVE_VECTOR
00158 #include <vector>
00159 #include <deque>
00160 #elif defined(HAVE_VECTOR_H)
00161 #include <vector.h>
00162 #endif
00163
00164 #ifdef HAVE_ALGORITHM
00165 #include <algorithm>
00166 #elif defined(HAVE_ALGO_H)
00167 #include <algo.h>
00168 #elif defined(HAVE_ALGORITHM_H)
00169 #include <algorithm.h>
00170 #endif
00171
00172 #ifdef HAVE_MAP
00173 #include <map>
00174 #elif defined(HAVE_MAP_H)
00175 #include <map.h>
00176 #endif
00177
00178 #ifdef HAVE_LIST
00179 #include <list>
00180 #elif defined(HAVE_LIST_H)
00181 #include <list.h>
00182 #endif
00183
00184 #ifdef HAVE_STRING
00185 #include <string>
00186 #elif defined(HAVE_STRING_H)
00187 #include <string.h>
00188 #elif defined(HAVE_STRINGS_H)
00189 #include <strings.h>
00190 #endif
00191
00192 #ifdef HAVE_TYPEINFO
00193 #include <typeinfo>
00194 #endif
00195
00196 #ifdef HAVE_NUMERIC_LIMITS
00197 #include <limits>
00198 #endif
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210 #if HAVE_SSTREAM
00211 #include <sstream>
00212 typedef std::ostringstream TeuchosOStringStream;
00213 #define TEUCHOS_OSTRINGSTREAM_GET_C_STR(OSS) (OSS).str().c_str()
00214 #elif HAVE_SSTREAM_H
00215 #include <sstream.h>
00216 typedef ostringstream TeuchosOStringStream;
00217 #define TEUCHOS_OSTRINGSTREAM_GET_C_STR(OSS) (OSS).str().c_str()
00218 #elif HAVE_STRSTREAM
00219 #include <strstream>
00220 typedef std::ostrstream TeuchosOStringStream;
00221
00222 #if JANUS_STLPORT
00223 namespace std { class ostrstream; }
00224 #endif
00225 #define TEUCHOS_OSTRINGSTREAM_GET_C_STR(OSS) (OSS).str()
00226 #elif HAVE_STRSTREAM_H
00227 #include <strstream.h>
00228 typedef ostrstream TeuchosOStringStream;
00229 #define TEUCHOS_OSTRINGSTREAM_GET_C_STR(OSS) (OSS).str()
00230 #else
00231 #error "Found neither sstream, sstream.h, strstream.h, nor strstream"
00232 #endif
00233
00234 #if defined(TFLOP)
00235 #ifdef HAVE_STRING
00236 using std::string;
00237 #endif
00238 #ifdef HAVE_IOSTREAM
00239 using std::istream;
00240 using std::ostream;
00241 using std::cerr;
00242 using std::cout;
00243 using std::endl;
00244 #endif
00245 #ifdef HAVE_COMPLEX
00246 using std::complex;
00247 #endif
00248 #else
00249 #ifndef JANUS_STLPORT
00250 #if HAVE_CMATH
00251 #include <cmath>
00252 #elif HAVE_MATH_H
00253 #include <math.h>
00254 #else
00255 #error "Found neither cmath nor math.h"
00256 #endif
00257 #else
00258 #include <math.h>
00259 #endif
00260 using namespace std;
00261 #endif
00262
00263
00264 #ifdef HAVE_IOMANIP
00265 #include <iomanip>
00266 #else
00267 #include <iomanip.h>
00268 #endif
00269
00270 #else
00271
00272 #include <assert.h>
00273 #include <limits.h>
00274 #ifdef HAVE_MALLOC_H
00275 #include <malloc.h>
00276 #endif
00277 #include <math.h>
00278 #include <stdarg.h>
00279 #include <stdio.h>
00280 #include <stdlib.h>
00281 #include <string.h>
00282 #include <time.h>
00283
00284 #endif
00285
00286 #else
00287
00288 #include <iostream>
00289 #include <fstream>
00290 #include <string>
00291 #include <vector>
00292 #include <map>
00293 #include <algorithm>
00294 #include <sstream>
00295 #include <stdexcept>
00296 #include <typeinfo>
00297
00298 #if defined(SGI) || defined(SGI64) || defined(SGI32) || defined(CPLANT)
00299
00300 #include <stdlib.h>
00301 #include <stdio.h>
00302 #include <assert.h>
00303 #include <math.h>
00304 using namespace std;
00305
00306 #elif defined(TFLOP)
00307
00308 #include <stdlib.h>
00309 #include <stdio.h>
00310 #include <assert.h>
00311 using std::string;
00312 #include <iomanip>
00313 using std::istream;
00314 using std::ostream;
00315 using std::cerr;
00316 using std::cout;
00317 using std::endl;
00318 #include <list>
00319
00320 #else
00321
00322 #include <cstdlib>
00323 #include <cstdio>
00324 #include <cassert>
00325 #include <cmath>
00326 using namespace std;
00327
00328 #endif
00329
00330 #endif
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340 #ifdef TEUCHOS_SIMULATE_BOOL
00341
00342 #ifdef bool
00343 #undef bool
00344 #endif
00345 #ifdef true
00346 #undef true
00347 #endif
00348 #ifdef false
00349 #undef false
00350 #endif
00351
00352 #define bool int
00353 #define true 1
00354 #define false 0
00355
00356 #endif
00357
00358 #ifdef __cplusplus
00359
00360 const double Teuchos_MinDouble = 1.0E-100;
00361 const double Teuchos_MaxDouble = 1.0E+100;
00362 const double Teuchos_Overflow = 1.79E308;
00363 const double Teuchos_Underflow = 2.23E-308;
00364
00365 #endif
00366
00367
00368
00369 #ifdef TEUCHOS_CHK_ERR
00370 #undef TEUCHOS_CHK_ERR
00371 #endif
00372 #ifdef TEUCHOS_CHK_PTR
00373 #undef TEUCHOS_CHK_PTR
00374 #endif
00375 #ifdef TEUCHOS_CHK_REF
00376 #undef TEUCHOS_CHK_REF
00377 #endif
00378
00379
00380
00381 #define TEUCHOS_CHK_ERR(a) { if (a != 0) return(a);}
00382 #define TEUCHOS_CHK_PTR(a) { return(a);}
00383 #define TEUCHOS_CHK_REF(a) { return(a);}
00384 #ifdef __cplusplus
00385 const int Teuchos_DefaultTracebackMode = 1;
00386 #endif
00387
00388
00389 #define TEUCHOS_MAX(x,y) (( (x) > (y) ) ? (x) : (y) )
00390 #define TEUCHOS_MIN(x,y) (( (x) < (y) ) ? (x) : (y) )
00391 #define TEUCHOS_SGN(x) (( (x) < 0.0 ) ? -1.0 : 1.0 )
00392
00393 #endif