42 #ifndef _TEUCHOS_SCALARTRAITS_DECL_HPP_ 43 #define _TEUCHOS_SCALARTRAITS_DECL_HPP_ 56 struct UndefinedScalarTraits
59 static inline T notDefined() {
return T::this_type_is_missing_a_specialization(); }
98 static const bool isComplex =
false;
100 static const bool isOrdinal =
false;
102 static const bool isComparable =
false;
107 static const bool hasMachineParameters =
false;
109 static inline magnitudeType
eps() {
return UndefinedScalarTraits<T>::notDefined(); }
111 static inline magnitudeType
sfmin() {
return UndefinedScalarTraits<T>::notDefined(); }
113 static inline magnitudeType
base() {
return UndefinedScalarTraits<T>::notDefined(); }
115 static inline magnitudeType
prec() {
return UndefinedScalarTraits<T>::notDefined(); }
117 static inline magnitudeType
t() {
return UndefinedScalarTraits<T>::notDefined(); }
119 static inline magnitudeType
rnd() {
return UndefinedScalarTraits<T>::notDefined(); }
121 static inline magnitudeType
emin() {
return UndefinedScalarTraits<T>::notDefined(); }
123 static inline magnitudeType
rmin() {
return UndefinedScalarTraits<T>::notDefined(); }
125 static inline magnitudeType
emax() {
return UndefinedScalarTraits<T>::notDefined(); }
127 static inline magnitudeType
rmax() {
return UndefinedScalarTraits<T>::notDefined(); }
129 static inline magnitudeType
magnitude(T a) {
return UndefinedScalarTraits<T>::notDefined(); }
131 static inline T
zero() {
return UndefinedScalarTraits<T>::notDefined(); }
133 static inline T
one() {
return UndefinedScalarTraits<T>::notDefined(); }
135 static inline magnitudeType
real(T a) {
return UndefinedScalarTraits<T>::notDefined(); }
137 static inline magnitudeType
imag(T a) {
return UndefinedScalarTraits<T>::notDefined(); }
139 static inline T
conjugate(T a) {
return UndefinedScalarTraits<T>::notDefined(); }
141 static inline T
nan() {
return UndefinedScalarTraits<T>::notDefined(); }
143 static inline bool isnaninf(
const T& x) {
return UndefinedScalarTraits<T>::notDefined(); }
145 static inline void seedrandom(
unsigned int s) {
int i; T t = &i; }
147 static inline T
random() {
return UndefinedScalarTraits<T>::notDefined(); }
149 static inline std::string
name() { (void)UndefinedScalarTraits<T>::notDefined();
return 0; }
151 static inline T
squareroot(T x) {
return UndefinedScalarTraits<T>::notDefined(); }
153 static inline T
pow(T x, T y) {
return UndefinedScalarTraits<T>::notDefined(); }
160 #endif // _TEUCHOS_SCALARTRAITS_DECL_HPP_ T magnitudeType
Mandatory typedef for result of magnitude.
static magnitudeType eps()
Returns relative machine precision.
static T squareroot(T x)
Returns a number of magnitudeType that is the square root of this scalar type x.
static magnitudeType real(T a)
Returns the real part of the scalar type a.
Teuchos header file which uses auto-configuration information to include necessary C++ headers...
static T pow(T x, T y)
Returns the result of raising one scalar x to the power y.
static magnitudeType emax()
Returns the largest exponent before overflow.
static magnitudeType base()
Returns the base of the machine.
static std::string name()
Returns the name of this scalar type.
static magnitudeType rmax()
Overflow theshold - (base^emax)*(1-eps)
static magnitudeType sfmin()
Returns safe minimum (sfmin), such that 1/sfmin does not overflow.
This structure defines some basic traits for a scalar field type.
static T conjugate(T a)
Returns the conjugate of the scalar type a.
static magnitudeType prec()
Returns eps*base.
static magnitudeType t()
Returns the number of (base) digits in the mantissa.
static magnitudeType rmin()
Returns the underflow threshold - base^(emin-1)
T doublePrecision
Typedef for double precision.
static void seedrandom(unsigned int s)
Seed the random number generator returned by random().
static magnitudeType imag(T a)
Returns the imaginary part of the scalar type a.
static bool isnaninf(const T &x)
Returns true if x is NaN or Inf.
static magnitudeType magnitude(T a)
Returns the magnitudeType of the scalar type a.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
static T nan()
Returns a number that represents NaN.
static T zero()
Returns representation of zero for this scalar type.
static T random()
Returns a random number (between -one() and +one()) of this scalar type.
T halfPrecision
Typedef for half precision.
static magnitudeType emin()
Returns the minimum exponent before (gradual) underflow.
static magnitudeType rnd()
Returns 1.0 when rounding occurs in addition, 0.0 otherwise.
static T one()
Returns representation of one for this scalar type.