Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 const double Teuchos_MinDouble = 1.0E-100;
113 const double Teuchos_MaxDouble = 1.0E+100;
114 const double Teuchos_Overflow = 1.79E308; // Used to test if equilibration should be done.
115 const double Teuchos_Underflow = 2.23E-308;
116 
117 #else /* __cplusplus */
118 
119 #include <stddef.h>
120 
121 #endif /* __cplusplus */
122 
123 /* Delete any previous definition of TEUCHOS_NO_ERROR_REPORTS */
124 
125 #ifdef TEUCHOS_CHK_ERR
126 #undef TEUCHOS_CHK_ERR
127 #endif
128 #ifdef TEUCHOS_CHK_PTR
129 #undef TEUCHOS_CHK_PTR
130 #endif
131 #ifdef TEUCHOS_CHK_REF
132 #undef TEUCHOS_CHK_REF
133 #endif
134 
135 /* The integral type that is used for the largest ordinal values on this
136  * machine.
137  *
138  * On a 32 bit machine, ptrdiff_t will be an unsighed 32 bit integer and on a
139  * 64 bit machine it will be an unsigned 64 bit integer. Just what I want!
140 */
141 typedef TEUCHOS_ORDINAL_TYPE Teuchos_Ordinal;
142 
143 #ifdef __cplusplus
144 namespace Teuchos { typedef Teuchos_Ordinal Ordinal; }
145 #endif /* __cplusplus */
146 
147 /* Deprecated (use Teuchos_Ordinal instead) */
148 TEUCHOS_DEPRECATED typedef Teuchos_Ordinal Teuchos_Index;
149 
150 /* Make error report silent by defining TEUCHOS_NO_ERROR_REPORTS */
151 
152 #define TEUCHOS_CHK_ERR(a) { if (a != 0) return(a);}
153 #define TEUCHOS_CHK_PTR(a) { return(a);}
154 #define TEUCHOS_CHK_REF(a) { return(a);}
155 
156 #ifdef __cplusplus
157 const int Teuchos_DefaultTracebackMode = 1; /* Default value for traceback behavior */
158 #endif /* __cplusplus */
159 
160 /* Define some macros */
161 #define TEUCHOS_MAX(x,y) (( (x) > (y) ) ? (x) : (y) ) /* max function */
162 #define TEUCHOS_MIN(x,y) (( (x) < (y) ) ? (x) : (y) ) /* min function */
163 #define TEUCHOS_SGN(x) (( (x) < 0.0 ) ? -1.0 : 1.0 ) /* sign function */
164 
165 #ifndef HAVE_FORTRAN_SUPPORT
166 # ifndef FORTRAN_DISABLED
167 # define FORTRAN_DISABLED
168 # endif
169 #endif
170 
171 #include "Teuchos_DLLExportMacro.h"
172 
173 #endif /* TEUCHOS_CONFIGDEFS_HPP */
TEUCHOS_DEPRECATED typedef Teuchos_Ordinal Teuchos_Index
TEUCHOS_ORDINAL_TYPE Teuchos_Ordinal