25 namespace polynomials {
85 const C
coef (
Degree i)
const {
return i>=d_data.size() ? C(0) : d_data[i]; }
99 typename std::vector<C>::const_iterator
begin()
const 100 {
return d_data.begin();}
101 typename std::vector<C>::const_iterator
end()
const {
return d_data.end();}
143 std::ostream&
print(std::ostream& strm,
const char* x)
const;
156 template <
typename C>
168 void safeQuotient(
Degree d = 0);
Safe_Poly()
Definition: polynomials.h:161
bool operator!=(const Polynomial &q) const
Definition: polynomials.h:88
Polynomials with coefficients in |C|.
Definition: Atlas.h:121
void adjustSize()
Adjusts the size of d_data so that it corresponds to the degree + 1.
Definition: polynomials_def.h:104
Polynomial & operator+=(const Polynomial &q)
Definition: polynomials_def.h:112
Polynomial operator+(const Polynomial &q) const
Definition: polynomials.h:128
Polynomial()
Definition: polynomials.h:71
uA p
Definition: lists.cpp:26
C up_remainder(C c, Degree d) const
Definition: polynomials_def.h:207
bool operator<(const Polynomial &q) const
Operator < is the default from the standard library < on vector.
Definition: polynomials.h:97
bool operator==(const Polynomial &q) const
Definition: polynomials.h:87
Degree degree() const
Definition: polynomials.h:103
Polynomial & subtract_from(const Polynomial &p)
Definition: polynomials_def.h:146
void safeProd(C &, C)
a *= b.
Definition: polynomials_def.h:352
std::vector< C >::const_iterator end() const
Definition: polynomials.h:101
std::vector< C >::const_iterator begin() const
Definition: polynomials.h:99
void safeAdd(C &, C)
a += b.
Definition: polynomials_def.h:323
const Degree MinusOne
Definition: polynomials.h:30
void resize(Degree d)
Definition: polynomials.h:146
Polynomial & operator/=(C)
Definition: polynomials_def.h:173
std::vector< C > d_data
Definition: polynomials.h:66
Polynomial< C > base
Definition: polynomials.h:159
Polynomial & operator-=(const Polynomial &q)
Definition: polynomials_def.h:130
void safeDivide(C &, C)
a /= b.
Definition: polynomials_def.h:338
const C coef(Degree i) const
Definition: polynomials.h:85
Forward class declarations for Polynomial and LaurentPolynomial.
bool compare(const Polynomial< C > &, const Polynomial< C > &)
Polynomial comparison: whether p < q.
Definition: polynomials_def.h:252
Safe_Poly(Degree d, C c)
Definition: polynomials.h:162
std::ostream & print(std::ostream &strm, const char *x) const
Definition: polynomials_def.h:296
void swap(Polynomial &other)
Definition: polynomials.h:81
const C & operator[](Degree i) const
Definition: polynomials_def.h:83
size_t Degree
Definition: Atlas.h:122
Polynomial & operator*=(C)
Definition: polynomials_def.h:163
Degree size() const
Definition: polynomials.h:104
Polynomial operator-() const
Definition: polynomials.h:138
void safeSubtract(C &, C)
a -= b.
Definition: polynomials_def.h:371
Polynomial operator*(C c) const
Definition: polynomials.h:123
bool multi_term() const
Definition: polynomials_def.h:235
bool isZero() const
Definition: polynomials.h:106
C factor_by(C c, Degree d)
Definition: polynomials_def.h:219
Polynomial(const Polynomial< U > &src)
Definition: polynomials.h:79