eop_aux Class Reference
[Eop_aux]

#include <eop_aux.hpp>

List of all members.

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 ()

Detailed Description

Definition at line 120 of file eop_aux.hpp.


Member Function Documentation

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::acos ( const eT &  x  )  [inline, static]

Definition at line 130 of file eop_aux.hpp.

Referenced by acos().

00130 { return std::acos(double(x)); }

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::asin ( const eT &  x  )  [inline, static]

Definition at line 131 of file eop_aux.hpp.

Referenced by asin().

00131 { return std::asin(double(x)); }

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::atan ( const eT &  x  )  [inline, static]

Definition at line 132 of file eop_aux.hpp.

Referenced by atan().

00132 { return std::atan(double(x)); }

template<typename eT >
static arma_inline arma_float_only<eT>::result eop_aux::acos ( const eT &  x  )  [inline, static]

Definition at line 134 of file eop_aux.hpp.

References acos().

00134 { return std::acos(x); }

template<typename eT >
static arma_inline arma_float_only<eT>::result eop_aux::asin ( const eT &  x  )  [inline, static]

Definition at line 135 of file eop_aux.hpp.

References asin().

00135 { return std::asin(x); }

template<typename eT >
static arma_inline arma_float_only<eT>::result eop_aux::atan ( const eT &  x  )  [inline, static]

Definition at line 136 of file eop_aux.hpp.

References atan().

00136 { return std::atan(x); }

template<typename T >
static arma_inline std::complex<T> eop_aux::acos ( const std::complex< T > &  x  )  [inline, static]

Definition at line 138 of file eop_aux.hpp.

References acos().

00138 { return arma_boost_wrap(acos,  x); }

template<typename T >
static arma_inline std::complex<T> eop_aux::asin ( const std::complex< T > &  x  )  [inline, static]

Definition at line 139 of file eop_aux.hpp.

References asin().

00139 { return arma_boost_wrap(asin,  x); }

template<typename T >
static arma_inline std::complex<T> eop_aux::atan ( const std::complex< T > &  x  )  [inline, static]

Definition at line 140 of file eop_aux.hpp.

References atan().

00140 { return arma_boost_wrap(atan,  x); }

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::acosh ( const eT &  x  )  [inline, static]

Definition at line 142 of file eop_aux.hpp.

Referenced by acosh().

00142 { return arma_boost_wrap(acosh, double(x)); }

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::asinh ( const eT &  x  )  [inline, static]

Definition at line 143 of file eop_aux.hpp.

Referenced by asinh().

00143 { return arma_boost_wrap(asinh, double(x)); }

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::atanh ( const eT &  x  )  [inline, static]

Definition at line 144 of file eop_aux.hpp.

Referenced by atanh().

00144 { return arma_boost_wrap(atanh, double(x)); }

template<typename eT >
static arma_inline arma_float_only<eT>::result eop_aux::acosh ( const eT &  x  )  [inline, static]

Definition at line 146 of file eop_aux.hpp.

References acosh().

00146 { return arma_boost_wrap(acosh, x); }

template<typename eT >
static arma_inline arma_float_only<eT>::result eop_aux::asinh ( const eT &  x  )  [inline, static]

Definition at line 147 of file eop_aux.hpp.

References asinh().

00147 { return arma_boost_wrap(asinh, x); }

template<typename eT >
static arma_inline arma_float_only<eT>::result eop_aux::atanh ( const eT &  x  )  [inline, static]

Definition at line 148 of file eop_aux.hpp.

References atanh().

00148 { return arma_boost_wrap(atanh, x); }

template<typename T >
static arma_inline std::complex<T> eop_aux::acosh ( const std::complex< T > &  x  )  [inline, static]

Definition at line 150 of file eop_aux.hpp.

References acosh().

00150 { return arma_boost_wrap(acosh, x); }

template<typename T >
static arma_inline std::complex<T> eop_aux::asinh ( const std::complex< T > &  x  )  [inline, static]

Definition at line 151 of file eop_aux.hpp.

References asinh().

00151 { return arma_boost_wrap(asinh, x); }

template<typename T >
static arma_inline std::complex<T> eop_aux::atanh ( const std::complex< T > &  x  )  [inline, static]

Definition at line 152 of file eop_aux.hpp.

References atanh().

00152 { return arma_boost_wrap(atanh, x); }

template<typename eT >
static arma_inline eT eop_aux::conj ( const eT &  x  )  [inline, static]

Definition at line 156 of file eop_aux.hpp.

Referenced by conj().

00156 { return x;            }

template<typename T >
static arma_inline std::complex<T> eop_aux::conj ( const std::complex< T > &  x  )  [inline, static]

Definition at line 157 of file eop_aux.hpp.

References conj().

00157 { return std::conj(x); }

template<typename T1 , typename T2 >
static arma_inline T1 eop_aux::pow ( const T1  base,
const T2  exponent 
) [inline, static]

Definition at line 161 of file eop_aux.hpp.

Referenced by direct_eps(), and pow_int().

00161 { return std::pow(base, exponent); }

template<typename T2 >
static arma_inline char eop_aux::pow ( const char  base,
const T2  exponent 
) [inline, static]

Definition at line 164 of file eop_aux.hpp.

References pow().

00164 { typedef char  out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T2 >
static arma_inline short eop_aux::pow ( const short  base,
const T2  exponent 
) [inline, static]

Definition at line 167 of file eop_aux.hpp.

References pow().

00167 { typedef short out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T2 >
static arma_inline int eop_aux::pow ( const int  base,
const T2  exponent 
) [inline, static]

Definition at line 170 of file eop_aux.hpp.

References pow().

00170 { typedef int   out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T2 >
static arma_inline long eop_aux::pow ( const long  base,
const T2  exponent 
) [inline, static]

Definition at line 173 of file eop_aux.hpp.

References pow().

00173 { typedef long  out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T2 >
static arma_inline unsigned char eop_aux::pow ( const unsigned char  base,
const T2  exponent 
) [inline, static]

Definition at line 177 of file eop_aux.hpp.

References pow().

00177 { typedef unsigned char  out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T2 >
static arma_inline unsigned short eop_aux::pow ( const unsigned short  base,
const T2  exponent 
) [inline, static]

Definition at line 180 of file eop_aux.hpp.

References pow().

00180 { typedef unsigned short out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T2 >
static arma_inline unsigned int eop_aux::pow ( const unsigned int  base,
const T2  exponent 
) [inline, static]

Definition at line 183 of file eop_aux.hpp.

References pow().

00183 { typedef unsigned int   out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T2 >
static arma_inline unsigned long eop_aux::pow ( const unsigned long  base,
const T2  exponent 
) [inline, static]

Definition at line 186 of file eop_aux.hpp.

References pow().

00186 { typedef unsigned long  out_t; return out_t( std::pow(double(base), double(exponent) ) ); }

template<typename T1 >
static arma_inline T1 eop_aux::pow_int ( const T1  base,
const int  exponent 
) [inline, static]

Definition at line 191 of file eop_aux.hpp.

References pow().

Referenced by eop_cube_core< eop_cube_type >::process(), and eop_core< eop_type >::process().

00191 { return std::pow(base, exponent); }

static arma_inline char eop_aux::pow_int ( const char  base,
const int  exponent 
) [inline, static]

Definition at line 194 of file eop_aux.hpp.

References pow().

00194 { 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 197 of file eop_aux.hpp.

References pow().

00197 { 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 200 of file eop_aux.hpp.

References pow().

00200 { 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 203 of file eop_aux.hpp.

References pow().

00203 { 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 207 of file eop_aux.hpp.

References pow().

00207 { 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 210 of file eop_aux.hpp.

References pow().

00210 { 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 213 of file eop_aux.hpp.

References pow().

00213 { 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 216 of file eop_aux.hpp.

References pow().

00216 { typedef unsigned long  out_t; return out_t( std::pow(double(base), exponent) ); }

template<typename eT >
static eT eop_aux::trunc_exp ( const eT  x  )  [inline, static]

Definition at line 225 of file eop_aux.hpp.

References exp(), and max().

00226     {
00227     if(std::numeric_limits<eT>::is_iec559 && (x >= Math<eT>::log_max() ))
00228       {
00229       return std::numeric_limits<eT>::max();
00230       }
00231     else
00232       {
00233       return std::exp(x);
00234       }
00235     }

template<typename T >
static std::complex<T> eop_aux::trunc_exp ( const std::complex< T > &  x  )  [inline, static]

Definition at line 243 of file eop_aux.hpp.

References exp().

00244     {
00245     return std::exp(x);
00246     }

template<typename eT >
static eT eop_aux::trunc_log ( const eT  x  )  [inline, static]

Definition at line 254 of file eop_aux.hpp.

References log().

00255     {
00256     if(std::numeric_limits<eT>::is_iec559)
00257       {
00258       if(x == std::numeric_limits<eT>::infinity())
00259         {
00260         return Math<eT>::log_max();
00261         }
00262       else
00263       if(x <= eT(0))
00264         {
00265         return Math<eT>::log_min();
00266         }
00267       else
00268         {
00269         return std::log(x);
00270         }
00271       }
00272     else
00273       {
00274       return std::log(x);
00275       }
00276     }

template<typename T >
static std::complex<T> eop_aux::trunc_log ( const std::complex< T > &  x  )  [inline, static]

Definition at line 284 of file eop_aux.hpp.

References log().

00285     {
00286     return std::log(x);
00287     }

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::direct_eps ( const eT &  x  )  [inline, static]

Definition at line 295 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().

00296     {
00297     return eT(0);
00298     }

template<typename eT >
static arma_float_only<eT>::result eop_aux::direct_eps ( const eT &  x  )  [inline, static]

Definition at line 306 of file eop_aux.hpp.

References abs(), log10(), and pow().

00307     {
00308     //arma_extra_debug_sigprint();
00309     
00310     // acording to IEEE Standard for Floating-Point Arithmetic (IEEE 754)
00311     // the mantissa length for double is 53 bits = std::numeric_limits<double>::digits
00312     // the mantissa length for float  is 24 bits = std::numeric_limits<float >::digits
00313     
00314     //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)) );
00315     
00316     const eT radix_eT     = eT(std::numeric_limits<eT>::radix);
00317     const eT digits_m1_eT = eT(std::numeric_limits<eT>::digits - 1);
00318     
00319     // return std::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) );
00320     return eop_aux::pow( radix_eT, eT(std::floor(std::log10(std::abs(x))/std::log10(radix_eT)) - digits_m1_eT) );
00321     }

template<typename T >
static arma_float_only<T>::result eop_aux::direct_eps ( const std::complex< T > &  x  )  [inline, static]

Definition at line 329 of file eop_aux.hpp.

References abs(), log10(), and pow().

00330     {
00331     //arma_extra_debug_sigprint();
00332     
00333     //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)) );
00334     
00335     const T radix_T     = T(std::numeric_limits<T>::radix);
00336     const T digits_m1_T = T(std::numeric_limits<T>::digits - 1);
00337     
00338     return std::pow( radix_T, T(std::floor(std::log10(std::abs(x))/std::log10(radix_T)) - digits_m1_T) );
00339     }

template<typename eT >
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 345 of file eop_aux.hpp.

Referenced by eop_cube_core< eop_cube_type >::process(), and eop_core< eop_type >::process().

00345 { return x;           }

template<typename eT >
static arma_inline arma_signed_integral_only<eT>::result eop_aux::arma_abs ( const eT &  x  )  [inline, static]

Definition at line 348 of file eop_aux.hpp.

References abs().

00348 { return std::abs(x); }

template<typename eT >
static arma_inline arma_float_only<eT>::result eop_aux::arma_abs ( const eT &  x  )  [inline, static]

Definition at line 351 of file eop_aux.hpp.

References abs().

00351 { return std::abs(x); }

template<typename T >
static arma_inline arma_float_only<T>::result eop_aux::arma_abs ( const std::complex< T > &  x  )  [inline, static]

Definition at line 354 of file eop_aux.hpp.

References abs().

00354 { return std::abs(x); }

template<typename eT , typename eop_type >
static arma_inline eT eop_aux::generate (  )  [inline, static]

Definition at line 362 of file eop_aux.hpp.

00363     {
00364          if(is_same_type<eop_type, eop_rand          >::value == true) { return eT(eop_aux_rand<eT>());  }
00365     else if(is_same_type<eop_type, eop_randn         >::value == true) { return eT(eop_aux_randn<eT>()); }
00366     else if(is_same_type<eop_type, eop_zeros         >::value == true) { return eT(0);                   }
00367     else if(is_same_type<eop_type, eop_ones_full     >::value == true) { return eT(1);                   }
00368     else if(is_same_type<eop_type, eop_cube_rand     >::value == true) { return eT(eop_aux_rand<eT>());  }
00369     else if(is_same_type<eop_type, eop_cube_randn    >::value == true) { return eT(eop_aux_randn<eT>()); }
00370     else if(is_same_type<eop_type, eop_cube_zeros    >::value == true) { return eT(0);                   }
00371     else if(is_same_type<eop_type, eop_cube_ones_full>::value == true) { return eT(1);                   }
00372     else                                                               { return eT(0);                   }
00373     }