Basic Polynomial Algebra Subprograms (BPAS)
v. 1.791
|
A univariate polynomial with Integer coefficients using a dense representation. More...
#include <uzpolynomial.h>
Public Member Functions | |
DenseUnivariateIntegerPolynomial () | |
Construct a polynomial. More... | |
DenseUnivariateIntegerPolynomial (int s) | |
Construct a polynomial with degree. More... | |
DenseUnivariateIntegerPolynomial (const Integer &e) | |
Construct a polynomial with a coeffient. More... | |
DenseUnivariateIntegerPolynomial (const RationalNumber &e) | |
DenseUnivariateIntegerPolynomial (const DenseUnivariateIntegerPolynomial &b) | |
Copy constructor. More... | |
~DenseUnivariateIntegerPolynomial () | |
Destroy the polynomial. More... | |
Integer | degree () const |
Get degree of the polynomial. More... | |
Integer | leadingCoefficient () const |
Get the leading coefficient. More... | |
Integer | trailingCoefficient () const |
Integer | numberOfTerms () const |
mpz_class * | coefficients (int k=0) const |
Get coefficients of the polynomial, given start offset. More... | |
Integer | coefficient (int k) const |
Get a coefficient of the polynomial. More... | |
void | setCoefficient (int k, const mpz_class value) |
Set a coefficient of the polynomial. More... | |
void | setCoefficient (int k, const Integer &value) |
Set the coefficient of the monomial with degree d to be the Ring element r. More... | |
void | setCoefficient (int k, const int value) |
void | setCoefficient (Integer k, const Integer &value) |
Set a coefficient of the polynomial. More... | |
Symbol | variable () const |
Get variable's name. More... | |
void | setVariableName (const Symbol &x) |
Set variable's name. More... | |
DenseUnivariateIntegerPolynomial & | operator= (const DenseUnivariateIntegerPolynomial &b) |
Overload operator =. More... | |
DenseUnivariateIntegerPolynomial & | operator= (const Integer &i) |
bool | operator!= (const DenseUnivariateIntegerPolynomial &b) const |
Overload operator !=. More... | |
bool | operator== (const DenseUnivariateIntegerPolynomial &b) const |
Overload operator ==. More... | |
bool | isZero () const |
Is zero polynomial. More... | |
void | zero () |
Zero polynomial. More... | |
bool | isOne () const |
Is polynomial a constatn 1. More... | |
void | one () |
Set polynomial to 1. More... | |
bool | isNegativeOne () const |
Is polynomial a constatn -1. More... | |
void | negativeOne () |
Set polynomial to -1. More... | |
int | isConstant () const |
Is a constant. More... | |
DenseUnivariateIntegerPolynomial | unitCanonical (DenseUnivariateIntegerPolynomial *u=NULL, DenseUnivariateIntegerPolynomial *v=NULL) const |
Obtain the unit normal (a.k.a canonical associate) of an element. More... | |
Integer | content () const |
Content of the polynomial. More... | |
DenseUnivariateIntegerPolynomial | primitivePart () const |
bool | isConstantTermZero () const |
Is the least signficant coefficient zero. More... | |
DenseUnivariateIntegerPolynomial | operator^ (long long int e) const |
Overload operator ^ replace xor operation by exponentiation. More... | |
DenseUnivariateIntegerPolynomial & | operator^= (long long int e) |
Overload operator ^= replace xor operation by exponentiation. More... | |
DenseUnivariateIntegerPolynomial | operator<< (int k) const |
Overload operator << replace by muplitying x^k. More... | |
DenseUnivariateIntegerPolynomial & | operator<<= (int k) |
Overload operator << replace by muplitying x^k. More... | |
DenseUnivariateIntegerPolynomial | operator>> (int k) const |
Overload operator >> replace by dividing x^k, and return the quotient. More... | |
DenseUnivariateIntegerPolynomial & | operator>>= (int k) |
Overload operator >>= replace by dividing x^k, and return the quotient. More... | |
DenseUnivariateIntegerPolynomial | operator+ (const DenseUnivariateIntegerPolynomial &b) const |
Overload operator +. More... | |
DenseUnivariateIntegerPolynomial & | operator+= (const DenseUnivariateIntegerPolynomial &b) |
Overload Operator +=. More... | |
void | add (const DenseUnivariateIntegerPolynomial &b) |
Add another polynomial to itself. More... | |
DenseUnivariateIntegerPolynomial | operator+ (const Integer &c) const |
Overload Operator +. More... | |
DenseUnivariateIntegerPolynomial | operator+ (const mpz_class &c) const |
DenseUnivariateIntegerPolynomial | operator+ (int c) const |
DenseUnivariateIntegerPolynomial & | operator+= (const Integer &c) |
Overload Operator +=. More... | |
DenseUnivariateIntegerPolynomial & | operator+= (const mpz_class &c) |
DenseUnivariateIntegerPolynomial & | operator+= (int c) |
DenseUnivariateIntegerPolynomial | operator- (const DenseUnivariateIntegerPolynomial &b) const |
Subtract another polynomial. More... | |
DenseUnivariateIntegerPolynomial & | operator-= (const DenseUnivariateIntegerPolynomial &b) |
Overload operator -=. More... | |
DenseUnivariateIntegerPolynomial | operator- () const |
Overload operator -, negate. More... | |
void | negate () |
Compute -f(x) More... | |
void | subtract (const DenseUnivariateIntegerPolynomial &b) |
Subtract another polynomial from itself. More... | |
DenseUnivariateIntegerPolynomial | operator- (const Integer &c) const |
Overload operator -. More... | |
DenseUnivariateIntegerPolynomial | operator- (const mpz_class &c) const |
DenseUnivariateIntegerPolynomial | operator- (int c) const |
DenseUnivariateIntegerPolynomial & | operator-= (const Integer &c) |
Overload operator -=. More... | |
DenseUnivariateIntegerPolynomial & | operator-= (const mpz_class &c) |
DenseUnivariateIntegerPolynomial & | operator-= (int c) |
DenseUnivariateIntegerPolynomial | operator* (const DenseUnivariateIntegerPolynomial &b) const |
Multiply to another polynomial. More... | |
DenseUnivariateIntegerPolynomial & | operator*= (const DenseUnivariateIntegerPolynomial &b) |
Overload operator *=. More... | |
DenseUnivariateIntegerPolynomial | operator* (const Integer &e) const |
Overload operator *. More... | |
DenseUnivariateIntegerPolynomial | operator* (const mpz_class &e) const |
DenseUnivariateIntegerPolynomial | operator* (int e) const |
DenseUnivariateIntegerPolynomial & | operator*= (const Integer &e) |
Overload operator *=. More... | |
DenseUnivariateIntegerPolynomial & | operator*= (const mpz_class &e) |
DenseUnivariateIntegerPolynomial & | operator*= (int e) |
Overload operator *=. More... | |
DenseUnivariateIntegerPolynomial | operator/ (const DenseUnivariateIntegerPolynomial &b) const |
Overload operator / ExactDivision. More... | |
DenseUnivariateIntegerPolynomial & | operator/= (const DenseUnivariateIntegerPolynomial &b) |
Overload operator /= ExactDivision. More... | |
DenseUnivariateIntegerPolynomial | operator/ (const Integer &e) const |
Overload operator /. More... | |
DenseUnivariateIntegerPolynomial | operator/ (const mpz_class &e) const |
DenseUnivariateIntegerPolynomial | operator/ (int e) const |
DenseUnivariateIntegerPolynomial & | operator/= (const Integer &e) |
Overload operator /=. More... | |
DenseUnivariateIntegerPolynomial & | operator/= (const mpz_class &e) |
DenseUnivariateIntegerPolynomial & | operator/= (int e) |
DenseUnivariateIntegerPolynomial | monicDivide (const DenseUnivariateIntegerPolynomial &b) |
Monic division Return quotient and itself become the remainder. More... | |
DenseUnivariateIntegerPolynomial | monicDivide (const DenseUnivariateIntegerPolynomial &b, DenseUnivariateIntegerPolynomial *rem) const |
Monic division Return quotient. More... | |
DenseUnivariateIntegerPolynomial | lazyPseudoDivide (const DenseUnivariateIntegerPolynomial &b, Integer *c, Integer *d=NULL) |
Lazy pseudo dividsion Return the quotient and itself becomes remainder e is the exact number of division steps. More... | |
DenseUnivariateIntegerPolynomial | lazyPseudoDivide (const DenseUnivariateIntegerPolynomial &b, DenseUnivariateIntegerPolynomial *rem, Integer *c, Integer *d) const |
Lazy pseudo dividsion Return the quotient e is the exact number of division steps. More... | |
DenseUnivariateIntegerPolynomial | pseudoDivide (const DenseUnivariateIntegerPolynomial &b, Integer *d=NULL) |
Pseudo dividsion Return the quotient and itself becomes remainder. More... | |
DenseUnivariateIntegerPolynomial | pseudoDivide (const DenseUnivariateIntegerPolynomial &b, DenseUnivariateIntegerPolynomial *rem, Integer *d) const |
Pseudo dividsion Return the quotient. More... | |
DenseUnivariateIntegerPolynomial | gcd (const DenseUnivariateIntegerPolynomial &q, int type) const |
GCD(p, q) More... | |
DenseUnivariateIntegerPolynomial | gcd (const DenseUnivariateIntegerPolynomial &q) const |
void | differentiate (int k) |
Convert current object to its k-th derivative. More... | |
void | differentiate () |
Convert current object to its derivative. More... | |
DenseUnivariateIntegerPolynomial | derivative (int k) const |
Return k-th derivative. More... | |
DenseUnivariateIntegerPolynomial | derivative () const |
Compute derivative. More... | |
void | integrate () |
Convert current object to its integral with constant of integration 0. More... | |
DenseUnivariateIntegerPolynomial | integral () |
Compute integral with constant of integration 0. More... | |
Integer | evaluate (const Integer &x) const |
/** Evaluate f(x) More... | |
Factors< DenseUnivariateIntegerPolynomial > | squareFree () const |
Square free. More... | |
void | print (std::ostream &out) const |
Overload stream operator <<. More... | |
ExpressionTree | convertToExpressionTree () const |
Convert this DUZP into an expression tree. | |
Static Public Attributes | |
static mpz_class | characteristic |
Friends | |
DenseUnivariateIntegerPolynomial | operator+ (const mpz_class &c, const DenseUnivariateIntegerPolynomial &p) |
DenseUnivariateIntegerPolynomial | operator+ (int c, const DenseUnivariateIntegerPolynomial &p) |
DenseUnivariateIntegerPolynomial | operator- (const mpz_class &c, const DenseUnivariateIntegerPolynomial &p) |
DenseUnivariateIntegerPolynomial | operator- (int c, const DenseUnivariateIntegerPolynomial &p) |
DenseUnivariateIntegerPolynomial | operator* (const mpz_class &e, const DenseUnivariateIntegerPolynomial &p) |
DenseUnivariateIntegerPolynomial | operator* (int e, const DenseUnivariateIntegerPolynomial &p) |
DenseUnivariateIntegerPolynomial | operator/ (const mpz_class &e, const DenseUnivariateIntegerPolynomial &p) |
A univariate polynomial with Integer coefficients using a dense representation.
This representation stores all possible coefficients, up to a maximum degree, even if they are zero.
|
inline |
Construct a polynomial.
d |
|
inline |
Construct a polynomial with degree.
d | Size of the polynomial |
|
inline |
Construct a polynomial with a coeffient.
e | The coefficient |
|
inline |
Copy constructor.
b | A densed univariate rationl polynomial |
|
inline |
Destroy the polynomial.
void DenseUnivariateIntegerPolynomial::add | ( | const DenseUnivariateIntegerPolynomial & | b | ) |
Add another polynomial to itself.
b | A univariate integer polynomial |
|
inlinevirtual |
Get a coefficient of the polynomial.
k | Offset |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inline |
Get coefficients of the polynomial, given start offset.
k | Offset |
|
inline |
Content of the polynomial.
|
inline |
Get degree of the polynomial.
|
inlinevirtual |
Return k-th derivative.
k | Order of the k-th derivative, k > 0 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inlinevirtual |
Compute derivative.
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
virtual |
Convert current object to its k-th derivative.
k | Order of the derivative, k > 0 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inlinevirtual |
Convert current object to its derivative.
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
/** Evaluate f(x)
x | Evaluation point Evaluate f(x) |
x | Evaluation point |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::gcd | ( | const DenseUnivariateIntegerPolynomial & | q, |
int | type | ||
) | const |
GCD(p, q)
q | The other polynomial |
|
inline |
Compute integral with constant of integration 0.
void DenseUnivariateIntegerPolynomial::integrate | ( | ) |
Convert current object to its integral with constant of integration 0.
|
inline |
Is a constant.
|
inline |
Is the least signficant coefficient zero.
|
inline |
Is polynomial a constatn -1.
|
inline |
Is polynomial a constatn 1.
|
inline |
Is zero polynomial.
|
virtual |
Lazy pseudo dividsion Return the quotient and itself becomes remainder e is the exact number of division steps.
b | The dividend polynomial |
c | The leading coefficient of b to the power e |
d | That to the power deg(a) - deg(b) + 1 - e |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inlinevirtual |
Lazy pseudo dividsion Return the quotient e is the exact number of division steps.
b | The divident polynomial |
rem | The remainder polynomial |
c | The leading coefficient of b to the power e |
d | That to the power deg(a) - deg(b) + 1 - e |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inline |
Get the leading coefficient.
|
virtual |
Monic division Return quotient and itself become the remainder.
b | The dividend polynomial |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inlinevirtual |
Monic division Return quotient.
b | The dividend polynomial |
rem | The remainder polynomial |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inline |
Compute -f(x)
|
inline |
Set polynomial to -1.
|
inline |
Set polynomial to 1.
|
inline |
Overload operator !=.
b | A univariate integer polynoial |
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator* | ( | const DenseUnivariateIntegerPolynomial & | b | ) | const |
Multiply to another polynomial.
b | A univariate integer polynomial |
|
inline |
Overload operator *.
e | An integer |
|
inline |
Overload operator *=.
b | A univariate integer polynomial |
|
inline |
Overload operator *=.
e | An integer |
|
inline |
Overload operator *=.
e | A constant |
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator+ | ( | const DenseUnivariateIntegerPolynomial & | b | ) | const |
Overload operator +.
b | A univariate integer polynomial |
|
inline |
Overload Operator +.
c | An integer |
|
inline |
Overload Operator +=.
b | A univariate integer polynomial |
|
inline |
Overload Operator +=.
c | An integer |
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator- | ( | const DenseUnivariateIntegerPolynomial & | b | ) | const |
Subtract another polynomial.
b | A univariate integer polynomial |
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator- | ( | ) | const |
Overload operator -, negate.
|
inline |
Overload operator -.
c | An integer |
|
inline |
Overload operator -=.
b | A univariate integer polynomial |
|
inline |
Overload operator -=.
c | An integer |
|
inline |
Overload operator / ExactDivision.
b | A univariate integer polynomial |
|
inline |
Overload operator /.
e | An integer |
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator/= | ( | const DenseUnivariateIntegerPolynomial & | b | ) |
Overload operator /= ExactDivision.
b | A univariate integer polynomial |
|
inline |
Overload operator /=.
e | An integer |
|
virtual |
Overload operator << replace by muplitying x^k.
k | The exponent of variable, k > 0 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inlinevirtual |
Overload operator << replace by muplitying x^k.
k | The exponent of variable, k > 0 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inline |
Overload operator =.
b | A univariate integer polynoial |
|
inline |
Overload operator ==.
b | A univariate integer polynoial |
|
virtual |
Overload operator >> replace by dividing x^k, and return the quotient.
k | The exponent of variable, k > 0 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inlinevirtual |
Overload operator >>= replace by dividing x^k, and return the quotient.
k | The exponent of variable, k > 0 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator^ | ( | long long int | e | ) | const |
Overload operator ^ replace xor operation by exponentiation.
e | The exponentiation, e > 0 |
|
inline |
Overload operator ^= replace xor operation by exponentiation.
e | The exponentiation, e > 0 |
void DenseUnivariateIntegerPolynomial::print | ( | std::ostream & | out | ) | const |
Overload stream operator <<.
out | Stream object |
b | A univariate Integer polynoial |
|
virtual |
Pseudo dividsion Return the quotient and itself becomes remainder.
b | The divident polynomial |
d | The leading coefficient of b to the power deg(a) - deg(b) + 1 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
virtual |
Pseudo dividsion Return the quotient.
b | The divident polynomial |
rem | The remainder polynomial |
d | The leading coefficient of b to the power deg(a) - deg(b) + 1 |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inline |
Set a coefficient of the polynomial.
k | Offset |
val | Coefficient |
|
inlinevirtual |
Set the coefficient of the monomial with degree d to be the Ring element r.
d | the degree of the monomial. |
r | the ring element |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
Set a coefficient of the polynomial.
k | Degree of the term of which you are setting the coefficient |
val | Coefficient value |
|
inlinevirtual |
Set variable's name.
x | Varable's name |
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
Factors<DenseUnivariateIntegerPolynomial> DenseUnivariateIntegerPolynomial::squareFree | ( | ) | const |
Square free.
void DenseUnivariateIntegerPolynomial::subtract | ( | const DenseUnivariateIntegerPolynomial & | b | ) |
Subtract another polynomial from itself.
b | A univariate integer polynomial |
|
inline |
Obtain the unit normal (a.k.a canonical associate) of an element.
If either parameters u, v, are non-NULL then the units are returned such that b = ua, v = u^-1. Where b is the unit normal of a, and is the returned value.
|
inlinevirtual |
Get variable's name.
Implements BPASUnivariatePolynomial< Integer, DenseUnivariateIntegerPolynomial >.
|
inline |
Zero polynomial.