mmx::numerics Namespace Reference

Namespaces

Classes

Functions


Function Documentation

T mmx::numerics::add_dw ( const T &  a,
const T &  b 
) [inline]

Definition at line 70 of file rounding_mode.hpp.

00070 { rounding<T> r(rounding<T>::rnd_dw()); return a+b; };

T mmx::numerics::add_up ( const T &  a,
const T &  b 
) [inline]

Definition at line 71 of file rounding_mode.hpp.

00071 { rounding<T> r(rounding<T>::rnd_up()); return a+b; };

unsigned mmx::numerics::bitprec ( const T &  e,
const T &  l = T(1.0) 
) [inline]

Definition at line 29 of file numerics_hdwi.hpp.

Referenced by binary_sleeve_subdivision< K >::run(), binary_sleeve_subdivision< K >::run_loop(), and binary_subdivision< K >::run_loop().

00030   {
00031     T tmp(l);
00032     unsigned b = 2;
00033     while ( tmp > e ) { tmp/=2; b++; };
00034     return b;
00035   };

T mmx::numerics::div_dw ( const T &  a,
const T &  b 
) [inline]

Definition at line 68 of file rounding_mode.hpp.

00068 { rounding<T> r(rounding<T>::rnd_dw()); return a/b; };

T mmx::numerics::div_up ( const T &  a,
const T &  b 
) [inline]

Definition at line 69 of file rounding_mode.hpp.

00069 { rounding<T> r(rounding<T>::rnd_up()); return a/b; };

int mmx::numerics::get_cw (  )  [inline]

Definition at line 15 of file rounding_mode.hpp.

00015 { return fegetround(); };

int mmx::numerics::get_rnd (  )  [inline]

Definition at line 16 of file rounding_mode.hpp.

00016 { return fegetround(); };

void mmx::numerics::hsal ( unsigned &  ha,
unsigned_t &  a,
unsigned &  hb,
unsigned_t &  b 
) [inline]

Definition at line 108 of file numerics_hdwi.hpp.

References sal().

00109   {
00110     if ( ha == hb ) return; // 
00111     if ( ha > hb )
00112       {
00113         sal(b,ha-hb);
00114         hb = ha;
00115       }
00116     else hsal(hb,b,ha,a);
00117   };

T mmx::numerics::mul_dw ( const T &  a,
const T &  b 
) [inline]

Definition at line 72 of file rounding_mode.hpp.

00072 { rounding<T> r(rounding<T>::rnd_dw()); return a*b; };

T mmx::numerics::mul_up ( const T &  a,
const T &  b 
) [inline]

Definition at line 73 of file rounding_mode.hpp.

00073 { rounding<T> r(rounding<T>::rnd_up()); return a*b; };

static int mmx::numerics::rnd_dw (  )  [inline, static]
static int mmx::numerics::rnd_nr (  )  [inline, static]

Definition at line 20 of file rounding_mode.hpp.

00020 { return FE_TONEAREST;};

static int mmx::numerics::rnd_up (  )  [inline, static]
static int mmx::numerics::rnd_z (  )  [inline, static]

Definition at line 21 of file rounding_mode.hpp.

00021 { return FE_TOWARDZERO;};

void mmx::numerics::sal ( unsigned_t &  a,
unsigned  n 
) [inline]

Definition at line 82 of file numerics_hdwi.hpp.

References assert.

Referenced by hsal().

00083   {
00084     assert(n<=hdwi<unsigned_t>::nbit);
00085     if ( a & 1 )
00086       {
00087         unsigned_t msk(hdwi<unsigned_t>::nmax);
00088         msk >>= (hdwi<unsigned_t>::nbit-n);
00089         a <<= n;
00090         a |= msk;
00091       }
00092     else 
00093       {
00094         //      std::cout << "SAL( " << n << ") \n";
00095         //      std::cout << a << std::endl;
00096         a <<= n;
00097         //      std::cout << a << std::endl;
00098       };
00099           
00100   };

void mmx::numerics::set_cw ( int  cw  )  [inline]

Definition at line 17 of file rounding_mode.hpp.

00017 { fesetround(cw);};

T mmx::numerics::sub_dw ( const T &  a,
const T &  b 
) [inline]

Definition at line 74 of file rounding_mode.hpp.

00074 { rounding<T> r(rounding<T>::rnd_dw()); return a-b; };

T mmx::numerics::sub_up ( const T &  a,
const T &  b 
) [inline]

Definition at line 75 of file rounding_mode.hpp.

00075 { rounding<T> r(rounding<T>::rnd_up()); return a-b; };


Generated on 6 Dec 2012 for realroot by  doxygen 1.6.1