realroot_doc 0.1.1
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.

: 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.

: 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.

: eps(e) { m_data = 0; };
~data_t ( ) [inline]

Definition at line 100 of file solver_binary.hpp.

References data_t::Free().

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

    { 
      Free();
      m_s = s;
      m_limit = std::min((sz_t)numerics::hdwi<sz_t>::nbit,deep);
      m_data  = new creal_t [ cs*m_limit ];
      m_dmn   = new bound   [ m_limit ];
      m_res.resize(0);
      //      std::cout<<"Alloc "<<m_limit<<std::endl;
    }
bound& bcka ( ) [inline]

Definition at line 126 of file solver_binary.hpp.

References data_t::m_res.

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

{ return m_res.back().a; };
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().

{ return m_res.back().b; };
bound& bckb ( ) [inline]

Definition at line 128 of file solver_binary.hpp.

References data_t::m_res.

{ return m_res.back().b; };
bool bckt ( ) const [inline]

Definition at line 131 of file solver_binary.hpp.

References data_t::m_res.

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

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

    {
      // m_data + d*m_s;
      pshbck();
      bcka() = m_dmn[d];
      bcka().m += t;
      bckb() = bcka();
      bckt() = true;
    };
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.

    {
      unsigned_t m(b.m);
      numerics::hdwi<unsigned_t>::reverse(b.e+1,m);
      a = H.b;
      real d = -H.d;
      real x = H.a, y = -H.c;
      for ( unsigned i = 0; i < b.e + 1; x /= 2, y/=2, i ++ )
        {
          if ( m & 1 ) {a += x; d+=y;}
          m >>= 1;
        };
      //      std::cout <<"\n\t d= "<<d<<" a= "<<a<< std::endl;
      if(d==0 )
        {
          //  std::cout <<"\n\t rb= "<<this->root_bound<< std::endl;
          a = real(root_bound);
        }
      else
        {
          a /= real(-d);
          //std::cout <<"\t d!=0 a= "<<a<< std::endl;
        }
    };
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().

    {
      unsigned m(b.m);
      numerics::hdwi<unsigned_t>::reverse(b.e+1,m);
      a = first;
      real x = scale;
      for ( unsigned i = 0; i < b.e + 1; x /= 2, i ++ )
        {
          if ( m & 1 ) a += x;
          m >>= 1;
        };
    }
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().

    {
      // m_data + d*m_s;
      pshbck();
      bckb() = m_dmn[d];
      bckb().m += t;
      bcka() = bckb();
      bckt() = true;
    };
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().

    { 
      if ( m_data ) 
        { 
          delete[] m_data; 
          delete[] m_dmn; 
          m_res.resize(0); 
        }; 
    }
creal_t get_root_bound ( ) [inline]

Definition at line 208 of file solver_binary.hpp.

References data_t::root_bound.

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

    {
      sstore(d);
      bckt() = false;
    };
sz_t nb_sol ( ) [inline]

Definition at line 191 of file solver_binary.hpp.

References data_t::m_res.

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

    {
      m_res.push_back(res_t());
    };
void set_back_a ( const bound a) [inline]

Definition at line 134 of file solver_binary.hpp.

References data_t::m_res.

{ 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.

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

    {
      bcka() = a;
      bckb() = b;
      bckt() = type;
    };
sz_t size ( void  ) const [inline]

Definition at line 190 of file solver_binary.hpp.

References data_t::m_res.

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

    {
      // m_data + d*m_s;
      pshbck();
      bcka() = m_dmn[d];
      bckb() = bcka();
      bckb().m += t;
      bckt() = true;
    };
void writebck ( ) [inline]

Definition at line 201 of file solver_binary.hpp.

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

    {
      std::cout << "Back " << std::endl;
      std::cout << "\tA = " << bcka().e << " , " << bcka().m  << std::endl;
      std::cout << "\tB = " << bckb().e << " , " << bckb().m  << std::endl;
    };
void writedomain ( int  d) [inline]

Definition at line 194 of file solver_binary.hpp.

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

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

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

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: