glucat  0.8.2
Classes | Public Member Functions | Static Public Member Functions | Static Private Member Functions | List of all members
glucat::numeric_traits< Scalar_T > Class Template Reference

Extra traits which extend numeric limits. More...

#include <scalar.h>

Classes

struct  demoted
 Demoted type for long double. More...
 
struct  promoted
 Promoted type. More...
 

Public Member Functions

template<>
long double pi ()
 Pi for long double. More...
 
template<>
long double ln_2 ()
 log(2) for long double More...
 
template<>
float to_scalar_t (const Other_Scalar_T &val)
 Extra traits which extend numeric limits. More...
 
template<>
double to_scalar_t (const Other_Scalar_T &val)
 Cast to double. More...
 
template<>
long double to_scalar_t (const dd_real &val)
 Cast to long double. More...
 
template<>
long double to_scalar_t (const qd_real &val)
 Cast to long double. More...
 
template<>
dd_real to_scalar_t (const long double &val)
 Cast to dd_real. More...
 
template<>
dd_real to_scalar_t (const qd_real &val)
 Cast to dd_real. More...
 
template<>
qd_real to_scalar_t (const long double &val)
 Cast to qd_real. More...
 
template<>
qd_real to_scalar_t (const dd_real &val)
 Cast to qd_real. More...
 

Static Public Member Functions

static bool isInf (const Scalar_T &val)
 Smart isinf. More...
 
static bool isNaN (const Scalar_T &val)
 Smart isnan. More...
 
static bool isNaN_or_isInf (const Scalar_T &val)
 Smart isnan or isinf. More...
 
static Scalar_T NaN ()
 Smart NaN. More...
 
static int to_int (const Scalar_T &val)
 Cast to int. More...
 
static double to_double (const Scalar_T &val)
 Cast to double. More...
 
template<typename Other_Scalar_T >
static Scalar_T to_scalar_t (const Other_Scalar_T &val)
 Cast to Scalar_T. More...
 
static Scalar_T fmod (const Scalar_T &lhs, const Scalar_T &rhs)
 Modulo function for scalar. More...
 
static Scalar_T conj (const Scalar_T &val)
 Complex conjugate of scalar. More...
 
static Scalar_T real (const Scalar_T &val)
 Real part of scalar. More...
 
static Scalar_T imag (const Scalar_T &val)
 Imaginary part of scalar. More...
 
static Scalar_T abs (const Scalar_T &val)
 Absolute value of scalar. More...
 
static Scalar_T pi ()
 Pi. More...
 
static Scalar_T ln_2 ()
 log(2) More...
 
static Scalar_T pow (const Scalar_T &val, int n)
 Integer power. More...
 
static Scalar_T sqrt (const Scalar_T &val)
 Square root of scalar. More...
 
static Scalar_T exp (const Scalar_T &val)
 Exponential. More...
 
static Scalar_T log (const Scalar_T &val)
 Logarithm of scalar. More...
 
static Scalar_T log2 (const Scalar_T &val)
 Log base 2. More...
 
static Scalar_T cos (const Scalar_T &val)
 Cosine of scalar. More...
 
static Scalar_T acos (const Scalar_T &val)
 Inverse cosine of scalar. More...
 
static Scalar_T cosh (const Scalar_T &val)
 Hyperbolic cosine of scalar. More...
 
static Scalar_T sin (const Scalar_T &val)
 Sine of scalar. More...
 
static Scalar_T asin (const Scalar_T &val)
 Inverse sine of scalar. More...
 
static Scalar_T sinh (const Scalar_T &val)
 Hyperbolic sine of scalar. More...
 
static Scalar_T tan (const Scalar_T &val)
 Tangent of scalar. More...
 
static Scalar_T atan (const Scalar_T &val)
 Inverse tangent of scalar. More...
 
static Scalar_T tanh (const Scalar_T &val)
 Hyperbolic tangent of scalar. More...
 

Static Private Member Functions

static bool isInf (const Scalar_T &val, bool_to_type< false >)
 Smart isinf specialised for Scalar_T without infinity. More...
 
static bool isInf (const Scalar_T &val, bool_to_type< true >)
 Smart isinf specialised for Scalar_T with infinity. More...
 
static bool isNaN (const Scalar_T &val, bool_to_type< false >)
 Smart isnan specialised for Scalar_T without quiet NaN. More...
 
static bool isNaN (const Scalar_T &val, bool_to_type< true >)
 Smart isnan specialised for Scalar_T with quiet NaN. More...
 

Detailed Description

template<typename Scalar_T>
class glucat::numeric_traits< Scalar_T >

Extra traits which extend numeric limits.

Definition at line 46 of file scalar.h.

Member Function Documentation

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::abs ( const Scalar_T &  val)
inlinestatic

Absolute value of scalar.

Definition at line 181 of file scalar.h.

References UBLAS_ABS.

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::acos ( const Scalar_T &  val)
inlinestatic

Inverse cosine of scalar.

Definition at line 244 of file scalar.h.

References glucat::acos().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::asin ( const Scalar_T &  val)
inlinestatic

Inverse sine of scalar.

Definition at line 265 of file scalar.h.

References glucat::asin().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::atan ( const Scalar_T &  val)
inlinestatic

Inverse tangent of scalar.

Definition at line 286 of file scalar.h.

References glucat::atan().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::conj ( const Scalar_T &  val)
inlinestatic

Complex conjugate of scalar.

Definition at line 160 of file scalar.h.

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::cos ( const Scalar_T &  val)
inlinestatic

Cosine of scalar.

Definition at line 237 of file scalar.h.

References glucat::cos().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::cosh ( const Scalar_T &  val)
inlinestatic

Hyperbolic cosine of scalar.

Definition at line 251 of file scalar.h.

References glucat::cosh().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::exp ( const Scalar_T &  val)
inlinestatic

Exponential.

Definition at line 216 of file scalar.h.

References glucat::exp().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::fmod ( const Scalar_T &  lhs,
const Scalar_T &  rhs 
)
inlinestatic

Modulo function for scalar.

Definition at line 153 of file scalar.h.

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::imag ( const Scalar_T &  val)
inlinestatic

Imaginary part of scalar.

Definition at line 174 of file scalar.h.

template<typename Scalar_T>
static bool glucat::numeric_traits< Scalar_T >::isInf ( const Scalar_T &  val,
bool_to_type< false >   
)
inlinestaticprivate

Smart isinf specialised for Scalar_T without infinity.

Definition at line 53 of file scalar.h.

Referenced by glucat::numeric_traits< Scalar_T >::isInf(), and glucat::numeric_traits< Scalar_T >::isNaN_or_isInf().

template<typename Scalar_T>
static bool glucat::numeric_traits< Scalar_T >::isInf ( const Scalar_T &  val,
bool_to_type< true >   
)
inlinestaticprivate

Smart isinf specialised for Scalar_T with infinity.

Definition at line 60 of file scalar.h.

References _GLUCAT_ISINF.

template<typename Scalar_T>
static bool glucat::numeric_traits< Scalar_T >::isInf ( const Scalar_T &  val)
inlinestatic

Smart isinf.

Definition at line 82 of file scalar.h.

References glucat::numeric_traits< Scalar_T >::isInf().

template<typename Scalar_T>
static bool glucat::numeric_traits< Scalar_T >::isNaN ( const Scalar_T &  val,
bool_to_type< false >   
)
inlinestaticprivate

Smart isnan specialised for Scalar_T without quiet NaN.

Definition at line 67 of file scalar.h.

Referenced by glucat::numeric_traits< Scalar_T >::isNaN(), and glucat::numeric_traits< Scalar_T >::isNaN_or_isInf().

template<typename Scalar_T>
static bool glucat::numeric_traits< Scalar_T >::isNaN ( const Scalar_T &  val,
bool_to_type< true >   
)
inlinestaticprivate

Smart isnan specialised for Scalar_T with quiet NaN.

Definition at line 74 of file scalar.h.

References _GLUCAT_ISNAN.

template<typename Scalar_T>
static bool glucat::numeric_traits< Scalar_T >::isNaN ( const Scalar_T &  val)
inlinestatic

Smart isnan.

Definition at line 92 of file scalar.h.

References glucat::numeric_traits< Scalar_T >::isNaN().

template<typename Scalar_T>
static bool glucat::numeric_traits< Scalar_T >::isNaN_or_isInf ( const Scalar_T &  val)
inlinestatic

Smart isnan or isinf.

Definition at line 102 of file scalar.h.

References glucat::numeric_traits< Scalar_T >::isInf(), and glucat::numeric_traits< Scalar_T >::isNaN().

template<>
long double glucat::numeric_traits< long double >::ln_2 ( )
inline

log(2) for long double

Definition at line 83 of file long_double.h.

References glucat::l_ln2.

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::ln_2 ( )
inlinestatic
template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::log ( const Scalar_T &  val)
inlinestatic

Logarithm of scalar.

Definition at line 223 of file scalar.h.

References glucat::log().

Referenced by glucat::numeric_traits< Scalar_T >::log2().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::log2 ( const Scalar_T &  val)
inlinestatic

Log base 2.

Definition at line 230 of file scalar.h.

References glucat::numeric_traits< Scalar_T >::ln_2(), and glucat::numeric_traits< Scalar_T >::log().

Referenced by glucat::log2().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::NaN ( )
inlinestatic

Smart NaN.

Definition at line 114 of file scalar.h.

References glucat::log().

Referenced by glucat::matrix::trace().

template<>
long double glucat::numeric_traits< long double >::pi ( )
inline

Pi for long double.

Definition at line 75 of file long_double.h.

References glucat::l_pi, and glucat::numeric_traits< Scalar_T >::ln_2().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::pi ( )
inlinestatic

Pi.

Definition at line 188 of file scalar.h.

Referenced by glucat::matrix::classify_eigenvalues().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::pow ( const Scalar_T &  val,
int  n 
)
inlinestatic

Integer power.

Definition at line 202 of file scalar.h.

References glucat::pow().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::real ( const Scalar_T &  val)
inlinestatic

Real part of scalar.

Definition at line 167 of file scalar.h.

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::sin ( const Scalar_T &  val)
inlinestatic

Sine of scalar.

Definition at line 258 of file scalar.h.

References glucat::sin().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::sinh ( const Scalar_T &  val)
inlinestatic

Hyperbolic sine of scalar.

Definition at line 272 of file scalar.h.

References glucat::sinh().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::sqrt ( const Scalar_T &  val)
inlinestatic

Square root of scalar.

Definition at line 209 of file scalar.h.

References UBLAS_SQRT.

Referenced by glucat::abs().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::tan ( const Scalar_T &  val)
inlinestatic

Tangent of scalar.

Definition at line 279 of file scalar.h.

References glucat::tan().

template<typename Scalar_T>
static Scalar_T glucat::numeric_traits< Scalar_T >::tanh ( const Scalar_T &  val)
inlinestatic

Hyperbolic tangent of scalar.

Definition at line 293 of file scalar.h.

References glucat::tanh().

template<typename Scalar_T>
static double glucat::numeric_traits< Scalar_T >::to_double ( const Scalar_T &  val)
inlinestatic

Cast to double.

Definition at line 132 of file scalar.h.

Referenced by glucat::operator<<(), and glucat::numeric_traits< Scalar_T >::to_scalar_t().

template<typename Scalar_T>
static int glucat::numeric_traits< Scalar_T >::to_int ( const Scalar_T &  val)
inlinestatic

Cast to int.

Definition at line 125 of file scalar.h.

template<>
float glucat::numeric_traits< float >::to_scalar_t ( const Other_Scalar_T &  val)
inline

Extra traits which extend numeric limits.

Cast to float

Definition at line 52 of file scalar_imp.h.

References glucat::numeric_traits< Scalar_T >::to_double(), and glucat::numeric_traits< Scalar_T >::to_scalar_t().

template<>
double glucat::numeric_traits< double >::to_scalar_t ( const Other_Scalar_T &  val)
inline
template<>
long double glucat::numeric_traits< long double >::to_scalar_t ( const dd_real &  val)
inline

Cast to long double.

Definition at line 71 of file scalar_imp.h.

References glucat::numeric_traits< Scalar_T >::to_scalar_t().

template<>
long double glucat::numeric_traits< long double >::to_scalar_t ( const qd_real &  val)
inline

Cast to long double.

Definition at line 80 of file scalar_imp.h.

References glucat::numeric_traits< Scalar_T >::to_scalar_t().

template<>
dd_real glucat::numeric_traits< dd_real >::to_scalar_t ( const long double &  val)
inline

Cast to dd_real.

Definition at line 89 of file scalar_imp.h.

References glucat::numeric_traits< Scalar_T >::to_scalar_t().

template<>
dd_real glucat::numeric_traits< dd_real >::to_scalar_t ( const qd_real &  val)
inline

Cast to dd_real.

Definition at line 98 of file scalar_imp.h.

References glucat::numeric_traits< Scalar_T >::to_scalar_t().

template<>
qd_real glucat::numeric_traits< qd_real >::to_scalar_t ( const long double &  val)
inline

Cast to qd_real.

Definition at line 107 of file scalar_imp.h.

References glucat::numeric_traits< Scalar_T >::to_scalar_t().

template<>
qd_real glucat::numeric_traits< qd_real >::to_scalar_t ( const dd_real &  val)
inline

Cast to qd_real.

Definition at line 116 of file scalar_imp.h.

template<typename Scalar_T>
template<typename Other_Scalar_T >
static Scalar_T glucat::numeric_traits< Scalar_T >::to_scalar_t ( const Other_Scalar_T &  val)
inlinestatic

The documentation for this class was generated from the following file: