4 #include "../DyadicRationalNumber/globals.h" 5 #include "../Symbol/Symbol.hpp" 22 res->left = a->left + b->left;
23 res->right = a->right + b->right;
39 std::vector<Interval> roots;
64 for (
int i = 1; i <= var; ++i) {
65 std::ostringstream convert;
66 convert << var - i + 1;
68 names[i] += convert.str();
78 std::copy(b.names, b.names+var+1, names);
100 std::copy(b.names, b.names+var+1, names);
119 return roots.size() / var;
140 roots.push_back(elem);
142 inline void pushInterval(
double l,
double r) {
146 roots.push_back(elem);
173 return &roots[k*var+l];
182 for (
int i = 0; i < var; ++i)
183 pIs.roots.push_back(roots[k*var+i]);
195 for (
int i = var, j = 0; i > 0; --i, ++j)
199 std::cout <<
"BPAS: warning, not enough variables to set in Intervals." << std::endl;
219 void transformLeft();
225 void transformRight();
245 friend std::ostream& operator<< (std::ostream &out,
Intervals& a);
256 tmp.right = a->right;
260 b->right = tmp.right;
Intervals root(int k)
Get a root of variates.
Definition: interval.h:180
int numberOfVariables()
Get number of variables.
Definition: interval.h:109
void setVariableNames(const std::vector< Symbol > &xs)
Set variable names.
Definition: interval.h:191
int numberOfIntervals()
Get the number of roots.
Definition: interval.h:118
Intervals(const Intervals &b)
Copy construct.
Definition: interval.h:76
Intervals(int v)
Construct intervals with number of variates.
Definition: interval.h:61
Data Structure for interval [a, b].
Definition: interval.h:11
Intervals()
Construct intervals.
Definition: interval.h:51
void clear()
Clear all the intervals.
Definition: interval.h:162
void pushInterval(lfixq l, lfixq r)
Push an interval to the end of the list.
Definition: interval.h:136
void pushInterval(Interval pI)
Push an interval to the end of the list.
Definition: interval.h:127
An encapsulation of a mathematical symbol.
Definition: Symbol.hpp:23
void popInterval()
Pop the last interval.
Definition: interval.h:153
Interval * interval(int k, int l=0)
Get a root of a variate.
Definition: interval.h:172
Interval lists for real roots of multivariate polynomials.
Definition: interval.h:35
~Intervals()
Destroy intervals.
Definition: interval.h:85