Basic Polynomial Algebra Subprograms (BPAS)  v. 1.791
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
DenseUnivariatePolynomial< Field > Class Template Reference

A univariate polynomial with arbitrary BPASField coefficients represented densely. More...

#include <dupolynomial.h>

Simplified semantic inheritance diagram for DenseUnivariatePolynomial< Field >:
- Full inheritance diagram for DenseUnivariatePolynomial< Field >:
[legend]

Public Member Functions

 DenseUnivariatePolynomial ()
 Construct a polynomial. More...
 
 DenseUnivariatePolynomial (int s)
 Construct a polynomial with degree. More...
 
 DenseUnivariatePolynomial (Field e)
 
 DenseUnivariatePolynomial (const DenseUnivariatePolynomial< Field > &b)
 Copy constructor. More...
 
 ~DenseUnivariatePolynomial ()
 Destroy the polynomial. More...
 
Integer degree () const
 Get degree of the polynomial. More...
 
Field leadingCoefficient () const
 Get the leading coefficient. More...
 
Field trailingCoefficient () const
 
Integer numberOfTerms () const
 
Field * coefficients (int k=0)
 Get coefficients of the polynomial, given start offset. More...
 
Field coefficient (int k) const
 Get a coefficient of the polynomial. More...
 
void setCoefficient (int k, const Field &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...
 
DenseUnivariatePolynomial< Field > & operator= (const DenseUnivariatePolynomial< Field > &b)
 Overload operator =. More...
 
DenseUnivariatePolynomial< Field > & operator= (const Field &f)
 
bool operator!= (const DenseUnivariatePolynomial< Field > &b) const
 Overload operator !=. More...
 
bool operator== (const DenseUnivariatePolynomial< Field > &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...
 
DenseUnivariatePolynomial< Field > unitCanonical (DenseUnivariatePolynomial< Field > *u, DenseUnivariatePolynomial< Field > *v) const
 Obtain the unit normal (a.k.a canonical associate) of an element. More...
 
Field content () const
 Content of the polynomial. More...
 
DenseUnivariatePolynomial< Field > primitivePart () const
 
DenseUnivariatePolynomial< Field > operator^ (long long int e) const
 Overload operator ^ replace xor operation by exponentiation. More...
 
DenseUnivariatePolynomial< Field > & operator^= (long long int e)
 Overload operator ^= replace xor operation by exponentiation. More...
 
DenseUnivariatePolynomial< Field > operator<< (int k) const
 Overload operator << replace by muplitying x^k. More...
 
DenseUnivariatePolynomial< Field > & operator<<= (int k)
 Overload operator <<= replace by muplitying x^k. More...
 
DenseUnivariatePolynomial< Field > operator>> (int k) const
 Overload operator >> replace by dividing x^k, and return the quotient. More...
 
DenseUnivariatePolynomial< Field > & operator>>= (int k)
 Overload operator >>= replace by dividing x^k, and return the quotient. More...
 
DenseUnivariatePolynomial< Field > operator+ (const DenseUnivariatePolynomial< Field > &b) const
 Overload operator +. More...
 
DenseUnivariatePolynomial< Field > & operator+= (const DenseUnivariatePolynomial< Field > &b)
 Overload Operator +=. More...
 
void add (const DenseUnivariatePolynomial< Field > &b)
 Add another polynomial to itself. More...
 
DenseUnivariatePolynomial< Field > operator+ (const Field &c) const
 Overload Operator +. More...
 
DenseUnivariatePolynomial< Field > & operator+= (const Field &c)
 Overload Operator +=. More...
 
DenseUnivariatePolynomial< Field > operator- (const DenseUnivariatePolynomial< Field > &b) const
 Subtract another polynomial. More...
 
DenseUnivariatePolynomial< Field > & operator-= (const DenseUnivariatePolynomial< Field > &b)
 Overload operator -=. More...
 
DenseUnivariatePolynomial< Field > operator- () const
 Overload operator -, negate. More...
 
void subtract (const DenseUnivariatePolynomial< Field > &b)
 Subtract another polynomial from itself. More...
 
DenseUnivariatePolynomial< Field > operator- (const Field &c) const
 Overload operator -. More...
 
DenseUnivariatePolynomial< Field > & operator-= (const Field &c)
 Overload operator -=. More...
 
bool SRGFNcmp (mpz_class &p)
 Helper function to compare a given prime number with manually computed Generalized Fermat Numbers. More...
 
DenseUnivariatePolynomial< Field > operator* (const DenseUnivariatePolynomial< Field > &b) const
 Multiply to another polynomial. More...
 
void FFT (SmallPrimeField *field, int K, int e, SmallPrimeField &omega)
 
void FFT (BigPrimeField *field, int K, int e, BigPrimeField &omega)
 
void FFT (GeneralizedFermatPrimeField *field, int K, int e, GeneralizedFermatPrimeField &omega)
 
void IFFT (SmallPrimeField *field, int K, int e, SmallPrimeField &omega)
 
void IFFT (BigPrimeField *field, int K, int e, BigPrimeField &omega)
 
void IFFT (GeneralizedFermatPrimeField *field, int K, int e, GeneralizedFermatPrimeField &omega)
 
DenseUnivariatePolynomial< Field > & operator*= (const DenseUnivariatePolynomial< Field > &b)
 Overload operator *=. More...
 
DenseUnivariatePolynomial< Field > operator* (const Field &e) const
 Overload operator *. More...
 
DenseUnivariatePolynomial< Field > & operator*= (const Field &e)
 Overload operator *=. More...
 
DenseUnivariatePolynomial< Field > operator/ (const DenseUnivariatePolynomial< Field > &b) const
 Overload operator / ExactDivision. More...
 
DenseUnivariatePolynomial< Field > & operator/= (const DenseUnivariatePolynomial< Field > &b)
 Overload operator /= ExactDivision. More...
 
DenseUnivariatePolynomial< Field > operator/ (const Field &e) const
 Overload operator /. More...
 
DenseUnivariatePolynomial< Field > & operator/= (const Field &e)
 Overload operator /=. More...
 
DenseUnivariatePolynomial< Field > monicDivide (const DenseUnivariatePolynomial< Field > &b)
 Monic division Return quotient and itself become the remainder. More...
 
DenseUnivariatePolynomial< Field > monicDivide (const DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > *rem) const
 Monic division Return quotient. More...
 
DenseUnivariatePolynomial< Field > lazyPseudoDivide (const DenseUnivariatePolynomial< Field > &b, Field *c, Field *d)
 Lazy pseudo dividsion Return the quotient and itself becomes remainder e is the exact number of division steps. More...
 
DenseUnivariatePolynomial< Field > lazyPseudoDivide (const DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > *rem, Field *c, Field *d) const
 Lazy pseudo dividsion Return the quotient e is the exact number of division steps. More...
 
DenseUnivariatePolynomial< Field > pseudoDivide (const DenseUnivariatePolynomial< Field > &b, Field *d=NULL)
 Pseudo dividsion Return the quotient and itself becomes remainder. More...
 
DenseUnivariatePolynomial< Field > pseudoDivide (const DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > *rem, Field *d) const
 Pseudo dividsion Return the quotient. More...
 
DenseUnivariatePolynomial< Field > halfExtendedEuclidean (const DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > *g)
 s * a g (mod b), where g = gcd(a, b) More...
 
void diophantinEquationSolve (const DenseUnivariatePolynomial< Field > &a, const DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > *s, DenseUnivariatePolynomial< Field > *t)
 s*a + t*b = c, where c in the ideal (a,b) More...
 
void differentiate (int k)
 Compute k-th differentiate. More...
 
void differentiate ()
 Differentiate this polynomial, setting itself to its derivative.
 
DenseUnivariatePolynomial< Field > derivative (int k) const
 Obtain the kth derivative of this polynomial. More...
 
DenseUnivariatePolynomial< Field > derivative () const
 Obtain the derivative of this polynomial. More...
 
DenseUnivariatePolynomial< Field > integrate () const
 Compute the integral with constant of integration 0. More...
 
Field evaluate (const Field &x) const
 Evaluate f(x) More...
 
bool isConstantTermZero () const
 Is the least signficant coefficient zero. More...
 
DenseUnivariatePolynomial< Field > gcd (const DenseUnivariatePolynomial< Field > &q, int type) const
 GCD(p, q) More...
 
DenseUnivariatePolynomial< Field > gcd (const DenseUnivariatePolynomial< Field > &q) const
 Get GCD of *this and other. More...
 
Factors< DenseUnivariatePolynomial< Field > > squareFree () const
 Square free. More...
 
bool divideByVariableIfCan ()
 Divide by variable if it is zero. More...
 
void reciprocal ()
 Number of coefficient sign variation. More...
 
void homothetic (int k)
 Homothetic operation. More...
 
void scaleTransform (int k)
 Scale transform operation. More...
 
void negativeVariable ()
 Compute f(-x) More...
 
void negate ()
 Compute -f(x) More...
 
void print (std::ostream &out) const
 Overload stream operator <<. More...
 
ExpressionTree convertToExpressionTree () const
 Convert this to an expression tree. More...
 
Integer euclideanSize () const
 Euclidean domain methods.
 
DenseUnivariatePolynomial< Field > euclideanDivision (const DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > *q=NULL) const
 Perform the eucldiean division of *this and b. More...
 
DenseUnivariatePolynomial< Field > extendedEuclidean (const DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > *s=NULL, DenseUnivariatePolynomial< Field > *t=NULL) const
 Perform the extended euclidean division on *this and b. More...
 
DenseUnivariatePolynomial< Field > quotient (const DenseUnivariatePolynomial< Field > &b) const
 Get the quotient of *this and b. More...
 
DenseUnivariatePolynomial< Field > remainder (const DenseUnivariatePolynomial< Field > &b) const
 Get the remainder of *this and b. More...
 
DenseUnivariatePolynomial< Field > operator% (const DenseUnivariatePolynomial< Field > &b) const
 Get the remainder of *this and b;. More...
 
DenseUnivariatePolynomial< Field > & operator%= (const DenseUnivariatePolynomial< Field > &b)
 Assign *this to be the remainder of *this and b. More...
 
DenseUnivariatePolynomial< Field > Reverse () const
 Reverse a polynomial (based on Modern Computer Algebra , Newton Iteration Chapter 9) More...
 
DenseUnivariatePolynomial< Field > NewtonIterationInversion (int l)
 Does Newton Iteration to compute the Reverse Inverse of a polynomial (based on Modern Computer Algebra , Newton Iteration Chapter 9) More...
 
void NewtonDivisionQuotient (DenseUnivariatePolynomial< Field > &b, DenseUnivariatePolynomial< Field > &q, DenseUnivariatePolynomial< Field > &r, int l)
 Fast Division (based on Modern Computer Algebra , Newton Iteration Chapter 9) More...
 

Public Attributes

mpz_class characteristic
 

Static Public Attributes

static mpz_class p1
 
static mpz_class p2
 
static mpz_class p3
 
static mpz_class p4
 
static mpz_class p5
 
static mpz_class p6
 
static mpz_class p7
 

Friends

DenseUnivariatePolynomial< Field > operator+ (Field c, DenseUnivariatePolynomial< Field > p)
 
DenseUnivariatePolynomial< Field > operator- (const Field &c, const DenseUnivariatePolynomial< Field > &p)
 
DenseUnivariatePolynomial< Field > operator* (const Field &c, const DenseUnivariatePolynomial< Field > &p)
 
DenseUnivariatePolynomial< Field > operator/ (const Field &c, const DenseUnivariatePolynomial< Field > &p)
 

Detailed Description

template<class Field>
class DenseUnivariatePolynomial< Field >

A univariate polynomial with arbitrary BPASField coefficients represented densely.

This class is templated by a Field which should be a BPASField.

Constructor & Destructor Documentation

◆ DenseUnivariatePolynomial() [1/3]

template<class Field>
DenseUnivariatePolynomial< Field >::DenseUnivariatePolynomial ( )
inline

Construct a polynomial.

Parameters
d

◆ DenseUnivariatePolynomial() [2/3]

template<class Field>
DenseUnivariatePolynomial< Field >::DenseUnivariatePolynomial ( int  s)
inline

Construct a polynomial with degree.

Parameters
dSize of the polynomial

◆ DenseUnivariatePolynomial() [3/3]

template<class Field>
DenseUnivariatePolynomial< Field >::DenseUnivariatePolynomial ( const DenseUnivariatePolynomial< Field > &  b)
inline

Copy constructor.

Parameters
bA dense univariate rational polynomial

◆ ~DenseUnivariatePolynomial()

template<class Field>
DenseUnivariatePolynomial< Field >::~DenseUnivariatePolynomial ( )
inline

Destroy the polynomial.

Parameters

Member Function Documentation

◆ add()

template<class Field>
void DenseUnivariatePolynomial< Field >::add ( const DenseUnivariatePolynomial< Field > &  b)
inline

Add another polynomial to itself.

Parameters
bA univariate rational polynomial

◆ coefficient()

template<class Field>
Field DenseUnivariatePolynomial< Field >::coefficient ( int  k) const
inlinevirtual

Get a coefficient of the polynomial.

Parameters
kOffset

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ coefficients()

template<class Field>
Field* DenseUnivariatePolynomial< Field >::coefficients ( int  k = 0)
inline

Get coefficients of the polynomial, given start offset.

Parameters
kOffset

◆ content()

template<class Field>
Field DenseUnivariatePolynomial< Field >::content ( ) const
inline

Content of the polynomial.

Parameters

◆ convertToExpressionTree()

template<class Field>
ExpressionTree DenseUnivariatePolynomial< Field >::convertToExpressionTree ( ) const
inlinevirtual

Convert this to an expression tree.

returns an expression tree describing *this.

Implements ExpressionTreeConvert.

◆ degree()

template<class Field>
Integer DenseUnivariatePolynomial< Field >::degree ( ) const
inline

Get degree of the polynomial.

Parameters

◆ derivative() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::derivative ( int  ) const
inlinevirtual

Obtain the kth derivative of this polynomial.

Parameters
kthe number of times to differentiate.
Returns
the kth derivative.

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ derivative() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::derivative ( ) const
inlinevirtual

Obtain the derivative of this polynomial.

Returns
the derivative.

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ differentiate()

template<class Field>
void DenseUnivariatePolynomial< Field >::differentiate ( int  k)
inlinevirtual

Compute k-th differentiate.

Parameters
kk-th differentiate, k > 0

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ diophantinEquationSolve()

template<class Field>
void DenseUnivariatePolynomial< Field >::diophantinEquationSolve ( const DenseUnivariatePolynomial< Field > &  a,
const DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > *  s,
DenseUnivariatePolynomial< Field > *  t 
)
inline

s*a + t*b = c, where c in the ideal (a,b)

Parameters
aA univariate polynomial b: A univariate polynomial
sEither s = 0 or degree(s) < degree(b)
t

◆ divideByVariableIfCan()

template<class Field>
bool DenseUnivariatePolynomial< Field >::divideByVariableIfCan ( )
inline

Divide by variable if it is zero.

Parameters

◆ euclideanDivision()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::euclideanDivision ( const DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > *  q = NULL 
) const
inlinevirtual

Perform the eucldiean division of *this and b.

Returns the remainder. If q is not NULL, then returns the quotient in q.

Parameters
bthe divisor.
[out]qa pointer to store the quotient in.
Returns
the remainder.

Implements BPASEuclideanDomain< DenseUnivariatePolynomial< Field > >.

◆ evaluate()

template<class Field>
Field DenseUnivariatePolynomial< Field >::evaluate ( const Field &  x) const
inlinevirtual

Evaluate f(x)

Parameters
xEvaluation point

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ extendedEuclidean()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::extendedEuclidean ( const DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > *  s = NULL,
DenseUnivariatePolynomial< Field > *  t = NULL 
) const
inlinevirtual

Perform the extended euclidean division on *this and b.

Returns the GCD. If s and t are not NULL, returns the bezout coefficients in them.

Parameters
bthe divisor.
[out]sthe bezout coefficient of this.
[out]tthe bezout coefficient of b.
Returns
the remainder.

Implements BPASEuclideanDomain< DenseUnivariatePolynomial< Field > >.

◆ gcd() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::gcd ( const DenseUnivariatePolynomial< Field > &  q,
int  type 
) const
inline

GCD(p, q)

Parameters
qThe other polynomial

◆ gcd() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::gcd ( const DenseUnivariatePolynomial< Field > &  other) const
inlinevirtual

Get GCD of *this and other.

Parameters
otherthe other element to get a gcd with.
Returns
the gcd.

Implements BPASGCDDomain< DenseUnivariatePolynomial< Field > >.

◆ halfExtendedEuclidean()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::halfExtendedEuclidean ( const DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > *  g 
)
inline

s * a g (mod b), where g = gcd(a, b)

Parameters
bA univariate polynomial
gThe GCD of a and b

◆ homothetic()

template<class Field>
void DenseUnivariatePolynomial< Field >::homothetic ( int  k)
inline

Homothetic operation.

Parameters
k> 0: 2^(k*d) * f(2^(-k)*x);

◆ integrate()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::integrate ( ) const
inline

Compute the integral with constant of integration 0.

Parameters

◆ isConstant()

template<class Field>
int DenseUnivariatePolynomial< Field >::isConstant ( ) const
inline

Is a constant.

Parameters

◆ isConstantTermZero()

template<class Field>
bool DenseUnivariatePolynomial< Field >::isConstantTermZero ( ) const
inline

Is the least signficant coefficient zero.

Parameters

◆ isNegativeOne()

template<class Field>
bool DenseUnivariatePolynomial< Field >::isNegativeOne ( ) const
inline

Is polynomial a constatn -1.

Parameters

◆ isOne()

template<class Field>
bool DenseUnivariatePolynomial< Field >::isOne ( ) const
inlinevirtual

Is polynomial a constatn 1.

Parameters

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ isZero()

template<class Field>
bool DenseUnivariatePolynomial< Field >::isZero ( ) const
inlinevirtual

Is zero polynomial.

Parameters

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ lazyPseudoDivide() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::lazyPseudoDivide ( const DenseUnivariatePolynomial< Field > &  b,
Field *  c,
Field *  d 
)
inlinevirtual

Lazy pseudo dividsion Return the quotient and itself becomes remainder e is the exact number of division steps.

Parameters
bThe dividend polynomial
cThe leading coefficient of b to the power e
dThat to the power deg(a) - deg(b) + 1 - e

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ lazyPseudoDivide() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::lazyPseudoDivide ( const DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > *  rem,
Field *  c,
Field *  d 
) const
inlinevirtual

Lazy pseudo dividsion Return the quotient e is the exact number of division steps.

Parameters
bThe divident polynomial
remThe remainder polynomial
cThe leading coefficient of b to the power e
dThat to the power deg(a) - deg(b) + 1 - e

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ leadingCoefficient()

template<class Field>
Field DenseUnivariatePolynomial< Field >::leadingCoefficient ( ) const
inline

Get the leading coefficient.

Parameters

◆ monicDivide() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::monicDivide ( const DenseUnivariatePolynomial< Field > &  b)
inlinevirtual

Monic division Return quotient and itself become the remainder.

Parameters
bThe dividend polynomial

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ monicDivide() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::monicDivide ( const DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > *  rem 
) const
inlinevirtual

Monic division Return quotient.

Parameters
bThe dividend polynomial
remThe remainder polynomial

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ negate()

template<class Field>
void DenseUnivariatePolynomial< Field >::negate ( )
inline

Compute -f(x)

Parameters

◆ negativeOne()

template<class Field>
void DenseUnivariatePolynomial< Field >::negativeOne ( )
inline

Set polynomial to -1.

Parameters

◆ negativeVariable()

template<class Field>
void DenseUnivariatePolynomial< Field >::negativeVariable ( )
inline

Compute f(-x)

Parameters

◆ NewtonDivisionQuotient()

template<class Field>
void DenseUnivariatePolynomial< Field >::NewtonDivisionQuotient ( DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > &  q,
DenseUnivariatePolynomial< Field > &  r,
int  l 
)
inline

Fast Division (based on Modern Computer Algebra , Newton Iteration Chapter 9)

Parameters
bdivisor
q(out) qoutient
r(out) remainder
fieldValprime field
lnumber of newton iteration

◆ NewtonIterationInversion()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::NewtonIterationInversion ( int  l)
inline

Does Newton Iteration to compute the Reverse Inverse of a polynomial (based on Modern Computer Algebra , Newton Iteration Chapter 9)

Parameters
lnumber of newton iteration (n - m + 1)

◆ one()

template<class Field>
void DenseUnivariatePolynomial< Field >::one ( )
inlinevirtual

Set polynomial to 1.

Parameters

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator!=()

template<class Field>
bool DenseUnivariatePolynomial< Field >::operator!= ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Overload operator !=.

Parameters
bA univariate rational polynoial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator%()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator% ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Get the remainder of *this and b;.

Parameters
bthe divisor
Returns
the remainder

Implements BPASEuclideanDomain< DenseUnivariatePolynomial< Field > >.

◆ operator%=()

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator%= ( const DenseUnivariatePolynomial< Field > &  b)
inlinevirtual

Assign *this to be the remainder of *this and b.

Parameters
bthe divisor
Returns
this after assignment.

Implements BPASEuclideanDomain< DenseUnivariatePolynomial< Field > >.

◆ operator*() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator* ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Multiply to another polynomial.

Parameters
bA univariate rational polynomial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator*() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator* ( const Field &  e) const
inline

Overload operator *.

Parameters
eA rational number

◆ operator*=() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator*= ( const DenseUnivariatePolynomial< Field > &  b)
inlinevirtual

Overload operator *=.

Parameters
bA univariate rational polynomial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator*=() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator*= ( const Field &  e)
inline

Overload operator *=.

Parameters
eA rational number

◆ operator+() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator+ ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Overload operator +.

Parameters
bA univariate rational polynomial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator+() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator+ ( const Field &  c) const
inline

Overload Operator +.

Parameters
cA rational number

◆ operator+=() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator+= ( const DenseUnivariatePolynomial< Field > &  b)
inlinevirtual

Overload Operator +=.

Parameters
bA univariate rational polynomial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator+=() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator+= ( const Field &  c)
inline

Overload Operator +=.

Parameters
cA rational number

◆ operator-() [1/3]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator- ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Subtract another polynomial.

Parameters
bA univariate rational polynomial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator-() [2/3]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator- ( ) const
inlinevirtual

Overload operator -, negate.

Parameters

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator-() [3/3]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator- ( const Field &  c) const
inline

Overload operator -.

Parameters
cA rational number

◆ operator-=() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator-= ( const DenseUnivariatePolynomial< Field > &  b)
inlinevirtual

Overload operator -=.

Parameters
bA univariate rational polynomial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator-=() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator-= ( const Field &  c)
inline

Overload operator -=.

Parameters
cA rational number

◆ operator/() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator/ ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Overload operator / ExactDivision.

Parameters
bA univariate rational polynomial

Implements BPASIntegralDomain< DenseUnivariatePolynomial< Field > >.

◆ operator/() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator/ ( const Field &  e) const
inline

Overload operator /.

Parameters
eA rational number

◆ operator/=() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator/= ( const DenseUnivariatePolynomial< Field > &  b)
inlinevirtual

Overload operator /= ExactDivision.

Parameters
bA univariate rational polynomial

Implements BPASIntegralDomain< DenseUnivariatePolynomial< Field > >.

◆ operator/=() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator/= ( const Field &  e)
inline

Overload operator /=.

Parameters
eA rational number

◆ operator<<()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator<< ( int  k) const
inlinevirtual

Overload operator << replace by muplitying x^k.

Parameters
kThe exponent of variable, k > 0

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ operator<<=()

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator<<= ( int  k)
inlinevirtual

Overload operator <<= replace by muplitying x^k.

Parameters
kThe exponent of variable, k > 0

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ operator=()

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator= ( const DenseUnivariatePolynomial< Field > &  b)
inlinevirtual

Overload operator =.

Parameters
bA univariate rational polynoial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator==()

template<class Field>
bool DenseUnivariatePolynomial< Field >::operator== ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Overload operator ==.

Parameters
bA univariate rational polynoial

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator>>()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator>> ( int  k) const
inlinevirtual

Overload operator >> replace by dividing x^k, and return the quotient.

Parameters
kThe exponent of variable, k > 0

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ operator>>=()

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator>>= ( int  k)
inlinevirtual

Overload operator >>= replace by dividing x^k, and return the quotient.

Parameters
kThe exponent of variable, k > 0

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ operator^()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::operator^ ( long long int  e) const
inlinevirtual

Overload operator ^ replace xor operation by exponentiation.

Parameters
eThe exponentiation, e > 0

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ operator^=()

template<class Field>
DenseUnivariatePolynomial<Field>& DenseUnivariatePolynomial< Field >::operator^= ( long long int  e)
inlinevirtual

Overload operator ^= replace xor operation by exponentiation.

Parameters
eThe exponentiation, e > 0

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ print()

template<class Field>
void DenseUnivariatePolynomial< Field >::print ( std::ostream &  out) const
inlinevirtual

Overload stream operator <<.

Parameters
outStream object
bA univariate rational polynoial

Reimplemented from BPASRing< DenseUnivariatePolynomial< Field > >.

◆ pseudoDivide() [1/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::pseudoDivide ( const DenseUnivariatePolynomial< Field > &  b,
Field *  d = NULL 
)
inlinevirtual

Pseudo dividsion Return the quotient and itself becomes remainder.

Parameters
bThe divident polynomial
dThe leading coefficient of b to the power deg(a) - deg(b) + 1

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ pseudoDivide() [2/2]

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::pseudoDivide ( const DenseUnivariatePolynomial< Field > &  b,
DenseUnivariatePolynomial< Field > *  rem,
Field *  d 
) const
inlinevirtual

Pseudo dividsion Return the quotient.

Parameters
bThe divident polynomial
remThe remainder polynomial
dThe leading coefficient of b to the power deg(a) - deg(b) + 1

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ quotient()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::quotient ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Get the quotient of *this and b.

Parameters
bthe divisor
Returns
the quotient

Implements BPASEuclideanDomain< DenseUnivariatePolynomial< Field > >.

◆ reciprocal()

template<class Field>
void DenseUnivariatePolynomial< Field >::reciprocal ( )
inline

Number of coefficient sign variation.

Parameters
Revertcoefficients

◆ remainder()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::remainder ( const DenseUnivariatePolynomial< Field > &  b) const
inlinevirtual

Get the remainder of *this and b.

Parameters
bthe divisor
Returns
the remainder

Implements BPASEuclideanDomain< DenseUnivariatePolynomial< Field > >.

◆ Reverse()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::Reverse ( ) const
inline

Reverse a polynomial (based on Modern Computer Algebra , Newton Iteration Chapter 9)

Parameters

◆ scaleTransform()

template<class Field>
void DenseUnivariatePolynomial< Field >::scaleTransform ( int  k)
inline

Scale transform operation.

Parameters
k> 0: f(2^k*x)

◆ setCoefficient()

template<class Field>
void DenseUnivariatePolynomial< Field >::setCoefficient ( int  k,
const Field &  value 
)
inlinevirtual

Set a coefficient of the polynomial.

Parameters
kOffset
valCoefficient

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ setVariableName()

template<class Field>
void DenseUnivariatePolynomial< Field >::setVariableName ( const Symbol x)
inlinevirtual

Set variable's name.

Parameters
xVarable's name

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ squareFree()

template<class Field>
Factors<DenseUnivariatePolynomial<Field> > DenseUnivariatePolynomial< Field >::squareFree ( ) const
inlinevirtual

Square free.

Parameters

Implements BPASGCDDomain< DenseUnivariatePolynomial< Field > >.

◆ SRGFNcmp()

template<class Field>
bool DenseUnivariatePolynomial< Field >::SRGFNcmp ( mpz_class &  p)
inline

Helper function to compare a given prime number with manually computed Generalized Fermat Numbers.

Parameters
pprime number

◆ subtract()

template<class Field>
void DenseUnivariatePolynomial< Field >::subtract ( const DenseUnivariatePolynomial< Field > &  b)
inline

Subtract another polynomial from itself.

Parameters
bA univariate rational polynomial

◆ unitCanonical()

template<class Field>
DenseUnivariatePolynomial<Field> DenseUnivariatePolynomial< Field >::unitCanonical ( DenseUnivariatePolynomial< Field > *  u,
DenseUnivariatePolynomial< Field > *  v 
) const
inlinevirtual

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.

Implements BPASRing< DenseUnivariatePolynomial< Field > >.

◆ variable()

template<class Field>
Symbol DenseUnivariatePolynomial< Field >::variable ( ) const
inlinevirtual

Get variable's name.

Parameters

Implements BPASUnivariatePolynomial< Field, DenseUnivariatePolynomial< Field > >.

◆ zero()

template<class Field>
void DenseUnivariatePolynomial< Field >::zero ( )
inlinevirtual

Zero polynomial.

Parameters

Implements BPASRing< DenseUnivariatePolynomial< Field > >.


The documentation for this class was generated from the following file: