#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, and bsearch_newton2< real_t >::m_mons.
~bsearch_newton2 | ( | ) | [inline] |
Definition at line 212 of file system_descartes1d.hpp.
References bsearch_newton2< real_t >::m_data.
00212 { 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.
00215 { 00216 real_t m; 00217 if ( lbzrep[m_sz-1] > lbzrep[0] ) 00218 do 00219 { 00220 // - 00221 // - 00222 // ----------------- 00223 // - 00224 // - 00225 //std::cout << (b-a) << std::endl; 00226 real_t p,dp,x; 00227 upoldse_::dhorner( p, dp, m_mons, m_sz, m = (a+b)/2.0 ); 00228 if ( p < 0 ) a = m; else b = m; 00229 if ( dp > eps ) 00230 { 00231 real_t ex; 00232 int c = 0; 00233 x = m; 00234 do 00235 { 00236 ex = x; 00237 x = x - p/dp; 00238 c ++ ; 00239 upoldse_::dhorner(p,dp,m_mons,m_sz,x); 00240 } 00241 while ( c < 6 ); 00242 if ( x > a && x < b ) 00243 { 00244 if ( p < 0 ) 00245 { 00246 a = x; 00247 p = upoldse_::horner(m_mons,m_sz,x+eps/2); 00248 if ( p > 0 ) b = x+eps; 00249 } 00250 else 00251 { 00252 b = x; 00253 p = upoldse_::horner(m_mons,m_sz,x-eps/2); 00254 if ( p < 0 ) a = x-eps/2; 00255 }; 00256 }; 00257 }; 00258 } 00259 while( b-a > eps ); 00260 else 00261 do 00262 { 00263 // std::cout << (b-a) << std::endl; 00264 real_t p,dp,x; 00265 upoldse_::dhorner( p, dp, m_mons, m_sz, m = (a+b)/2.0 ); 00266 if ( p < 0 ) b = m; else a = m; 00267 if ( dp > eps ) 00268 { 00269 real_t ex; 00270 int c = 0; 00271 x = m; 00272 do 00273 { 00274 ex = x; 00275 x = x - p/dp; 00276 c ++ ; 00277 upoldse_::dhorner(p,dp,m_mons,m_sz,x); 00278 } 00279 while (c < 6 ); 00280 00281 if ( x > a && x < b ) 00282 { 00283 if ( p < 0 ) 00284 { 00285 b = x; 00286 p = upoldse_::horner(m_mons,m_sz,x-eps/2); 00287 if ( p > 0 ) a = x-eps/2; 00288 } 00289 else 00290 { 00291 a = x; 00292 p = upoldse_::horner(m_mons,m_sz,x+eps/2); 00293 if ( p < 0 ) b = x-eps/2; 00294 }; 00295 }; 00296 } 00297 } 00298 while( b-a > eps ); 00299 };
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().