Public Types | |
typedef number | real_type |
Static Public Member Functions | |
static const number & | conjugate (const number &x) |
static real_type | abs_square (const number &x) |
static real_type | abs (const number &x) |
Static Public Attributes | |
static const bool | is_complex = false |
A structure that, together with its partial specializations NumberTraits<std::complex<number> > , provides traits and member functions that make it possible to write templates that work on both real number types and complex number types. This template is mostly used to implement linear algebra classes such as vectors and matrices that work for both real and complex numbers.
typedef number numbers::NumberTraits< number >::real_type |
For this data type, typedef the corresponding real type. Since the general template is selected for all data types that are not specializations of std::complex<T>, the underlying type must be real-values, so the real_type is equal to the underlying type.
const number & numbers::NumberTraits< number >::conjugate | ( | const number & | x | ) | [inline, static] |
Return the complex-conjugate of the given number. Since the general template is selected if number is not a complex data type, this function simply returns the given number.
NumberTraits< number >::real_type numbers::NumberTraits< number >::abs_square | ( | const number & | x | ) | [inline, static] |
Return the square of the absolute value of the given number. Since the general template is chosen for types not equal to std::complex, this function simply returns the square of the given number.
NumberTraits< number >::real_type numbers::NumberTraits< number >::abs | ( | const number & | x | ) | [inline, static] |
Return the absolute value of a number.
const bool numbers::NumberTraits< number >::is_complex = false [static] |
A flag that specifies whether the template type given to this class is complex or real. Since the general template is selected for non-complex types, the answer is false
.