data_t Struct Reference

#include <solver_binary.hpp>

List of all members.

Public Types

Public Member Functions

Static Public Member Functions

Public Attributes


Detailed Description

Definition at line 82 of file solver_binary.hpp.


Member Typedef Documentation

typedef double creal_t

Definition at line 83 of file solver_binary.hpp.

typedef unsigned sz_t

Definition at line 84 of file solver_binary.hpp.

typedef unsigned unsigned_t

Definition at line 85 of file solver_binary.hpp.


Constructor & Destructor Documentation

data_t (  )  [inline]

Definition at line 97 of file solver_binary.hpp.

References data_t::m_data.

00097 : eps(1e-6) { m_data = 0; };

data_t ( bool  isl  )  [inline]

Definition at line 98 of file solver_binary.hpp.

References data_t::m_data.

00098 : eps(1e-6), isole(isl) { m_data = 0; };

data_t ( const creal_t e  )  [inline]

Definition at line 99 of file solver_binary.hpp.

References data_t::m_data.

00099 : eps(e) { m_data = 0; };

~data_t (  )  [inline]

Definition at line 100 of file solver_binary.hpp.

References data_t::Free().

00100 { Free(); };


Member Function Documentation

void alloc ( sz_t  s,
sz_t  cs,
sz_t  deep 
) [inline]

Definition at line 114 of file solver_binary.hpp.

References data_t::Free(), data_t::m_data, data_t::m_dmn, data_t::m_limit, data_t::m_res, data_t::m_s, and mmx::min().

Referenced by binary_subdivision< K >::run_loop().

00115     { 
00116       Free();
00117       m_s = s;
00118       m_limit = std::min((sz_t)numerics::hdwi<sz_t>::nbit,deep);
00119       m_data  = new creal_t [ cs*m_limit ];
00120       m_dmn   = new bound   [ m_limit ];
00121       m_res.resize(0);
00122       //      std::cout<<"Alloc "<<m_limit<<std::endl;
00123     }

bound& bcka (  )  [inline]

Definition at line 126 of file solver_binary.hpp.

References data_t::m_res.

00126 { return m_res.back().a; };

const bound& bcka (  )  const [inline]

Definition at line 125 of file solver_binary.hpp.

References data_t::m_res.

Referenced by data_t::bstore(), data_t::estore(), data_t::setbck(), data_t::sstore(), and data_t::writebck().

00125 { return m_res.back().a; };

bound& bckb (  )  [inline]

Definition at line 128 of file solver_binary.hpp.

References data_t::m_res.

00128 { return m_res.back().b; };

const bound& bckb (  )  const [inline]

Definition at line 127 of file solver_binary.hpp.

References data_t::m_res.

Referenced by data_t::bstore(), data_t::estore(), data_t::setbck(), data_t::sstore(), and data_t::writebck().

00127 { return m_res.back().b; };

bool bckt (  )  const [inline]

Definition at line 131 of file solver_binary.hpp.

References data_t::m_res.

00131 { return m_res.back().t; };

bool& bckt (  )  [inline]

Definition at line 130 of file solver_binary.hpp.

References data_t::m_res.

Referenced by data_t::bstore(), data_t::estore(), data_t::mstore(), data_t::setbck(), and data_t::sstore().

00130 { return m_res.back().t; };

void bstore ( int  d,
int  t = 1 
) [inline]

Definition at line 162 of file solver_binary.hpp.

References data_t::bcka(), data_t::bckb(), data_t::bckt(), bound::m, data_t::m_dmn, and data_t::pshbck().

00163     {
00164       // m_data + d*m_s;
00165       pshbck();
00166       bcka() = m_dmn[d];
00167       bcka().m += t;
00168       bckb() = bcka();
00169       bckt() = true;
00170     };

void convert ( real &  a,
const bound b,
const homography< coeff > &  H 
) [inline]

Definition at line 226 of file solver_binary.hpp.

References homography< real >::a, homography< real >::b, homography< real >::c, homography< real >::d, bound::e, bound::m, mmx::reverse(), and data_t::root_bound.

00227     {
00228       unsigned_t m(b.m);
00229       numerics::hdwi<unsigned_t>::reverse(b.e+1,m);
00230       a = H.b;
00231       real d = -H.d;
00232       real x = H.a, y = -H.c;
00233       for ( unsigned i = 0; i < b.e + 1; x /= 2, y/=2, i ++ )
00234         {
00235           if ( m & 1 ) {a += x; d+=y;}
00236           m >>= 1;
00237         };
00238       //      std::cout <<"\n\t d= "<<d<<" a= "<<a<< std::endl;
00239       if(d==0 )
00240         {
00241           //  std::cout <<"\n\t rb= "<<this->root_bound<< std::endl;
00242           a = real(root_bound);
00243         }
00244       else
00245         {
00246           a /= real(-d);
00247           //std::cout <<"\t d!=0 a= "<<a<< std::endl;
00248         }
00249     };

static void convert ( real &  a,
const bound b,
const real &  first = 0,
const real &  scale = 1 
) [inline, static]

Definition at line 211 of file solver_binary.hpp.

References bound::e, bound::m, mmx::reverse(), and mmx::scale().

00213     {
00214       unsigned m(b.m);
00215       numerics::hdwi<unsigned_t>::reverse(b.e+1,m);
00216       a = first;
00217       real x = scale;
00218       for ( unsigned i = 0; i < b.e + 1; x /= 2, i ++ )
00219         {
00220           if ( m & 1 ) a += x;
00221           m >>= 1;
00222         };
00223     }

void estore ( int  d,
int  t = 1 
) [inline]

Definition at line 173 of file solver_binary.hpp.

References data_t::bcka(), data_t::bckb(), data_t::bckt(), bound::m, data_t::m_dmn, and data_t::pshbck().

00174     {
00175       // m_data + d*m_s;
00176       pshbck();
00177       bckb() = m_dmn[d];
00178       bckb().m += t;
00179       bcka() = bckb();
00180       bckt() = true;
00181     };

void Free (  )  [inline]

Definition at line 103 of file solver_binary.hpp.

References data_t::m_data, data_t::m_dmn, and data_t::m_res.

Referenced by data_t::alloc(), and data_t::~data_t().

00104     { 
00105       if ( m_data ) 
00106         { 
00107           delete[] m_data; 
00108           delete[] m_dmn; 
00109           m_res.resize(0); 
00110         }; 
00111     }

creal_t get_root_bound (  )  [inline]

Definition at line 208 of file solver_binary.hpp.

References data_t::root_bound.

00208 { return root_bound;}

void mstore ( int  d  )  [inline]

Definition at line 184 of file solver_binary.hpp.

References data_t::bckt(), and data_t::sstore().

Referenced by binary_subdivision< K >::Loop().

00185     {
00186       sstore(d);
00187       bckt() = false;
00188     };

sz_t nb_sol (  )  [inline]

Definition at line 191 of file solver_binary.hpp.

References data_t::m_res.

00191 { return m_res.size();}

void pshbck (  )  [inline]

Definition at line 145 of file solver_binary.hpp.

References data_t::m_res.

Referenced by data_t::bstore(), data_t::estore(), and data_t::sstore().

00146     {
00147       m_res.push_back(res_t());
00148     };

void set_back_a ( const bound a  )  [inline]

Definition at line 134 of file solver_binary.hpp.

References data_t::m_res.

00134 { m_res.back().a = a;};

void set_back_b ( const bound b  )  [inline]

Definition at line 135 of file solver_binary.hpp.

References data_t::m_res.

00135 { m_res.back().b = b;};

void setbck ( const bound a,
const bound b,
bool  type 
) [inline]

Definition at line 137 of file solver_binary.hpp.

References data_t::bcka(), data_t::bckb(), and data_t::bckt().

00138     {
00139       bcka() = a;
00140       bckb() = b;
00141       bckt() = type;
00142     };

sz_t size ( void   )  const [inline]

Definition at line 190 of file solver_binary.hpp.

References data_t::m_res.

00190 { return m_res.size(); };

void sstore ( int  d,
int  t = 1 
) [inline]

Definition at line 151 of file solver_binary.hpp.

References data_t::bcka(), data_t::bckb(), data_t::bckt(), bound::m, data_t::m_dmn, and data_t::pshbck().

Referenced by binary_subdivision< K >::Loop(), and data_t::mstore().

00152     {
00153       // m_data + d*m_s;
00154       pshbck();
00155       bcka() = m_dmn[d];
00156       bckb() = bcka();
00157       bckb().m += t;
00158       bckt() = true;
00159     };

void writebck (  )  [inline]

Definition at line 201 of file solver_binary.hpp.

References data_t::bcka(), data_t::bckb(), bound::e, and bound::m.

00202     {
00203       std::cout << "Back " << std::endl;
00204       std::cout << "\tA = " << bcka().e << " , " << bcka().m  << std::endl;
00205       std::cout << "\tB = " << bckb().e << " , " << bckb().m  << std::endl;
00206     };

void writedomain ( int  d  )  [inline]

Definition at line 194 of file solver_binary.hpp.

References bound::e, bound::m, and data_t::m_dmn.

00195     {
00196       std::cout << "Domaine-" << d << std::endl;
00197       std::cout << "\thauteur = " << m_dmn[d].e << std::endl;
00198       std::cout << "\tvaleur  = " << m_dmn[d].m << std::endl;
00199     };


Member Data Documentation

Definition at line 93 of file solver_binary.hpp.

bool isole

Definition at line 94 of file solver_binary.hpp.

Definition at line 92 of file solver_binary.hpp.

Definition at line 91 of file solver_binary.hpp.

Definition at line 89 of file solver_binary.hpp.

Referenced by data_t::alloc(), and binary_subdivision< K >::Loop().

std::vector<res_t> m_res

Definition at line 90 of file solver_binary.hpp.

Referenced by data_t::alloc(), and binary_subdivision< K >::Loop().

Definition at line 93 of file solver_binary.hpp.

Referenced by data_t::convert(), and data_t::get_root_bound().


The documentation for this struct was generated from the following file:

Generated on 6 Dec 2012 for realroot by  doxygen 1.6.1