Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_ConfigDefs.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TEUCHOS_CONFIGDEFS_HPP
11#define TEUCHOS_CONFIGDEFS_HPP
12
18#include "TeuchosCore_config.h"
19#include "Teuchos_config.h"
20
21#ifdef HAVE_TEUCHOS_DEBUG
22# define TEUCHOS_DEBUG
23# define HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
24#endif
25
26#ifdef __cplusplus
27
28#if defined(__GNUC__) && !defined(__clang__) && \
29 !defined(__INTEL_COMPILER) && !defined(__INTEL_LLVM_COMPILER) && \
30 (__GNUC__ == 12)
31// GCC 12 can emit false-positive -Wnonnull diagnostics.
32# define TEUCHOS_IMPL_GCC_12_NONNULL_WORKAROUND
33#endif
34
35#if defined(_MSC_VER) || defined(__APPLE__)
36# define TEUCHOS_NO_ZERO_ITERATOR_CONVERSION
37#endif
38
39#if defined(__IBMC__) || defined(__IBMCPP__)
40# ifndef TEMPLATE_FRIENDS_NOT_SUPPORTED
41# define TEMPLATE_FRIENDS_NOT_SUPPORTED
42# endif
43# ifndef TEUCHOS_PRIVIATE_DELETE_NOT_SUPPORTED
44# define TEUCHOS_PRIVIATE_DELETE_NOT_SUPPORTED
45# endif
46#endif
47
48/* Deprecated */
49#ifndef HAVE_COMPLEX
50# define HAVE_COMPLEX
51#endif
52
53// #include <cstdio>
54// #include <cstdarg>
55// #include <cerrno>
56// #include <climits>
57#include <cstdlib>
58#include <string>
59#include <cstring>
60#include <cmath>
61#include <iostream>
62#include <iomanip>
63// #include <fstream>
64#include <sstream>
65#include <stdexcept>
66#include <cassert>
67#include <complex>
68// #include <map>
69// #include <vector>
70// #include <deque>
71#include <algorithm>
72// #include <numeric>
73// #include <list>
74// #include <set>
75// #include <typeinfo>
76#include <limits>
77// #include <memory>
78#include <cstddef>
79
80/* Avoid duplicating instantiation provided by IBM XL C++ runtime library. */
81#if defined(__IBMCPP__)
82# pragma do_not_instantiate std::fpos<mbstate_t>
83#endif
84
85const double Teuchos_MinDouble = 1.0E-100;
86const double Teuchos_MaxDouble = 1.0E+100;
87const double Teuchos_Overflow = 1.79E308; // Used to test if equilibration should be done.
88const double Teuchos_Underflow = 2.23E-308;
89
90#else /* __cplusplus */
91
92#include <stddef.h>
93
94#endif /* __cplusplus */
95
96/* Delete any previous definition of TEUCHOS_NO_ERROR_REPORTS */
97
98#ifdef TEUCHOS_CHK_ERR
99#undef TEUCHOS_CHK_ERR
100#endif
101#ifdef TEUCHOS_CHK_PTR
102#undef TEUCHOS_CHK_PTR
103#endif
104#ifdef TEUCHOS_CHK_REF
105#undef TEUCHOS_CHK_REF
106#endif
107
108/* The integral type that is used for the largest ordinal values on this
109 * machine.
110 *
111 * On a 32 bit machine, ptrdiff_t will be an unsighed 32 bit integer and on a
112 * 64 bit machine it will be an unsigned 64 bit integer. Just what I want!
113*/
114typedef TEUCHOS_ORDINAL_TYPE Teuchos_Ordinal;
115
116#ifdef __cplusplus
117namespace Teuchos { typedef Teuchos_Ordinal Ordinal; }
118#endif /* __cplusplus */
119
120/* Deprecated (use Teuchos_Ordinal instead) */
121TEUCHOS_DEPRECATED typedef Teuchos_Ordinal Teuchos_Index;
122
123/* Make error report silent by defining TEUCHOS_NO_ERROR_REPORTS */
124
125#define TEUCHOS_CHK_ERR(a) { if (a != 0) return(a);}
126#define TEUCHOS_CHK_PTR(a) { return(a);}
127#define TEUCHOS_CHK_REF(a) { return(a);}
128
129#ifdef __cplusplus
130const int Teuchos_DefaultTracebackMode = 1; /* Default value for traceback behavior */
131#endif /* __cplusplus */
132
133/* Define some macros */
134#define TEUCHOS_MAX(x,y) (( (x) > (y) ) ? (x) : (y) ) /* max function */
135#define TEUCHOS_MIN(x,y) (( (x) < (y) ) ? (x) : (y) ) /* min function */
136#define TEUCHOS_SGN(x) (( (x) < 0.0 ) ? -1.0 : 1.0 ) /* sign function */
137
138#ifndef HAVE_FORTRAN_SUPPORT
139# ifndef FORTRAN_DISABLED
140# define FORTRAN_DISABLED
141# endif
142#endif
143
144#include "Teuchos_DLLExportMacro.h"
145
146#endif /* TEUCHOS_CONFIGDEFS_HPP */
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...