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

long double pi ()
 Pi for long double. More...
 
long double ln_2 ()
 log(2) for long double More...
 
float to_scalar_t (const Other_Scalar_T &val)
 Extra traits which extend numeric limits. More...
 
double to_scalar_t (const Other_Scalar_T &val)
 Cast to double. More...
 
long double to_scalar_t (const dd_real &val)
 Cast to long double. More...
 
long double to_scalar_t (const qd_real &val)
 Cast to long double. More...
 
dd_real to_scalar_t (const long double &val)
 Cast to dd_real. More...
 
dd_real to_scalar_t (const qd_real &val)
 Cast to dd_real. More...
 
qd_real to_scalar_t (const long double &val)
 Cast to qd_real. More...
 
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 75 of file scalar.h.

Member Function Documentation

◆ abs()

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 239 of file scalar.h.

References glucat::acos().

◆ acos()

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 302 of file scalar.h.

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

◆ asin()

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 323 of file scalar.h.

◆ atan()

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 344 of file scalar.h.

◆ conj()

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 218 of file scalar.h.

References glucat::log().

◆ cos()

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

Cosine of scalar.

Definition at line 295 of file scalar.h.

◆ cosh()

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 309 of file scalar.h.

◆ exp()

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

Exponential.

Definition at line 274 of file scalar.h.

References glucat::tan().

◆ fmod()

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 211 of file scalar.h.

References glucat::exp().

◆ imag()

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 232 of file scalar.h.

References glucat::cos().

◆ isInf() [1/3]

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

Smart isinf.

Definition at line 140 of file scalar.h.

◆ isInf() [2/3]

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 111 of file scalar.h.

◆ isInf() [3/3]

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 118 of file scalar.h.

◆ isNaN() [1/3]

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

Smart isnan.

Definition at line 150 of file scalar.h.

◆ isNaN() [2/3]

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 125 of file scalar.h.

◆ isNaN() [3/3]

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 132 of file scalar.h.

◆ isNaN_or_isInf()

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 160 of file scalar.h.

◆ ln_2() [1/2]

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

log(2) for long double

Definition at line 111 of file long_double.h.

◆ ln_2() [2/2]

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

log(2)

Definition at line 253 of file scalar.h.

References glucat::sin().

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

◆ log()

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

Logarithm of scalar.

Definition at line 281 of file scalar.h.

References glucat::atan().

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

◆ 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 288 of file scalar.h.

References glucat::tanh().

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

◆ NaN()

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

Smart NaN.

Definition at line 172 of file scalar.h.

Referenced by glucat::matrix::prod(), and glucat::matrix::sparse_prod().

◆ pi() [1/2]

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

Pi for long double.

Definition at line 103 of file long_double.h.

◆ pi() [2/2]

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

Pi.

Definition at line 246 of file scalar.h.

References glucat::cosh().

◆ pow()

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 260 of file scalar.h.

References glucat::asin().

◆ real()

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 225 of file scalar.h.

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

◆ sin()

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

Sine of scalar.

Definition at line 316 of file scalar.h.

◆ sinh()

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 330 of file scalar.h.

◆ sqrt()

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 267 of file scalar.h.

References glucat::sinh().

Referenced by glucat::reverse().

◆ tan()

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

Tangent of scalar.

Definition at line 337 of file scalar.h.

◆ tanh()

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 351 of file scalar.h.

◆ to_double()

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

Cast to double.

Definition at line 190 of file scalar.h.

◆ to_int()

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

Cast to int.

Definition at line 183 of file scalar.h.

◆ to_scalar_t() [1/9]

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

Cast to long double.

Definition at line 99 of file scalar_imp.h.

◆ to_scalar_t() [2/9]

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

Cast to qd_real.

Definition at line 144 of file scalar_imp.h.

◆ to_scalar_t() [3/9]

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

Cast to dd_real.

Definition at line 117 of file scalar_imp.h.

◆ to_scalar_t() [4/9]

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

Cast to qd_real.

Definition at line 135 of file scalar_imp.h.

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

◆ to_scalar_t() [5/9]

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

◆ to_scalar_t() [6/9]

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

Cast to double.

Definition at line 89 of file scalar_imp.h.

◆ to_scalar_t() [7/9]

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

◆ to_scalar_t() [8/9]

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

Cast to long double.

Definition at line 108 of file scalar_imp.h.

◆ to_scalar_t() [9/9]

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

Cast to dd_real.

Definition at line 126 of file scalar_imp.h.


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