realroot_doc 0.1.1
|
#include <system_descartes1d.hpp>
Definition at line 198 of file system_descartes1d.hpp.
bsearch_newton2 | ( | const In & | bzrep, |
unsigned | sz | ||
) | [inline] |
Definition at line 204 of file system_descartes1d.hpp.
References mmx::sparse::copy(), bsearch_newton2< real_t >::m_data, bsearch_newton2< real_t >::m_mons, and bzenv< X >::toMonoms().
~bsearch_newton2 | ( | ) | [inline] |
Definition at line 212 of file system_descartes1d.hpp.
References bsearch_newton2< real_t >::m_data.
{ delete[] m_data; };
void reach | ( | real_t * | lbzrep, |
real_t & | a, | ||
real_t & | b, | ||
const real_t & | eps | ||
) | [inline] |
Definition at line 214 of file system_descartes1d.hpp.
References mmx::upoldse_::dhorner(), mmx::upoldse_::horner(), bsearch_newton2< real_t >::m_mons, and bsearch_newton2< real_t >::m_sz.
{ real_t m; if ( lbzrep[m_sz-1] > lbzrep[0] ) do { // - // - // ----------------- // - // - //std::cout << (b-a) << std::endl; real_t p,dp,x; upoldse_::dhorner( p, dp, m_mons, m_sz, m = (a+b)/2.0 ); if ( p < 0 ) a = m; else b = m; if ( dp > eps ) { real_t ex; int c = 0; x = m; do { ex = x; x = x - p/dp; c ++ ; upoldse_::dhorner(p,dp,m_mons,m_sz,x); } while ( c < 6 ); if ( x > a && x < b ) { if ( p < 0 ) { a = x; p = upoldse_::horner(m_mons,m_sz,x+eps/2); if ( p > 0 ) b = x+eps; } else { b = x; p = upoldse_::horner(m_mons,m_sz,x-eps/2); if ( p < 0 ) a = x-eps/2; }; }; }; } while( b-a > eps ); else do { // std::cout << (b-a) << std::endl; real_t p,dp,x; upoldse_::dhorner( p, dp, m_mons, m_sz, m = (a+b)/2.0 ); if ( p < 0 ) b = m; else a = m; if ( dp > eps ) { real_t ex; int c = 0; x = m; do { ex = x; x = x - p/dp; c ++ ; upoldse_::dhorner(p,dp,m_mons,m_sz,x); } while (c < 6 ); if ( x > a && x < b ) { if ( p < 0 ) { b = x; p = upoldse_::horner(m_mons,m_sz,x-eps/2); if ( p > 0 ) a = x-eps/2; } else { a = x; p = upoldse_::horner(m_mons,m_sz,x+eps/2); if ( p < 0 ) b = x-eps/2; }; }; } } while( b-a > eps ); };
real_t* m_data |
Definition at line 200 of file system_descartes1d.hpp.
Referenced by bsearch_newton2< real_t >::bsearch_newton2(), and bsearch_newton2< real_t >::~bsearch_newton2().
real_t* m_mons |
Definition at line 201 of file system_descartes1d.hpp.
Referenced by bsearch_newton2< real_t >::bsearch_newton2(), and bsearch_newton2< real_t >::reach().
unsigned m_sz |
Definition at line 202 of file system_descartes1d.hpp.
Referenced by bsearch_newton2< real_t >::reach().