#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 T > | |
static arma_inline std::complex< T > | acos (const std::complex< T > &x) |
template<typename T > | |
static arma_inline std::complex< T > | asin (const std::complex< T > &x) |
template<typename T > | |
static arma_inline std::complex< T > | atan (const std::complex< T > &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_only< eT >::result | acosh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_only< eT >::result | asinh (const eT &x) |
template<typename eT > | |
static arma_inline arma_float_only< eT >::result | atanh (const eT &x) |
template<typename T > | |
static arma_inline std::complex< T > | acosh (const std::complex< T > &x) |
template<typename T > | |
static arma_inline std::complex< T > | asinh (const std::complex< T > &x) |
template<typename T > | |
static arma_inline std::complex< T > | atanh (const std::complex< T > &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 T1 , typename T2 > | |
static arma_inline T1 | pow (const T1 base, const T2 exponent) |
template<typename T2 > | |
static arma_inline char | pow (const char base, const T2 exponent) |
template<typename T2 > | |
static arma_inline short | pow (const short base, const T2 exponent) |
template<typename T2 > | |
static arma_inline int | pow (const int base, const T2 exponent) |
template<typename T2 > | |
static arma_inline long | pow (const long base, const T2 exponent) |
template<typename T2 > | |
static arma_inline unsigned char | pow (const unsigned char base, const T2 exponent) |
template<typename T2 > | |
static arma_inline unsigned short | pow (const unsigned short base, const T2 exponent) |
template<typename T2 > | |
static arma_inline unsigned int | pow (const unsigned int base, const T2 exponent) |
template<typename T2 > | |
static arma_inline unsigned long | pow (const unsigned long base, const T2 exponent) |
template<typename T1 > | |
static arma_inline T1 | pow_int (const T1 base, const int exponent) |
static arma_inline char | pow_int (const char base, const int exponent) |
static arma_inline short | pow_int (const short base, const int exponent) |
static arma_inline int | pow_int (const int base, const int exponent) |
static arma_inline long | pow_int (const long base, const int exponent) |
static arma_inline unsigned char | pow_int (const unsigned char base, const int exponent) |
static arma_inline unsigned short | pow_int (const unsigned short base, const int exponent) |
static arma_inline unsigned int | pow_int (const unsigned int base, const int exponent) |
static arma_inline unsigned long | pow_int (const unsigned long base, const int exponent) |
template<typename eT > | |
static eT | trunc_exp (const eT x) |
template<typename T > | |
static std::complex< T > | trunc_exp (const std::complex< T > &x) |
template<typename eT > | |
static eT | trunc_log (const eT x) |
template<typename T > | |
static std::complex< T > | trunc_log (const std::complex< T > &x) |
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 () |
Definition at line 93 of file eop_aux.hpp.
static arma_inline arma_integral_only<eT>::result eop_aux::acos | ( | const eT & | x | ) | [inline, static] |
Definition at line 103 of file eop_aux.hpp.
Referenced by acos().
00103 { return std::acos(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::asin | ( | const eT & | x | ) | [inline, static] |
Definition at line 104 of file eop_aux.hpp.
Referenced by asin().
00104 { return std::asin(double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::atan | ( | const eT & | x | ) | [inline, static] |
Definition at line 105 of file eop_aux.hpp.
Referenced by atan().
00105 { 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 std::complex<T> eop_aux::acos | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 111 of file eop_aux.hpp.
References acos().
00111 { return arma_boost_wrap(acos, x); }
static arma_inline std::complex<T> eop_aux::asin | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 112 of file eop_aux.hpp.
References asin().
00112 { return arma_boost_wrap(asin, x); }
static arma_inline std::complex<T> eop_aux::atan | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 113 of file eop_aux.hpp.
References atan().
00113 { return arma_boost_wrap(atan, x); }
static arma_inline arma_integral_only<eT>::result eop_aux::acosh | ( | const eT & | x | ) | [inline, static] |
Definition at line 115 of file eop_aux.hpp.
Referenced by acosh().
00115 { return arma_boost_wrap(acosh, double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::asinh | ( | const eT & | x | ) | [inline, static] |
Definition at line 116 of file eop_aux.hpp.
Referenced by asinh().
00116 { return arma_boost_wrap(asinh, double(x)); }
static arma_inline arma_integral_only<eT>::result eop_aux::atanh | ( | const eT & | x | ) | [inline, static] |
Definition at line 117 of file eop_aux.hpp.
Referenced by atanh().
00117 { return arma_boost_wrap(atanh, double(x)); }
static arma_inline arma_float_only<eT>::result eop_aux::acosh | ( | const eT & | x | ) | [inline, static] |
Definition at line 119 of file eop_aux.hpp.
References acosh().
00119 { return arma_boost_wrap(acosh, x); }
static arma_inline arma_float_only<eT>::result eop_aux::asinh | ( | const eT & | x | ) | [inline, static] |
Definition at line 120 of file eop_aux.hpp.
References asinh().
00120 { return arma_boost_wrap(asinh, x); }
static arma_inline arma_float_only<eT>::result eop_aux::atanh | ( | const eT & | x | ) | [inline, static] |
Definition at line 121 of file eop_aux.hpp.
References atanh().
00121 { return arma_boost_wrap(atanh, x); }
static arma_inline std::complex<T> eop_aux::acosh | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 123 of file eop_aux.hpp.
References acosh().
00123 { return arma_boost_wrap(acosh, x); }
static arma_inline std::complex<T> eop_aux::asinh | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 124 of file eop_aux.hpp.
References asinh().
00124 { return arma_boost_wrap(asinh, x); }
static arma_inline std::complex<T> eop_aux::atanh | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 125 of file eop_aux.hpp.
References atanh().
00125 { return arma_boost_wrap(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 T1 eop_aux::pow | ( | const T1 | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 134 of file eop_aux.hpp.
Referenced by direct_eps(), and pow_int().
00134 { return std::pow(base, exponent); }
static arma_inline char eop_aux::pow | ( | const char | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 137 of file eop_aux.hpp.
References pow().
00137 { typedef char out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline short eop_aux::pow | ( | const short | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 140 of file eop_aux.hpp.
References pow().
00140 { typedef short out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline int eop_aux::pow | ( | const int | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 143 of file eop_aux.hpp.
References pow().
00143 { typedef int out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline long eop_aux::pow | ( | const long | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 146 of file eop_aux.hpp.
References pow().
00146 { typedef long out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline unsigned char eop_aux::pow | ( | const unsigned char | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 150 of file eop_aux.hpp.
References pow().
00150 { typedef unsigned char out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline unsigned short eop_aux::pow | ( | const unsigned short | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 153 of file eop_aux.hpp.
References pow().
00153 { typedef unsigned short out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline unsigned int eop_aux::pow | ( | const unsigned int | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 156 of file eop_aux.hpp.
References pow().
00156 { typedef unsigned int out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline unsigned long eop_aux::pow | ( | const unsigned long | base, | |
const T2 | exponent | |||
) | [inline, static] |
Definition at line 159 of file eop_aux.hpp.
References pow().
00159 { typedef unsigned long out_t; return out_t( std::pow(double(base), double(exponent) ) ); }
static arma_inline T1 eop_aux::pow_int | ( | const T1 | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 164 of file eop_aux.hpp.
References pow().
Referenced by eop_cube_core< eop_cube_type >::process(), and eop_core< eop_type >::process().
00164 { return std::pow(base, exponent); }
static arma_inline char eop_aux::pow_int | ( | const char | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 167 of file eop_aux.hpp.
References pow().
00167 { typedef char out_t; return out_t( std::pow(double(base), exponent) ); }
static arma_inline short eop_aux::pow_int | ( | const short | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 170 of file eop_aux.hpp.
References pow().
00170 { typedef short out_t; return out_t( std::pow(double(base), exponent) ); }
static arma_inline int eop_aux::pow_int | ( | const int | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 173 of file eop_aux.hpp.
References pow().
00173 { typedef int out_t; return out_t( std::pow(double(base), exponent) ); }
static arma_inline long eop_aux::pow_int | ( | const long | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 176 of file eop_aux.hpp.
References pow().
00176 { typedef long out_t; return out_t( std::pow(double(base), exponent) ); }
static arma_inline unsigned char eop_aux::pow_int | ( | const unsigned char | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 180 of file eop_aux.hpp.
References pow().
00180 { typedef unsigned char out_t; return out_t( std::pow(double(base), exponent) ); }
static arma_inline unsigned short eop_aux::pow_int | ( | const unsigned short | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 183 of file eop_aux.hpp.
References pow().
00183 { typedef unsigned short out_t; return out_t( std::pow(double(base), exponent) ); }
static arma_inline unsigned int eop_aux::pow_int | ( | const unsigned int | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 186 of file eop_aux.hpp.
References pow().
00186 { typedef unsigned int out_t; return out_t( std::pow(double(base), exponent) ); }
static arma_inline unsigned long eop_aux::pow_int | ( | const unsigned long | base, | |
const int | exponent | |||
) | [inline, static] |
Definition at line 189 of file eop_aux.hpp.
References pow().
00189 { typedef unsigned long out_t; return out_t( std::pow(double(base), exponent) ); }
static eT eop_aux::trunc_exp | ( | const eT | x | ) | [inline, static] |
Definition at line 198 of file eop_aux.hpp.
00199 { 00200 if(std::numeric_limits<eT>::is_iec559 && (x >= Math<eT>::log_max() )) 00201 { 00202 return std::numeric_limits<eT>::max(); 00203 } 00204 else 00205 { 00206 return std::exp(x); 00207 } 00208 }
static std::complex<T> eop_aux::trunc_exp | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 216 of file eop_aux.hpp.
References exp().
00217 { 00218 return std::exp(x); 00219 }
static eT eop_aux::trunc_log | ( | const eT | x | ) | [inline, static] |
Definition at line 227 of file eop_aux.hpp.
References log().
00228 { 00229 if(std::numeric_limits<eT>::is_iec559) 00230 { 00231 if(x == std::numeric_limits<eT>::infinity()) 00232 { 00233 return Math<eT>::log_max(); 00234 } 00235 else 00236 if(x <= eT(0)) 00237 { 00238 return Math<eT>::log_min(); 00239 } 00240 else 00241 { 00242 return std::log(x); 00243 } 00244 } 00245 else 00246 { 00247 return std::log(x); 00248 } 00249 }
static std::complex<T> eop_aux::trunc_log | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 257 of file eop_aux.hpp.
References log().
00258 { 00259 return std::log(x); 00260 }
static arma_inline arma_integral_only<eT>::result eop_aux::direct_eps | ( | const eT & | x | ) | [inline, static] |
Definition at line 268 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 279 of file eop_aux.hpp.
References abs(), log10(), and pow().
00280 { 00281 //arma_extra_debug_sigprint(); 00282 00283 // acording to IEEE Standard for Floating-Point Arithmetic (IEEE 754) 00284 // the mantissa length for double is 53 bits = std::numeric_limits<double>::digits 00285 // the mantissa length for float is 24 bits = std::numeric_limits<float >::digits 00286 00287 //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)) ); 00288 00289 const eT radix_eT = eT(std::numeric_limits<eT>::radix); 00290 const eT digits_m1_eT = eT(std::numeric_limits<eT>::digits - 1); 00291 00292 // return std::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) ); 00293 return eop_aux::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) ); 00294 }
static arma_float_only<T>::result eop_aux::direct_eps | ( | const std::complex< T > & | x | ) | [inline, static] |
Definition at line 302 of file eop_aux.hpp.
References abs(), log10(), and pow().
00303 { 00304 //arma_extra_debug_sigprint(); 00305 00306 //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)) ); 00307 00308 const T radix_T = T(std::numeric_limits<T>::radix); 00309 const T digits_m1_T = T(std::numeric_limits<T>::digits - 1); 00310 00311 return std::pow( radix_T, T(std::floor(std::log10(std::abs(x))/std::log10(radix_T)) - digits_m1_T) ); 00312 }
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 318 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 335 of file eop_aux.hpp.
00336 { 00337 if(is_same_type<eop_type, eop_rand >::value == true) { return eT(eop_aux_rand<eT>()); } 00338 else if(is_same_type<eop_type, eop_randn >::value == true) { return eT(eop_aux_randn<eT>()); } 00339 else if(is_same_type<eop_type, eop_zeros >::value == true) { return eT(0); } 00340 else if(is_same_type<eop_type, eop_ones_full >::value == true) { return eT(1); } 00341 else if(is_same_type<eop_type, eop_cube_rand >::value == true) { return eT(eop_aux_rand<eT>()); } 00342 else if(is_same_type<eop_type, eop_cube_randn >::value == true) { return eT(eop_aux_randn<eT>()); } 00343 else if(is_same_type<eop_type, eop_cube_zeros >::value == true) { return eT(0); } 00344 else if(is_same_type<eop_type, eop_cube_ones_full>::value == true) { return eT(1); } 00345 else { return eT(0); } 00346 }