realroot_doc 0.1.1
bsearch< real_t > Struct Template Reference

#include <system_descartes1d.hpp>

List of all members.

Public Member Functions

Public Attributes


Detailed Description

template<class real_t>
struct mmx::solvers::bsearch< real_t >

Definition at line 25 of file system_descartes1d.hpp.


Constructor & Destructor Documentation

bsearch ( const In &  bzrep,
unsigned  sz 
) [inline]

Definition at line 34 of file system_descartes1d.hpp.

References mmx::sparse::copy(), bsearch< real_t >::m_data, bsearch< real_t >::m_mons, and bzenv< X >::toMonoms().

                                              : m_sz(sz) 
    {
      m_data = new real_t[ 2*sz ];
      std::copy( bzrep, bzrep + sz, m_data );
      m_mons = m_data + sz;
      std::copy( m_data, m_data + sz, m_mons );
      bernstein::bzenv<real_t>::_default_->toMonoms( m_mons, sz );
    };
~bsearch ( ) [inline]

Definition at line 42 of file system_descartes1d.hpp.

References bsearch< real_t >::m_data.

{ delete[] m_data; };

Member Function Documentation

void reach ( real_t *  lbzrep,
real_t &  a,
real_t &  b,
const real_t &  eps 
) [inline]

Definition at line 44 of file system_descartes1d.hpp.

References mmx::upoldse_::horner(), bsearch< real_t >::m_mons, and bsearch< real_t >::m_sz.

    {
      real_t m;
      if ( lbzrep[m_sz-1] > lbzrep[0] ) 
        do
          if ( upoldse_::horner( m_mons, m_sz, m=(a+b)/2.0 ) < 0  ) a = m; else b = m; 
        while( b-a > eps ) ;
      else
        do
          if ( upoldse_::horner( m_mons, m_sz, m=(a+b)/2.0 ) < 0  ) b = m; else a = m;
        while( b-a > eps ); 
    };

Member Data Documentation

real_t* m_data
real_t* m_mons

Definition at line 28 of file system_descartes1d.hpp.

Referenced by bsearch< real_t >::bsearch(), and bsearch< real_t >::reach().

unsigned m_mxsz

Definition at line 30 of file system_descartes1d.hpp.

unsigned m_sz

Definition at line 29 of file system_descartes1d.hpp.

Referenced by bsearch< real_t >::reach().


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