bsearch_castel< 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_castel< real_t >

Definition at line 59 of file system_descartes1d.hpp.


Constructor & Destructor Documentation

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

Definition at line 65 of file system_descartes1d.hpp.

References mmx::sparse::copy(), and bsearch_castel< real_t >::m_data.

00065                                                      : m_sz(sz) 
00066     {
00067       m_data = new real_t[ sz ];
00068       std::copy( bzrep, bzrep + sz, m_data );
00069     };

~bsearch_castel (  )  [inline]

Definition at line 70 of file system_descartes1d.hpp.

References bsearch_castel< real_t >::m_data.

00070 { 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 73 of file system_descartes1d.hpp.

References mmx::brnops::eval(), bsearch_castel< real_t >::m_data, and bsearch_castel< real_t >::m_sz.

00074     {
00075       real_t m;
00076       if ( lbzrep[m_sz-1] > lbzrep[0] ) 
00077         do
00078           if ( brnops::eval( m_data, m_sz, m = (a+b)/2.0 ) < 0  ) a = m; else b = m; 
00079         while( b-a > eps ) ;
00080       else
00081         do
00082           if ( brnops::eval( m_data, m_sz, m = (a+b)/2.0 ) < 0  ) b = m; else a = m;
00083         while( b-a > eps ); 
00084     };


Member Data Documentation

real_t* m_data
unsigned m_sz

Definition at line 62 of file system_descartes1d.hpp.

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


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

Generated on 6 Dec 2012 for realroot by  doxygen 1.6.1