glucat  0.12.0
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
 Extra traits which extend numeric limits. More...
 

Public Member Functions

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

Static Public Member Functions

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

Static Private Member Functions

static auto isInf (const Scalar_T &val, bool_to_type< false >) -> bool
 Smart isinf specialised for Scalar_T without infinity. More...
 
static auto isInf (const Scalar_T &val, bool_to_type< true >) -> bool
 Smart isinf specialised for Scalar_T with infinity. More...
 
static auto isNaN (const Scalar_T &val, bool_to_type< false >) -> bool
 Smart isnan specialised for Scalar_T without quiet NaN. More...
 
static auto isNaN (const Scalar_T &val, bool_to_type< true >) -> bool
 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 47 of file scalar.h.

Member Function Documentation

◆ abs()

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

Absolute value of scalar.

Definition at line 182 of file scalar.h.

References UBLAS_ABS.

◆ acos()

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

Inverse cosine of scalar.

Definition at line 245 of file scalar.h.

References glucat::acos().

◆ asin()

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

Inverse sine of scalar.

Definition at line 266 of file scalar.h.

References glucat::asin().

◆ atan()

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

Inverse tangent of scalar.

Definition at line 287 of file scalar.h.

References glucat::atan().

◆ conj()

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

Complex conjugate of scalar.

Definition at line 161 of file scalar.h.

◆ cos()

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

Cosine of scalar.

Definition at line 238 of file scalar.h.

References glucat::cos().

◆ cosh()

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

Hyperbolic cosine of scalar.

Definition at line 252 of file scalar.h.

References glucat::cosh().

◆ exp()

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

Exponential.

Definition at line 217 of file scalar.h.

References glucat::exp().

◆ fmod()

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

Modulo function for scalar.

Definition at line 154 of file scalar.h.

References PyClical::lhs, and PyClical::rhs.

◆ imag()

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

Imaginary part of scalar.

Definition at line 175 of file scalar.h.

◆ isInf() [1/3]

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

Smart isinf specialised for Scalar_T without infinity.

Definition at line 54 of file scalar.h.

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

◆ isInf() [2/3]

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

Smart isinf specialised for Scalar_T with infinity.

Definition at line 61 of file scalar.h.

References _GLUCAT_ISINF.

◆ isInf() [3/3]

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

Smart isinf.

Definition at line 83 of file scalar.h.

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

◆ isNaN() [1/3]

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

Smart isnan specialised for Scalar_T without quiet NaN.

Definition at line 68 of file scalar.h.

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

◆ isNaN() [2/3]

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

Smart isnan specialised for Scalar_T with quiet NaN.

Definition at line 75 of file scalar.h.

References _GLUCAT_ISNAN.

◆ isNaN() [3/3]

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

Smart isnan.

Definition at line 93 of file scalar.h.

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

◆ isNaN_or_isInf()

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

Smart isnan or isinf.

Definition at line 103 of file scalar.h.

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

◆ ln_2() [1/2]

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

log(2) for long double

Definition at line 60 of file long_double.h.

References glucat::l_ln2.

◆ ln_2() [2/2]

template<typename Scalar_T >
static auto glucat::numeric_traits< Scalar_T >::ln_2 ( ) -> Scalar_T
inlinestatic

log(2)

Definition at line 196 of file scalar.h.

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

◆ log()

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

Logarithm of scalar.

Definition at line 224 of file scalar.h.

References glucat::log().

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

◆ log2()

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

Log base 2.

Definition at line 231 of file scalar.h.

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

Referenced by glucat::log2().

◆ NaN()

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

Smart NaN.

Definition at line 115 of file scalar.h.

References glucat::log().

Referenced by glucat::cr_sqrt(), and glucat::matrix::trace().

◆ pi() [1/2]

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

Pi for long double.

Definition at line 52 of file long_double.h.

References glucat::l_pi.

◆ pi() [2/2]

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

Pi.

Definition at line 189 of file scalar.h.

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

◆ pow()

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

Integer power.

Definition at line 203 of file scalar.h.

References glucat::pow().

Referenced by glucat::error_squared_tol().

◆ real()

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

Real part of scalar.

Definition at line 168 of file scalar.h.

◆ sin()

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

Sine of scalar.

Definition at line 259 of file scalar.h.

References glucat::sin().

◆ sinh()

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

Hyperbolic sine of scalar.

Definition at line 273 of file scalar.h.

References glucat::sinh().

◆ sqrt()

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

Square root of scalar.

Definition at line 210 of file scalar.h.

References UBLAS_SQRT.

Referenced by glucat::abs().

◆ tan()

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

Tangent of scalar.

Definition at line 280 of file scalar.h.

References glucat::tan().

◆ tanh()

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

Hyperbolic tangent of scalar.

Definition at line 294 of file scalar.h.

References glucat::tanh().

◆ to_double()

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

Cast to double.

Definition at line 133 of file scalar.h.

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

◆ to_int()

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

Cast to int.

Definition at line 126 of file scalar.h.

◆ to_scalar_t() [1/9]

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

Extra traits which extend numeric limits.

Cast to float

Definition at line 53 of file scalar_imp.h.

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

◆ to_scalar_t() [2/9]

template<>
auto glucat::numeric_traits< double >::to_scalar_t ( const Other_Scalar_T &  val) -> double
inline

Cast to double.

Definition at line 62 of file scalar_imp.h.

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

◆ to_scalar_t() [3/9]

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

Cast to long double.

Definition at line 72 of file scalar_imp.h.

◆ to_scalar_t() [4/9]

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

Cast to long double.

Definition at line 81 of file scalar_imp.h.

◆ to_scalar_t() [5/9]

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

Cast to dd_real.

Definition at line 90 of file scalar_imp.h.

◆ to_scalar_t() [6/9]

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

Cast to dd_real.

Definition at line 99 of file scalar_imp.h.

◆ to_scalar_t() [7/9]

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

Cast to qd_real.

Definition at line 108 of file scalar_imp.h.

◆ to_scalar_t() [8/9]

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

Cast to qd_real.

Definition at line 117 of file scalar_imp.h.

◆ to_scalar_t() [9/9]

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

Cast to Scalar_T.

Definition at line 141 of file scalar.h.

Referenced by glucat::matrix::nork_range(), glucat::to_demote(), and glucat::to_promote().


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