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] |
Definition at line 126 of file eop_aux.hpp.
Referenced by acos().
00126 { return std::acos(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::asin | ( | const eT & | x | ) | [inline, static] |
Definition at line 127 of file eop_aux.hpp.
Referenced by asin().
00127 { return std::asin(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::atan | ( | const eT & | x | ) | [inline, static] |
Definition at line 128 of file eop_aux.hpp.
Referenced by atan().
00128 { return std::atan(double(x)); }
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().
00138 { 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().
00139 { 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().
00140 { return arma_atanh(double(x)); }
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::acosh | ( | const eT & | x | ) | [inline, static] |
Definition at line 142 of file eop_aux.hpp.
References arma_acosh().
00142 { return arma_acosh(x); }
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::asinh | ( | const eT & | x | ) | [inline, static] |
Definition at line 143 of file eop_aux.hpp.
References arma_asinh().
00143 { return arma_asinh(x); }
static arma_inline arma_float_or_cx_only<eT>::result eop_aux::atanh | ( | const eT & | x | ) | [inline, static] |
Definition at line 144 of file eop_aux.hpp.
References arma_atanh().
00144 { return arma_atanh(x); }
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] |
Definition at line 149 of file eop_aux.hpp.
Referenced by sqrt().
00149 { return std::sqrt (double(x)); }
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().
00150 { return std::log10(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::log | ( | const eT & | x | ) | [inline, static] |
Definition at line 151 of file eop_aux.hpp.
Referenced by log().
00151 { return std::log (double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::exp | ( | const eT & | x | ) | [inline, static] |
Definition at line 152 of file eop_aux.hpp.
Referenced by exp().
00152 { return std::exp (double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::cos | ( | const eT & | x | ) | [inline, static] |
Definition at line 153 of file eop_aux.hpp.
Referenced by cos().
00153 { return std::cos (double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::sin | ( | const eT & | x | ) | [inline, static] |
Definition at line 154 of file eop_aux.hpp.
Referenced by sin().
00154 { return std::sin (double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::tan | ( | const eT & | x | ) | [inline, static] |
Definition at line 155 of file eop_aux.hpp.
Referenced by tan().
00155 { return std::tan (double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::cosh | ( | const eT & | x | ) | [inline, static] |
Definition at line 156 of file eop_aux.hpp.
Referenced by cosh().
00156 { return std::cosh (double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::sinh | ( | const eT & | x | ) | [inline, static] |
Definition at line 157 of file eop_aux.hpp.
Referenced by sinh().
00157 { return std::sinh (double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::tanh | ( | const eT & | x | ) | [inline, static] |
Definition at line 158 of file eop_aux.hpp.
Referenced by tanh().
00158 { return std::tanh (double(x)); }
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().
00178 { 00179 return std::pow(base, exponent); 00180 }
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().
00189 { 00190 return T1( std::pow( double(base), double(exponent) ) ); 00191 }
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().
00200 { 00201 return std::pow(base, exponent); 00202 }
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().
00211 { 00212 return T1( std::pow( double(base), exponent) ); 00213 }
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().
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().
00233 { 00234 //arma_extra_debug_sigprint(); 00235 00236 // acording to IEEE Standard for Floating-Point Arithmetic (IEEE 754) 00237 // the mantissa length for double is 53 bits = std::numeric_limits<double>::digits 00238 // the mantissa length for float is 24 bits = std::numeric_limits<float >::digits 00239 00240 //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)) ); 00241 00242 const eT radix_eT = eT(std::numeric_limits<eT>::radix); 00243 const eT digits_m1_eT = eT(std::numeric_limits<eT>::digits - 1); 00244 00245 // return std::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) ); 00246 return eop_aux::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) ); 00247 }
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().
00256 { 00257 //arma_extra_debug_sigprint(); 00258 00259 //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)) ); 00260 00261 const T radix_T = T(std::numeric_limits<T>::radix); 00262 const T digits_m1_T = T(std::numeric_limits<T>::digits - 1); 00263 00264 return std::pow( radix_T, T(std::floor(std::log10(std::abs(x))/std::log10(radix_T)) - digits_m1_T) ); 00265 }
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().
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.
00289 { 00290 if(is_same_type<eop_type, eop_randu >::value == true) { return eT(eop_aux_randu<eT>()); } 00291 else if(is_same_type<eop_type, eop_randn >::value == true) { return eT(eop_aux_randn<eT>()); } 00292 else if(is_same_type<eop_type, eop_zeros >::value == true) { return eT(0); } 00293 else if(is_same_type<eop_type, eop_ones_full >::value == true) { return eT(1); } 00294 else if(is_same_type<eop_type, eop_cube_randu >::value == true) { return eT(eop_aux_randu<eT>()); } 00295 else if(is_same_type<eop_type, eop_cube_randn >::value == true) { return eT(eop_aux_randn<eT>()); } 00296 else if(is_same_type<eop_type, eop_cube_zeros >::value == true) { return eT(0); } 00297 else if(is_same_type<eop_type, eop_cube_ones_full>::value == true) { return eT(1); } 00298 else { return eT(0); } 00299 }