glucat 0.12.0
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

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

Static Public Member Functions

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

Static Private Member Functions

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

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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
inlinestatic

Smart isinf.

Definition at line 83 of file scalar.h.

References isInf().

◆ isInf() [2/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 isInf(), glucat::matrix::isinf(), and isNaN_or_isInf().

◆ isInf() [3/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.

◆ isNaN() [1/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 isNaN().

◆ isNaN() [2/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 isNaN(), glucat::matrix::isnan(), isNaN_or_isInf(), glucat::matrix::norm_frob2(), and glucat::matrix::trace().

◆ isNaN() [3/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_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 isInf(), and isNaN().

◆ ln_2() [1/2]

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

log(2) for long double

Definition at line 59 of file long_double.h.

◆ 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 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.

Referenced by 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 ln_2(), and log().

Referenced by glucat::log2().

◆ NaN()

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

◆ pi() [1/2]

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

Pi for long double.

Definition at line 51 of file long_double.h.

◆ 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.

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.

◆ 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.

◆ 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.

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.

◆ 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.

◆ to_double()

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

◆ 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]

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

Cast to long double.

Definition at line 71 of file scalar_imp.h.

◆ to_scalar_t() [2/9]

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

Cast to qd_real.

Definition at line 116 of file scalar_imp.h.

◆ to_scalar_t() [3/9]

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

Cast to dd_real.

Definition at line 89 of file scalar_imp.h.

◆ to_scalar_t() [4/9]

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

Cast to qd_real.

Definition at line 107 of file scalar_imp.h.

◆ to_scalar_t() [5/9]

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

Cast to double.

Definition at line 61 of file scalar_imp.h.

◆ to_scalar_t() [6/9]

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 52 of file scalar_imp.h.

◆ to_scalar_t() [7/9]

◆ to_scalar_t() [8/9]

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

Cast to dd_real.

Definition at line 98 of file scalar_imp.h.

◆ to_scalar_t() [9/9]

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

Cast to long double.

Definition at line 80 of file scalar_imp.h.


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