Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
Teuchos_ConfigDefs.hpp
Go to the documentation of this file.
1 /*
2 // @HEADER
3 // ***********************************************************************
4 //
5 // Teuchos: Common Tools Package
6 // Copyright (2004) Sandia Corporation
7 //
8 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
9 // license for use of this work by or on behalf of the U.S. Government.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ***********************************************************************
41 // @HEADER
42 */
43 
44 #ifndef TEUCHOS_CONFIGDEFS_HPP
45 #define TEUCHOS_CONFIGDEFS_HPP
46 
52 #include "TeuchosCore_config.h"
53 #include "Teuchos_config.h"
54 
55 #ifdef HAVE_TEUCHOS_DEBUG
56 # define TEUCHOS_DEBUG
57 # define HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
58 #endif
59 
60 #ifdef __cplusplus
61 
62 #if defined(_MSC_VER) || defined(__APPLE__)
63 # define TEUCHOS_NO_ZERO_ITERATOR_CONVERSION
64 #endif
65 
66 #if defined(__IBMC__) || defined(__IBMCPP__)
67 # ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
68 # define TEMPLATE_FRIENDS_NOT_SUPPORTED
69 # endif
70 # ifndef TEUCHOS_PRIVIATE_DELETE_NOT_SUPPORTED
71 # define TEUCHOS_PRIVIATE_DELETE_NOT_SUPPORTED
72 # endif
73 #endif
74 
75 /* Deprecated */
76 #ifndef HAVE_COMPLEX
77 # define HAVE_COMPLEX
78 #endif
79 
80 #include <cstdio>
81 #include <cstdarg>
82 #include <cerrno>
83 #include <climits>
84 #include <cstdlib>
85 #include <string>
86 #include <cstring>
87 #include <cmath>
88 #include <iostream>
89 #include <iomanip>
90 #include <fstream>
91 #include <sstream>
92 #include <stdexcept>
93 #include <cassert>
94 #include <complex>
95 #include <map>
96 #include <vector>
97 #include <deque>
98 #include <algorithm>
99 #include <numeric>
100 #include <list>
101 #include <set>
102 #include <typeinfo>
103 #include <limits>
104 #include <memory>
105 #include <cstddef>
106 
107 /* Avoid duplicating instantiation provided by IBM XL C++ runtime library. */
108 #if defined(__IBMCPP__)
109 # pragma do_not_instantiate std::fpos<mbstate_t>
110 #endif
111 
112 namespace Teuchos { class DummyDummyClass; }
113 // Above, is used for a dumb reason (see
114 // Teuchs_StandardMemberCompositionMacros.hpp).
115 
116 const double Teuchos_MinDouble = 1.0E-100;
117 const double Teuchos_MaxDouble = 1.0E+100;
118 const double Teuchos_Overflow = 1.79E308; // Used to test if equilibration should be done.
119 const double Teuchos_Underflow = 2.23E-308;
120 
121 // 2007/06/29: These are hacks for std::ostringstream that should be removed
122 // now what we assume that a faily complete standard C++ library is available.
123 
124 #define TEUCHOS_OSTRINGSTREAM_GET_C_STR(OSS) (OSS).str().c_str()
125 typedef std::ostringstream TeuchosOStringStream;
126 
127 #else /* __cplusplus */
128 
129 #include <stddef.h>
130 
131 #endif /* __cplusplus */
132 
133 /* Delete any previous definition of TEUCHOS_NO_ERROR_REPORTS */
134 
135 #ifdef TEUCHOS_CHK_ERR
136 #undef TEUCHOS_CHK_ERR
137 #endif
138 #ifdef TEUCHOS_CHK_PTR
139 #undef TEUCHOS_CHK_PTR
140 #endif
141 #ifdef TEUCHOS_CHK_REF
142 #undef TEUCHOS_CHK_REF
143 #endif
144 
145 /* The integral type that is used for the largest ordinal values on this
146  * machine.
147  *
148  * On a 32 bit machine, ptrdiff_t will be an unsighed 32 bit integer and on a
149  * 64 bit machine it will be an unsigned 64 bit integer. Just what I want!
150 */
151 typedef TEUCHOS_ORDINAL_TYPE Teuchos_Ordinal;
152 
153 #ifdef __cplusplus
154 namespace Teuchos { typedef Teuchos_Ordinal Ordinal; }
155 #endif /* __cplusplus */
156 
157 /* Deprecated (use Teuchos_Ordinal instead) */
158 TEUCHOS_DEPRECATED typedef Teuchos_Ordinal Teuchos_Index;
159 
160 /* Make error report silent by defining TEUCHOS_NO_ERROR_REPORTS */
161 
162 #define TEUCHOS_CHK_ERR(a) { if (a != 0) return(a);}
163 #define TEUCHOS_CHK_PTR(a) { return(a);}
164 #define TEUCHOS_CHK_REF(a) { return(a);}
165 
166 #ifdef __cplusplus
167 const int Teuchos_DefaultTracebackMode = 1; /* Default value for traceback behavior */
168 #endif /* __cplusplus */
169 
170 /* Define some macros */
171 #define TEUCHOS_MAX(x,y) (( (x) > (y) ) ? (x) : (y) ) /* max function */
172 #define TEUCHOS_MIN(x,y) (( (x) < (y) ) ? (x) : (y) ) /* min function */
173 #define TEUCHOS_SGN(x) (( (x) < 0.0 ) ? -1.0 : 1.0 ) /* sign function */
174 
175 #ifndef HAVE_FORTRAN_SUPPORT
176 # ifndef FORTRAN_DISABLED
177 # define FORTRAN_DISABLED
178 # endif
179 #endif
180 
181 #include "Teuchos_DLLExportMacro.h"
182 
183 #endif /* TEUCHOS_CONFIGDEFS_HPP */
TEUCHOS_DEPRECATED typedef Teuchos_Ordinal Teuchos_Index
TEUCHOS_ORDINAL_TYPE Teuchos_Ordinal