6 #ifndef realroot_SOLVE_SBDSLV_PARALLEL_HPP
7 #define realroot_SOLVE_SBDSLV_PARALLEL_HPP
28 template<
class system >
41 for ( s = i = 0; i < 4*this->
nbp(); s += this->
pmsz(iptr+i)+this->
pMsz(iptr+i), i += 4 ) ;
44 for ( i = 0; i < 4*this->
nbp(); s += this->
pmsz(iptr+i)+this->
pMsz(iptr+i), i += 4 )
46 this->
pmsz(inext+i) = this->
pmsz(iptr+i);
47 this->
pmad(inext+i) = s;
48 this->
pMad(inext+i) = s + this->
pmsz(iptr+i);
49 this->
pMsz(inext+i) = this->
pMsz(iptr+i);
57 for ( s = i = 0; i < 4*this->
m_nbp; s += this->
pmsz(iptr+i)+this->
pMsz(iptr+i), i += 4 ) ;
60 iptr = iptr - 4*this->
nbp();
65 bool process( std::vector<interval_t>& reductions,
const vstack_t& vp,
const creal_t& eps = 1e-3,
int k = 12 )
68 sz_t iptr, inext, mxsgn,
sgn, i, nmult;
77 for ( mxsgn = i = 0; i < 4*this->
nbp(); i += 4 )
81 this->
pmsz(iptr+i) = 0;
82 if ( * this->
pmdata(iptr+i) > 0.0 )
break;
84 if ( mxsgn < sgn ) mxsgn =
sgn;
86 if ( i < 4*this->
nbp() ) { iptr =
pdec(iptr); itk --;
continue; };
89 for ( i = 0; i < 4*this->
nbp(); i += 4 )
93 this->
pMsz(iptr+i) = 0;
94 if ( * this->
pMdata(iptr+i) < 0.0 )
break;
96 if ( mxsgn < sgn ) mxsgn =
sgn;
98 if ( i < 4*this->
nbp() ) { iptr =
pdec(iptr); itk --;
continue; };
101 if ( !mxsgn || (this->
pupper(iptr)-this->
plower(iptr)) < eps )
103 if ( reductions.size() == 0 || reductions.back().upper() != this->
plower(iptr) )
104 reductions.push_back(interval_t(this->
plower(iptr),this->
pupper(iptr)));
106 reductions.back().define(reductions.back().lower(),this->
pupper( iptr ));
107 iptr =
pdec( iptr ); itk --;
118 for ( i = 0; i < 4*this->
nbp(); i += 4 )
119 if ( this->
pmsz(iptr+i) )
121 nmult += this->
pmsz(iptr+i)*(this->
pmsz(iptr+i)-1);
130 for ( i = 0; i < 4*this->
nbp(); i += 4 )
131 if ( this->
pMsz(iptr+i) )
133 nmult += this->
pMsz(iptr+i)*(this->
pMsz(iptr+i)-1);
152 return reductions.size() != 0;
dstack_t::interval_t interval_t
Definition: system_system.h:31
sz_t pinc(sz_t iptr)
Definition: strgy_rdslv_parallel.hpp:37
creal_t * pMdata(sz_t iptr)
Definition: system_vstack.h:40
sz_t alloci(sz_t sz)
Definition: system_vstack.h:49
void decasteljau(real_t *r, unsigned sz, const real_t &t, int str=1)
Definition: loops_brnops.hpp:23
sz_t & pMsz(sz_t iptr)
Definition: system_vstack.h:33
creal_t * pmdata(sz_t iptr)
Definition: system_vstack.h:38
system::interval_t interval_t
Definition: strgy_rdslv_parallel.hpp:32
Definition: strgy_rdslv_parallel.hpp:29
sz_t & pMad(sz_t iptr)
Definition: system_vstack.h:35
memory::linear_allocator< creal_t > m_cpchnk
Definition: system_vstack.h:21
sz_t m_nbp
Definition: system_vstack.h:20
vstack_t::sz_t sz_t
Definition: strgy_rdslv_parallel.hpp:34
Definition: rounding_mode.hpp:71
bool process(std::vector< interval_t > &reductions, const vstack_t &vp, const creal_t &eps=1e-3, int k=12)
Definition: strgy_rdslv_parallel.hpp:65
void copy(const vstack &vs)
Definition: system_vstack.h:103
real_t creal_t
Definition: system_system.h:28
unsigned sz_t
Definition: system_vstack.h:18
sz_t pdec(sz_t iptr)
Definition: strgy_rdslv_parallel.hpp:54
sz_t & pmad(sz_t iptr)
Definition: system_vstack.h:31
bool sgnchg(real_t const *const b, unsigned sz, int st=1)
Definition: loops_vctops.hpp:154
int sgn(FT a)
Sign of a.
Definition: solver_mv_monomial_tests.hpp:416
sz_t nbp() const
Definition: system_vstack.h:21
void dec(sz_t sz)
Definition: system_linear_allocator.h:72
Definition: system_vstack.h:16
system::creal_t creal_t
Definition: strgy_rdslv_parallel.hpp:31
system::vstack_t vstack_t
Definition: strgy_rdslv_parallel.hpp:33
creal_t & plower(sz_t iptr)
Definition: system_vstack.h:43
creal_t & pupper(sz_t iptr)
Definition: system_vstack.h:45
memory::linear_allocator< sz_t > m_ipchnk
Definition: system_vstack.h:24
sz_t allocc(sz_t sz)
Definition: system_vstack.h:48
sz_t & pmsz(sz_t iptr)
Definition: system_vstack.h:29
#define assert(expr, msg)
Definition: shared_object.hpp:57