11 # ifndef realroot_cell_mv_bernstein_hpp
12 # define realroot_cell_mv_bernstein_hpp
21 # define TMPL template<typename C>
22 # define SELF cell_mv_bernstein<C>
38 m_doms<<Interval<double>(0,1);
43 for(
unsigned i=0;i<E.
size();i++) m_equs<<E[i];
47 for(
unsigned i=0;i<D.size();i++) m_doms<<D[i];
48 for(
unsigned i=0;i<E.
size();i++) m_equs<<E[i];
54 for(
unsigned i=0;i<D.size();i++) {
56 dmn <<D[i].lower() <<D[i].upper();
59 for(
unsigned i=0;i<E.
size();i++) {
68 unsigned nbeq()
const {
return m_equs.size();}
69 unsigned nbeq() {
return m_equs.size();}
71 Polynomial
equation(
unsigned i)
const {
return m_equs[i];}
72 Polynomial&
equation(
unsigned i) {
return m_equs[i];}
74 unsigned nbvar()
const {
return m_doms.size();}
75 unsigned nbvar() {
return m_doms.size();}
85 for(
unsigned i=0;i<m_doms.size();i++)
98 SELF::cell_mv_bernstein(
void) {}
101 SELF::~cell_mv_bernstein(
void) {}
108 template<
class Cell,
class Stack>
112 static bool reduce(Cell* cl);
121 template<
class Cell,
class Stack>
void
125 Cell* left =
new Cell(*cl);
126 Cell* right =
new Cell(*cl);
129 typename Cell::Scalar s=cl->domain(0).upper()-cl->domain(0).lower(),s0;
130 for (
unsigned i=0;i<cl->nbvar();i++)
131 if((s0=cl->domain(i).upper()-cl->domain(i).lower())>s) {
134 typename Cell::Scalar m=(cl->domain(v).upper()+cl->domain(v).lower())/2;
136 for (
unsigned i=0;i<cl->nbeq();i++)
138 left->domain(v).upper()=m;
139 right->domain(v).lower()=m;
149 template<
class Cell>
bool
151 if(cl->size() <
m_eps)
return false;
152 for(
unsigned i=0;i<cl->nbeq();i++)
157 template<
class Cell>
bool
159 for(
unsigned i=0;i<cl->nbeq();i++)
168 static bool reduce(Cell* cl);
172 template<
class Cell>
bool
174 if(cl->size() <
m_eps)
return false;
175 std::cout<<
"isolate"<<std::endl;
176 for(
unsigned i=0;i<cl->nbeq();i++)
Seq< Interval< double > > & domain()
Definition: cell_mv_bernstein.hpp:78
Sequence of terms with reference counter.
Definition: Seq.hpp:28
Definition: cell_mv_bernstein.hpp:29
Seq< Interval< double > > domain() const
Definition: cell_mv_bernstein.hpp:77
#define TMPL
Definition: cell_mv_bernstein.hpp:21
polynomial< C, with< Bernstein > > Polynomial
Definition: cell_mv_bernstein.hpp:34
cell_mv_bernstein(const Seq< Polynomial > &E, const Seq< Interval< double > > &D)
Definition: cell_mv_bernstein.hpp:46
T upper(const Interval< T, r > &x)
Definition: Interval_fcts.hpp:89
cell_mv_bernstein(const Seq< POL > &E, const Seq< Interval< double > > &D)
Definition: cell_mv_bernstein.hpp:52
static void subdivide(Cell *cl, Stack *stack)
Definition: cell_mv_bernstein.hpp:122
C size(void) const
Definition: cell_mv_bernstein.hpp:83
unsigned nbvar() const
Definition: cell_mv_bernstein.hpp:74
unsigned nbvar()
Definition: cell_mv_bernstein.hpp:75
static double m_eps
Definition: cell_mv_bernstein.hpp:106
size_type size() const
Definition: Seq.hpp:166
Definition: cell_mv_bernstein.hpp:165
unsigned nbeq() const
Definition: cell_mv_bernstein.hpp:68
Interval< double > domain(unsigned i) const
Definition: cell_mv_bernstein.hpp:80
Definition: polynomial.hpp:37
cell_mv_bernstein(const Polynomial &p)
Definition: cell_mv_bernstein.hpp:37
unsigned nbeq()
Definition: cell_mv_bernstein.hpp:69
TMPL void split(Polynomial &r, Polynomial &p, int v)
Definition: polynomial_fcts.hpp:193
#define Scalar
Definition: polynomial_operators.hpp:12
Polynomial & equation(unsigned i)
Definition: cell_mv_bernstein.hpp:72
static bool regular(Cell *cl)
Definition: cell_mv_bernstein.hpp:158
C Scalar
Definition: cell_mv_bernstein.hpp:33
double C
Definition: solver_mv_fatarcs.cpp:16
Definition: cell_mv_bernstein.hpp:104
static bool reduce(Cell *cl)
Definition: cell_mv_bernstein.hpp:150
#define Stack
Definition: subdivisor.hpp:19
Polynomial equation(unsigned i) const
Definition: cell_mv_bernstein.hpp:71
void assign(A &a, const B &b)
Generic definition of the assignement function.
Definition: assign.hpp:97
bool has_sign_variation(Iterator b, Iterator e)
Definition: sign_variation.hpp:84
Interval< T, r > max(const Interval< T, r > &a, const Interval< T, r > &b)
Definition: Interval_fcts.hpp:135
static bool reduce(Cell *cl)
Definition: cell_mv_bernstein.hpp:173
cell_mv_bernstein(const Seq< Polynomial > &E)
Definition: cell_mv_bernstein.hpp:41
Interval< double > & domain(unsigned i)
Definition: cell_mv_bernstein.hpp:81