|
Teuchos Package Browser (Single Doxygen Collection)
Version of the Day
|
Go to the documentation of this file.
42 #ifndef _TEUCHOS_SCALARTRAITS_DECL_HPP_
43 #define _TEUCHOS_SCALARTRAITS_DECL_HPP_
59 static inline T
notDefined() {
return T::this_type_is_missing_a_specialization(); }
146 static inline void seedrandom(
unsigned int s) {
int i; T
t = &i; }
163 #endif // _TEUCHOS_SCALARTRAITS_DECL_HPP_
static magnitudeType sfmin()
Returns safe minimum (sfmin), such that 1/sfmin does not overflow.
static magnitudeType rnd()
Returns 1.0 when rounding occurs in addition, 0.0 otherwise.
static magnitudeType magnitude(T a)
Returns the magnitudeType of the scalar type a.
static T nan()
Returns a number that represents NaN.
static T zero()
Returns representation of zero for this scalar type.
static bool isnaninf(const T &x)
Returns true if x is NaN or Inf.
static void seedrandom(unsigned int s)
Seed the random number generator returned by random().
static magnitudeType real(T a)
Returns the real part of the scalar type a.
static T pi()
Returns the value of PI.
static T random()
Returns a random number (between -one() and +one()) of this scalar type.
static const bool hasMachineParameters
Determines if scalar type have machine-specific parameters (i.e. eps(), sfmin(), base(),...
static magnitudeType prec()
Returns eps*base.
static magnitudeType t()
Returns the number of (base) digits in the mantissa.
static T conjugate(T a)
Returns the conjugate of the scalar type a.
static T pow(T x, T y)
Returns the result of raising one scalar x to the power y.
static const bool isOrdinal
Determines if scalar type is an ordinal type.
static const bool isComplex
Determines if scalar type is std::complex.
static T notDefined()
This function should not compile if there is an attempt to instantiate!
static magnitudeType emin()
Returns the minimum exponent before (gradual) underflow.
T doublePrecision
Typedef for double precision.
static T one()
Returns representation of one for this scalar type.
static const bool isComparable
Determines if scalar type supports relational operators such as <, >, <=, >=.
This structure defines some basic traits for a scalar field type.
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
static magnitudeType rmax()
Overflow theshold - (base^emax)*(1-eps)
static T squareroot(T x)
Returns a number of magnitudeType that is the square root of this scalar type x.
static magnitudeType rmin()
Returns the underflow threshold - base^(emin-1)
static std::string name()
Returns the name of this scalar type.
static magnitudeType emax()
Returns the largest exponent before overflow.
T magnitudeType
Mandatory typedef for result of magnitude.
T halfPrecision
Typedef for half precision.
static magnitudeType imag(T a)
Returns the imaginary part of the scalar type a.
static magnitudeType eps()
Returns relative machine precision.
static magnitudeType base()
Returns the base of the machine.