#include <Teuchos_ScalarTraits.hpp>
Public Types | |
| typedef T | magnitudeType |
| Madatory typedef for result of magnitude. | |
Static Public Member Functions | |
| magnitudeType | eps () |
| Returns relative machine precision. | |
| magnitudeType | sfmin () |
| Returns safe minimum (sfmin), such that 1/sfmin does not overflow. | |
| magnitudeType | base () |
| Returns the base of the machine. | |
| magnitudeType | prec () |
Returns eps*base. | |
| magnitudeType | t () |
| Returns the number of (base) digits in the mantissa. | |
| magnitudeType | rnd () |
| Returns 1.0 when rounding occurs in addition, 0.0 otherwise. | |
| magnitudeType | emin () |
| Returns the minimum exponent before (gradual) underflow. | |
| magnitudeType | rmin () |
Returns the underflow threshold - base^(emin-1). | |
| magnitudeType | emax () |
| Returns the largest exponent before overflow. | |
| magnitudeType | rmax () |
Overflow theshold - (base^emax)*(1-eps). | |
| magnitudeType | magnitude (T a) |
Returns the magnitudeType of the scalar type a. | |
| T | zero () |
| Returns representation of zero for this scalar type. | |
| T | one () |
| Returns representation of one for this scalar type. | |
| magnitudeType | real (T a) |
Returns the real part of the scalar type a. | |
| magnitudeType | imag (T a) |
Returns the imaginary part of the scalar type a. | |
| T | conjugate (T a) |
Returns the conjugate of the scalar type a. | |
| T | nan () |
| Returns a number that represents NaN. | |
| bool | isnaninf (const T &x) |
Returns true if x is NaN or Inf. | |
| void | seedrandom (unsigned int s) |
Seed the random number generator returned by random(). | |
| T | random () |
| Returns a random number (between -one() and +one()) of this scalar type. | |
| std::string | name () |
| Returns the name of this scalar type. | |
| T | squareroot (T x) |
Returns a number of magnitudeType that is the square root of this scalar type x. | |
Static Public Attributes | |
| const bool | isComplex = false |
| Determines if scalar type is complex. | |
| const bool | isComparable = false |
| Determines if scalar type supports relational operators such as <, >, <=, >=. | |
| const bool | hasMachineParameters = false |
| Determines if scalar type have machine-specific parameters (i.e. eps(), sfmin(), base(), prec(), t(), rnd(), emin(), rmin(), emax(), rmax() are supported). | |
Scalar traits are an essential part of templated codes. This structure offers the basic traits of the templated scalar type, like defining zero and one, and basic functions on the templated scalar type, like performing a square root.
The functions in the templated base unspecialized struct are designed not to compile (giving a nice compile-time error message) and therefore specializations must be written for Scalar types actually used.
int, float, and double. http://crd.lbl.gov/~dhbailey/mpdist/ ) by configuring Teuchos with --enable-teuchos-arprec and giving the appropriate paths to ARPREC. Then ScalarTraits has the specialization: mp_real. --enable-teuchos-complex then ScalarTraits also has a parital specialization for all complex numbers of the form complex<T>.
Definition at line 93 of file Teuchos_ScalarTraits.hpp.
|
|||||
|
Madatory typedef for result of magnitude.
Definition at line 96 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns relative machine precision.
Definition at line 104 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns safe minimum (sfmin), such that 1/sfmin does not overflow.
Definition at line 106 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns the base of the machine.
Definition at line 108 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns
Definition at line 110 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns the number of (base) digits in the mantissa.
Definition at line 112 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns 1.0 when rounding occurs in addition, 0.0 otherwise.
Definition at line 114 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns the minimum exponent before (gradual) underflow.
Definition at line 116 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns the underflow threshold -
Definition at line 118 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns the largest exponent before overflow.
Definition at line 120 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Overflow theshold -
Definition at line 122 of file Teuchos_ScalarTraits.hpp. |
|
||||||||||
|
Returns the magnitudeType of the scalar type
Definition at line 124 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns representation of zero for this scalar type.
Definition at line 126 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns representation of one for this scalar type.
Definition at line 128 of file Teuchos_ScalarTraits.hpp. |
|
||||||||||
|
Returns the real part of the scalar type
Definition at line 130 of file Teuchos_ScalarTraits.hpp. |
|
||||||||||
|
Returns the imaginary part of the scalar type
Definition at line 132 of file Teuchos_ScalarTraits.hpp. |
|
||||||||||
|
Returns the conjugate of the scalar type
Definition at line 134 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns a number that represents NaN.
Definition at line 136 of file Teuchos_ScalarTraits.hpp. |
|
||||||||||
|
Returns
Definition at line 138 of file Teuchos_ScalarTraits.hpp. |
|
||||||||||
|
Seed the random number generator returned by
Definition at line 140 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns a random number (between -one() and +one()) of this scalar type.
Definition at line 142 of file Teuchos_ScalarTraits.hpp. |
|
|||||||||
|
Returns the name of this scalar type.
Definition at line 144 of file Teuchos_ScalarTraits.hpp. |
|
||||||||||
|
Returns a number of magnitudeType that is the square root of this scalar type
Definition at line 146 of file Teuchos_ScalarTraits.hpp. |
|
|||||
|
Determines if scalar type is complex.
Definition at line 98 of file Teuchos_ScalarTraits.hpp. |
|
|||||
|
Determines if scalar type supports relational operators such as <, >, <=, >=.
Definition at line 100 of file Teuchos_ScalarTraits.hpp. |
|
|||||
|
Determines if scalar type have machine-specific parameters (i.e. eps(), sfmin(), base(), prec(), t(), rnd(), emin(), rmin(), emax(), rmax() are supported).
Definition at line 102 of file Teuchos_ScalarTraits.hpp. |
1.3.9.1