Static Public Member Functions

eop_aux Class Reference
[Eop_aux]

use of the SFINAE approach to work around compiler limitations //! http://en.wikipedia.org/wiki/SFINAE More...

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

Detailed Description

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.


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 126 of file eop_aux.hpp.

Referenced by acos().

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

Referenced by asin().

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

Referenced by atan().

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

References acos().

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

References asin().

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

References atan().

{ return std::atan(x); }

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

Definition at line 134 of file eop_aux.hpp.

References arma_acos().

{ return arma_acos(x); }

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

Definition at line 135 of file eop_aux.hpp.

References arma_asin().

{ return arma_asin(x); }

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

Definition at line 136 of file eop_aux.hpp.

References arma_atan().

{ return arma_atan(x); }

template<typename eT >
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)); }

template<typename eT >
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)); }

template<typename eT >
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)); }

template<typename eT >
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().

{ return arma_acosh(x); }

template<typename eT >
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().

{ return arma_asinh(x); }

template<typename eT >
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().

{ return arma_atanh(x); }

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

Definition at line 146 of file eop_aux.hpp.

Referenced by conj().

{ return x;            }

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

Definition at line 147 of file eop_aux.hpp.

References conj().

{ return std::conj(x); }

template<typename eT >
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().

{ return std::sqrt (double(x)); }

template<typename eT >
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)); }

template<typename eT >
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().

{ return std::log  (double(x)); }

template<typename eT >
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().

{ return std::exp  (double(x)); }

template<typename eT >
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().

{ return std::cos  (double(x)); }

template<typename eT >
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().

{ return std::sin  (double(x)); }

template<typename eT >
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().

{ return std::tan  (double(x)); }

template<typename eT >
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().

{ return std::cosh (double(x)); }

template<typename eT >
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().

{ return std::sinh (double(x)); }

template<typename eT >
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().

{ return std::tanh (double(x)); }

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

Definition at line 160 of file eop_aux.hpp.

References sqrt().

{ return std::sqrt (x); }

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

Definition at line 161 of file eop_aux.hpp.

References log10().

{ return std::log10(x); }

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

Definition at line 162 of file eop_aux.hpp.

References log().

{ return std::log  (x); }

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

Definition at line 163 of file eop_aux.hpp.

References exp().

{ return std::exp  (x); }

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

Definition at line 164 of file eop_aux.hpp.

References cos().

{ return std::cos  (x); }

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

Definition at line 165 of file eop_aux.hpp.

References sin().

{ return std::sin  (x); }

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

Definition at line 166 of file eop_aux.hpp.

References tan().

{ return std::tan  (x); }

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

Definition at line 167 of file eop_aux.hpp.

References cosh().

{ return std::cosh (x); }

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

Definition at line 168 of file eop_aux.hpp.

References sinh().

{ return std::sinh (x); }

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

Definition at line 169 of file eop_aux.hpp.

References tanh().

{ return std::tanh (x); }

template<typename T1 , typename T2 >
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);
    }

template<typename T1 , typename T2 >
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) ) );
    }

template<typename T1 >
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);
    }

template<typename T1 >
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) );
    }

template<typename eT >
static arma_inline arma_integral_only<eT>::result eop_aux::direct_eps ( const eT &  x  )  [inline, static]
template<typename eT >
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) );
    }

template<typename T >
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) );
    }

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 271 of file eop_aux.hpp.

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

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

References abs().

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

References abs().

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

References abs().

{ return std::abs(x); }

template<typename eT , typename eop_type >
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);                   }
    }