use of the SFINAE approach to work around compiler limitations //! http://en.wikipedia.org/wiki/SFINAE More...
#include <eop_aux.hpp>
Static Public Member Functions | |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | acos (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | asin (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | atan (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_only< eT >::result | acos (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_only< eT >::result | asin (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_only< eT >::result | atan (const eT &x) |
template<typename eT > | |
static arma_inline arma_cx_only< eT >::result | acos (const eT &x) |
template<typename eT > | |
static arma_inline arma_cx_only< eT >::result | asin (const eT &x) |
template<typename eT > | |
static arma_inline arma_cx_only< eT >::result | atan (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | acosh (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | asinh (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | atanh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | acosh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | asinh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | atanh (const eT &x) |
template<typename eT > | |
static arma_inline eT | conj (const eT &x) |
template<typename T > | |
static arma_inline std::complex< T > | conj (const std::complex< T > &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | sqrt (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | log10 (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | log (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | exp (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | cos (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | sin (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | tan (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | cosh (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | sinh (const eT &x) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | tanh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | sqrt (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | log10 (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | log (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | exp (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | cos (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | sin (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | tan (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | cosh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | sinh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_or_cx_only< eT > ::result | tanh (const eT &x) |
template<typename T1 , typename T2 > | |
static arma_inline arma_float_or_cx_only< T1 > ::result | pow (const T1 base, const T2 exponent) |
template<typename T1 , typename T2 > | |
static arma_inline arma_integral_only< T1 > ::result | pow (const T1 base, const T2 exponent) |
template<typename T1 > | |
static arma_inline arma_float_or_cx_only< T1 > ::result | pow_int (const T1 base, const int exponent) |
template<typename T1 > | |
static arma_inline arma_integral_only< T1 > ::result | pow_int (const T1 base, const int exponent) |
template<typename eT > | |
static arma_inline arma_integral_only< eT > ::result | direct_eps (const eT &x) |
template<typename eT > | |
static arma_float_only< eT > ::result | direct_eps (const eT &x) |
template<typename T > | |
static arma_float_only< T >::result | direct_eps (const std::complex< T > &x) |
template<typename eT > | |
static arma_inline arma_unsigned_integral_only < eT >::result | arma_abs (const eT &x) |
work around a bug in GCC 4.4 | |
template<typename eT > | |
static arma_inline arma_signed_integral_only< eT > ::result | arma_abs (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_only< eT >::result | arma_abs (const eT &x) |
template<typename T > | |
static arma_inline arma_float_only< T >::result | arma_abs (const std::complex< T > &x) |
template<typename eT , typename eop_type > | |
static arma_inline eT | generate () |
use of the SFINAE approach to work around compiler limitations //! http://en.wikipedia.org/wiki/SFINAE
Definition at line 122 of file eop_aux.hpp.
static arma_inline arma_integral_only<eT>::result eop_aux::acos | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::asin | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::atan | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_only<eT>::result eop_aux::acos | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_only<eT>::result eop_aux::asin | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_only<eT>::result eop_aux::atan | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_cx_only<eT>::result eop_aux::acos | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_cx_only<eT>::result eop_aux::asin | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_cx_only<eT>::result eop_aux::atan | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::acosh | ( | const eT & | x | ) | [inline, static] |
Definition at line 138 of file eop_aux.hpp.
References arma_acosh().
{ return arma_acosh(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::asinh | ( | const eT & | x | ) | [inline, static] |
Definition at line 139 of file eop_aux.hpp.
References arma_asinh().
{ return arma_asinh(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::atanh | ( | const eT & | x | ) | [inline, static] |
Definition at line 140 of file eop_aux.hpp.
References arma_atanh().
{ return arma_atanh(double(x)); }
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::acosh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::asinh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::atanh | ( | const eT & | x | ) | [inline, static] |
static arma_inline eT eop_aux::conj | ( | const eT & | x | ) | [inline, static] |
static arma_inline std::complex<T> eop_aux::conj | ( | const std::complex< T > & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::sqrt | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::log10 | ( | const eT & | x | ) | [inline, static] |
Definition at line 150 of file eop_aux.hpp.
Referenced by log10().
{ return std::log10(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::log | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::exp | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::cos | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::sin | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::tan | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::cosh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::sinh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_integral_only<eT>::result eop_aux::tanh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::sqrt | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::log10 | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::log | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::exp | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::cos | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::sin | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::tan | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::cosh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::sinh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::tanh | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_or_cx_only<T1>::result eop_aux::pow | ( | const T1 | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 177 of file eop_aux.hpp.
Referenced by direct_eps(), and pow_int().
{ return std::pow(base, exponent); }
static arma_inline arma_integral_only<T1>::result eop_aux::pow | ( | const T1 | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 188 of file eop_aux.hpp.
References pow().
{ return T1( std::pow( double(base), double(exponent) ) ); }
static arma_inline arma_float_or_cx_only<T1>::result eop_aux::pow_int | ( | const T1 | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 199 of file eop_aux.hpp.
References pow().
Referenced by eop_cube_core< eop_cube_type >::process(), and eop_core< eop_type >::process().
{ return std::pow(base, exponent); }
static arma_inline arma_integral_only<T1>::result eop_aux::pow_int | ( | const T1 | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 210 of file eop_aux.hpp.
References pow().
{ return T1( std::pow( double(base), exponent) ); }
static arma_inline arma_integral_only<eT>::result eop_aux::direct_eps | ( | const eT & | x | ) | [inline, static] |
Definition at line 221 of file eop_aux.hpp.
Referenced by op_pinv::direct_pinv(), eps(), eop_cube_core< eop_cube_type >::process(), eop_core< eop_type >::process(), and rank().
{
return eT(0);
}
static arma_float_only<eT>::result eop_aux::direct_eps | ( | const eT & | x | ) | [inline, static] |
Definition at line 232 of file eop_aux.hpp.
References abs(), log10(), and pow().
{ //arma_extra_debug_sigprint(); // acording to IEEE Standard for Floating-Point Arithmetic (IEEE 754) // the mantissa length for double is 53 bits = std::numeric_limits<double>::digits // the mantissa length for float is 24 bits = std::numeric_limits<float >::digits //return std::pow( std::numeric_limits<eT>::radix, (std::floor(std::log10(std::abs(x))/std::log10(std::numeric_limits<eT>::radix))-(std::numeric_limits<eT>::digits-1)) ); const eT radix_eT = eT(std::numeric_limits<eT>::radix); const eT digits_m1_eT = eT(std::numeric_limits<eT>::digits - 1); // return std::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) ); return eop_aux::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) ); }
static arma_float_only<T>::result eop_aux::direct_eps | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 255 of file eop_aux.hpp.
References abs(), log10(), and pow().
{ //arma_extra_debug_sigprint(); //return std::pow( std::numeric_limits<T>::radix, (std::floor(std::log10(std::abs(x))/std::log10(std::numeric_limits<T>::radix))-(std::numeric_limits<T>::digits-1)) ); const T radix_T = T(std::numeric_limits<T>::radix); const T digits_m1_T = T(std::numeric_limits<T>::digits - 1); return std::pow( radix_T, T(std::floor(std::log10(std::abs(x))/std::log10(radix_T)) - digits_m1_T) ); }
static arma_inline arma_unsigned_integral_only<eT>::result eop_aux::arma_abs | ( | const eT & | x | ) | [inline, static] |
work around a bug in GCC 4.4
Definition at line 271 of file eop_aux.hpp.
Referenced by eop_cube_core< eop_cube_type >::process(), and eop_core< eop_type >::process().
{ return x; }
static arma_inline arma_signed_integral_only<eT>::result eop_aux::arma_abs | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_only<eT>::result eop_aux::arma_abs | ( | const eT & | x | ) | [inline, static] |
static arma_inline arma_float_only<T>::result eop_aux::arma_abs | ( | const std::complex< T > & | x | ) | [inline, static] |
static arma_inline eT eop_aux::generate | ( | ) | [inline, static] |
Definition at line 288 of file eop_aux.hpp.
{ if(is_same_type<eop_type, eop_randu >::value == true) { return eT(eop_aux_randu<eT>()); } else if(is_same_type<eop_type, eop_randn >::value == true) { return eT(eop_aux_randn<eT>()); } else if(is_same_type<eop_type, eop_zeros >::value == true) { return eT(0); } else if(is_same_type<eop_type, eop_ones_full >::value == true) { return eT(1); } else if(is_same_type<eop_type, eop_cube_randu >::value == true) { return eT(eop_aux_randu<eT>()); } else if(is_same_type<eop_type, eop_cube_randn >::value == true) { return eT(eop_aux_randn<eT>()); } else if(is_same_type<eop_type, eop_cube_zeros >::value == true) { return eT(0); } else if(is_same_type<eop_type, eop_cube_ones_full>::value == true) { return eT(1); } else { return eT(0); } }