All Classes Functions Friends
Public Member Functions | Static Public Attributes | Friends | List of all members
DenseUnivariateIntegerPolynomial Class Reference
The concrete class DenseUnivariateIntegerPolynomial inherits from BPASUnivariatePolynomial and implements a univariate polynomial ring over the integer numbers with a dense representation. It overrides all the public member functions of BPASRing, BPASPolynomial and BPASUnivariatePolynomial. One can construct a DenseUnivariateIntegerPolynomial object either by initializing a zero polynomial with or without its size, or from another DenseUnivariateIntegerPolynomial object.
Inheritance diagram for DenseUnivariateIntegerPolynomial:
BPASUnivariatePolynomial BPASPolynomial BPASRing

Public Member Functions

 DenseUnivariateIntegerPolynomial ()
 
 DenseUnivariateIntegerPolynomial (int s)
 
 DenseUnivariateIntegerPolynomial (Integer e)
 
 DenseUnivariateIntegerPolynomial (RationalNumber e)
 
 DenseUnivariateIntegerPolynomial (const DenseUnivariateIntegerPolynomial &b)
 
 ~DenseUnivariateIntegerPolynomial ()
 
int degree ()
 
mpz_class leadingCoefficient ()
 
mpz_class * coefficients (int k=0)
 
mpz_class coefficient (int k)
 
void setCoefficient (int k, mpz_class value)
 
void setCoefficient (int k, Integer value)
 
void setCoefficient (int k, sfixn value)
 
std::string variable ()
 
void setVariableName (std::string x)
 
DenseUnivariateIntegerPolynomialoperator= (DenseUnivariateIntegerPolynomial b)
 
bool operator!= (DenseUnivariateIntegerPolynomial &b)
 
bool operator== (DenseUnivariateIntegerPolynomial &b)
 
bool isZero ()
 
void zero ()
 
bool isOne ()
 
void one ()
 
bool isNegativeOne ()
 
void negativeOne ()
 
int isConstant ()
 
mpz_class content ()
 
bool isTrailingCoefficientZero ()
 
DenseUnivariateIntegerPolynomial operator^ (int e)
 
DenseUnivariateIntegerPolynomialoperator^= (int e)
 
DenseUnivariateIntegerPolynomial operator<< (int k)
 
DenseUnivariateIntegerPolynomialoperator<<= (int k)
 
DenseUnivariateIntegerPolynomial operator>> (int k)
 
DenseUnivariateIntegerPolynomialoperator>>= (int k)
 
DenseUnivariateIntegerPolynomial operator+ (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomialoperator+= (DenseUnivariateIntegerPolynomial b)
 
void add (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomial operator+ (Integer c)
 
DenseUnivariateIntegerPolynomial operator+ (mpz_class c)
 
DenseUnivariateIntegerPolynomial operator+ (sfixn c)
 
DenseUnivariateIntegerPolynomialoperator+= (Integer c)
 
DenseUnivariateIntegerPolynomialoperator+= (mpz_class c)
 
DenseUnivariateIntegerPolynomialoperator+= (sfixn c)
 
DenseUnivariateIntegerPolynomial operator- (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomialoperator-= (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomial operator- ()
 
void negate ()
 
void subtract (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomial operator- (Integer c)
 
DenseUnivariateIntegerPolynomial operator- (mpz_class c)
 
DenseUnivariateIntegerPolynomial operator- (sfixn c)
 
DenseUnivariateIntegerPolynomialoperator-= (Integer c)
 
DenseUnivariateIntegerPolynomialoperator-= (mpz_class c)
 
DenseUnivariateIntegerPolynomialoperator-= (sfixn c)
 
DenseUnivariateIntegerPolynomial operator* (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomialoperator*= (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomial operator* (Integer e)
 
DenseUnivariateIntegerPolynomial operator* (mpz_class e)
 
DenseUnivariateIntegerPolynomial operator* (sfixn e)
 
DenseUnivariateIntegerPolynomialoperator*= (Integer e)
 
DenseUnivariateIntegerPolynomialoperator*= (mpz_class e)
 
DenseUnivariateIntegerPolynomialoperator*= (sfixn e)
 
DenseUnivariateIntegerPolynomial operator/ (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomialoperator/= (DenseUnivariateIntegerPolynomial b)
 
DenseUnivariateIntegerPolynomial operator/ (Integer e)
 
DenseUnivariateIntegerPolynomial operator/ (mpz_class e)
 
DenseUnivariateIntegerPolynomial operator/ (sfixn e)
 
DenseUnivariateIntegerPolynomialoperator/= (Integer e)
 
DenseUnivariateIntegerPolynomialoperator/= (mpz_class e)
 
DenseUnivariateIntegerPolynomialoperator/= (sfixn e)
 
DenseUnivariateIntegerPolynomial monicDivide (DenseUnivariateIntegerPolynomial &b)
 
DenseUnivariateIntegerPolynomial monicDivide (DenseUnivariateIntegerPolynomial &b, DenseUnivariateIntegerPolynomial *rem)
 
DenseUnivariateIntegerPolynomial lazyPseudoDivide (DenseUnivariateIntegerPolynomial &b, mpz_class *c, mpz_class *d=NULL)
 
DenseUnivariateIntegerPolynomial lazyPseudoDivide (DenseUnivariateIntegerPolynomial &b, DenseUnivariateIntegerPolynomial *rem, mpz_class *c, mpz_class *d)
 
DenseUnivariateIntegerPolynomial pseudoDivide (DenseUnivariateIntegerPolynomial &b, mpz_class *d=NULL)
 
DenseUnivariateIntegerPolynomial pseudoDivide (DenseUnivariateIntegerPolynomial &b, DenseUnivariateIntegerPolynomial *rem, mpz_class *d)
 
DenseUnivariateIntegerPolynomial gcd (DenseUnivariateIntegerPolynomial q, int type=0)
 
void differentiate (int k)
 
mpz_class evaluate (mpz_class x)
 
std::vector
< DenseUnivariateIntegerPolynomial
squareFree ()
 
- Public Member Functions inherited from BPASUnivariatePolynomial
BPASUnivariatePolynomialoperator+ (DataType)
 
BPASUnivariatePolynomialoperator+= (DataType)
 
BPASUnivariatePolynomialoperator- (DataType)
 
BPASUnivariatePolynomialoperator-= (DataType)
 
BPASUnivariatePolynomialoperator* (DataType)
 
BPASUnivariatePolynomialoperator*= (DataType)
 
BPASUnivariatePolynomialoperator/ (DataType)
 
BPASUnivariatePolynomialoperator/= (DataType)
 
BPASUnivariatePolynomialoperator<< (int)
 
BPASUnivariatePolynomialoperator<<= (int)
 
BPASUnivariatePolynomialoperator>> (int)
 
BPASUnivariatePolynomialoperator>>= (int)
 
BPASUnivariatePolynomialmonicDivide (BPASUnivariatePolynomial &)
 
BPASUnivariatePolynomialmonicDivide (BPASUnivariatePolynomial &, BPASUnivariatePolynomial *)
 
BPASUnivariatePolynomiallazyPseudoDivide (BPASUnivariatePolynomial &, DataType *, DataType *)
 
BPASUnivariatePolynomiallazyPseudoDivide (BPASUnivariatePolynomial &, BPASUnivariatePolynomial *, DataType *, DataType *)
 
BPASUnivariatePolynomialpseudoDivide (BPASUnivariatePolynomial &, DataType *)
 
BPASUnivariatePolynomialpseudoDivide (BPASUnivariatePolynomial &, BPASUnivariatePolynomial *, DataType *)
 
DataType content ()
 
BPASUnivariatePolynomialgcd (BPASUnivariatePolynomial &)
 
std::vector
< BPASUnivariatePolynomial & > 
squareFree ()
 
DataType leadingCoefficient ()
 
DataType coefficient (int)
 
void setCoefficient (int, DataType)
 
DataType evaluate (DataType)
 
- Public Member Functions inherited from BPASPolynomial
BPASPolynomialoperator= (BPASPolynomial &)
 
BPASPolynomialoperator+ (BPASPolynomial &)
 
BPASPolynomialoperator+= (BPASPolynomial &)
 
BPASPolynomialoperator- (BPASPolynomial &)
 
BPASPolynomialoperator- ()
 
BPASPolynomialoperator-= (BPASPolynomial &)
 
BPASPolynomialoperator* (BPASPolynomial &)
 
BPASPolynomialoperator*= (BPASPolynomial &)
 
BPASPolynomialoperator/ (BPASPolynomial &)
 
BPASPolynomialoperator/= (BPASPolynomial &)
 
BPASPolynomialoperator^ (int)
 
bool operator== (BPASPolynomial &)
 
bool operator!= (BPASPolynomial &)
 

Static Public Attributes

static int characteristic
 
static bool isPrimeField
 
static bool isComplexField
 
- Static Public Attributes inherited from BPASRing
static int characteristic
 
static bool isPrimeField
 
static bool isComplexField
 

Friends

DenseUnivariateIntegerPolynomial operator+ (mpz_class c, DenseUnivariateIntegerPolynomial p)
 
DenseUnivariateIntegerPolynomial operator+ (sfixn c, DenseUnivariateIntegerPolynomial p)
 
DenseUnivariateIntegerPolynomial operator- (mpz_class c, DenseUnivariateIntegerPolynomial p)
 
DenseUnivariateIntegerPolynomial operator- (sfixn c, DenseUnivariateIntegerPolynomial p)
 
DenseUnivariateIntegerPolynomial operator* (mpz_class e, DenseUnivariateIntegerPolynomial p)
 
DenseUnivariateIntegerPolynomial operator* (sfixn e, DenseUnivariateIntegerPolynomial p)
 
DenseUnivariateIntegerPolynomial operator/ (mpz_class e, DenseUnivariateIntegerPolynomial p)
 
std::ostream & operator<< (std::ostream &out, DenseUnivariateIntegerPolynomial b)
 

Detailed Description

Data Structure for univariate integer polynomial stored in a dense case

Constructor & Destructor Documentation

DenseUnivariateIntegerPolynomial::DenseUnivariateIntegerPolynomial ( )
inline

Construct a polynomial

Parameters
d
DenseUnivariateIntegerPolynomial::DenseUnivariateIntegerPolynomial ( int  s)
inline

Construct a polynomial with degree

Parameters
d,:Size of the polynomial
DenseUnivariateIntegerPolynomial::DenseUnivariateIntegerPolynomial ( Integer  e)
inline

Construct a polynomial with a coeffient

Parameters
e,:The coefficient
DenseUnivariateIntegerPolynomial::DenseUnivariateIntegerPolynomial ( const DenseUnivariateIntegerPolynomial b)
inline

Copy constructor

Parameters
b,:A densed univariate rationl polynomial
DenseUnivariateIntegerPolynomial::~DenseUnivariateIntegerPolynomial ( )
inline

Destroy the polynomial

Parameters

Member Function Documentation

void DenseUnivariateIntegerPolynomial::add ( DenseUnivariateIntegerPolynomial  b)

Add another polynomial to itself

Parameters
b,:A univariate integer polynomial
mpz_class DenseUnivariateIntegerPolynomial::coefficient ( int  k)
inline

Get a coefficient of the polynomial

Parameters
k,:Offset
mpz_class* DenseUnivariateIntegerPolynomial::coefficients ( int  k = 0)
inline

Get coefficients of the polynomial, given start offset

Parameters
k,:Offset
mpz_class DenseUnivariateIntegerPolynomial::content ( )
inline

Content of the polynomial

Parameters
int DenseUnivariateIntegerPolynomial::degree ( )
inlinevirtual

Get degree of the polynomial

Parameters

Implements BPASUnivariatePolynomial.

void DenseUnivariateIntegerPolynomial::differentiate ( int  k)
virtual

Compute k-th differentiate

Parameters
k,:k-th differentiate, k > 0

Implements BPASUnivariatePolynomial.

mpz_class DenseUnivariateIntegerPolynomial::evaluate ( mpz_class  x)

Evaluate f(x)

Parameters
x,:Evaluation point
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::gcd ( DenseUnivariateIntegerPolynomial  q,
int  type = 0 
)

GCD(p, q)

Parameters
q,:The other polynomial
int DenseUnivariateIntegerPolynomial::isConstant ( )
inlinevirtual

Is a constant

Parameters

Implements BPASRing.

bool DenseUnivariateIntegerPolynomial::isNegativeOne ( )
inlinevirtual

Is polynomial a constatn -1

Parameters

Implements BPASRing.

bool DenseUnivariateIntegerPolynomial::isOne ( )
inlinevirtual

Is polynomial a constatn 1

Parameters

Implements BPASRing.

bool DenseUnivariateIntegerPolynomial::isTrailingCoefficientZero ( )
inlinevirtual

Is the least signficant coefficient zero

Parameters

Implements BPASUnivariatePolynomial.

bool DenseUnivariateIntegerPolynomial::isZero ( )
inlinevirtual

Is zero polynomial

Parameters

Implements BPASRing.

DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::lazyPseudoDivide ( DenseUnivariateIntegerPolynomial b,
mpz_class *  c,
mpz_class *  d = NULL 
)

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

Parameters
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
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::lazyPseudoDivide ( DenseUnivariateIntegerPolynomial b,
DenseUnivariateIntegerPolynomial rem,
mpz_class *  c,
mpz_class *  d 
)
inline

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

Parameters
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
mpz_class DenseUnivariateIntegerPolynomial::leadingCoefficient ( )
inline

Get the leading coefficient

Parameters
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::monicDivide ( DenseUnivariateIntegerPolynomial b)

Monic division Return quotient and itself become the remainder

Parameters
b,:The dividend polynomial
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::monicDivide ( DenseUnivariateIntegerPolynomial b,
DenseUnivariateIntegerPolynomial rem 
)
inline

Monic division Return quotient

Parameters
b,:The dividend polynomial
rem,:The remainder polynomial
void DenseUnivariateIntegerPolynomial::negate ( )
inline

Compute -f(x)

Parameters
void DenseUnivariateIntegerPolynomial::negativeOne ( )
inlinevirtual

Set polynomial to -1

Parameters

Implements BPASRing.

void DenseUnivariateIntegerPolynomial::one ( )
inlinevirtual

Set polynomial to 1

Parameters

Implements BPASRing.

bool DenseUnivariateIntegerPolynomial::operator!= ( DenseUnivariateIntegerPolynomial b)
inline

Overload operator !=

Parameters
b,:A univariate integer polynoial
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator* ( DenseUnivariateIntegerPolynomial  b)

Multiply to another polynomial

Parameters
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator* ( Integer  e)
inline

Overload operator *

Parameters
e,:An integer
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator*= ( DenseUnivariateIntegerPolynomial  b)
inline

Overload operator *=

Parameters
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator*= ( Integer  e)
inline

Overload operator *=

Parameters
e,:An integer
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator*= ( sfixn  e)
inline

Overload operator *=

Parameters
e,:A constant
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator+ ( DenseUnivariateIntegerPolynomial  b)

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

Parameters
k,:The exponent of variable, k > 0 Overload operator +
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator+ ( Integer  c)
inline

Overload Operator +

Parameters
c,:An integer
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator+= ( DenseUnivariateIntegerPolynomial  b)
inline

Overload Operator +=

Parameters
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator+= ( Integer  c)
inline

Overload Operator +=

Parameters
c,:An integer
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator- ( DenseUnivariateIntegerPolynomial  b)

Subtract another polynomial

Parameters
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator- ( )

Overload operator -, negate

Parameters
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator- ( Integer  c)
inline

Overload operator -

Parameters
c,:An integer
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator-= ( DenseUnivariateIntegerPolynomial  b)
inline

Overload operator -=

Parameters
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator-= ( Integer  c)
inline

Overload operator -=

Parameters
c,:An integer
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator/ ( DenseUnivariateIntegerPolynomial  b)
inline

Overload operator / ExactDivision

Parameters
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator/ ( Integer  e)
inline

Overload operator /

Parameters
e,:An integer
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator/= ( DenseUnivariateIntegerPolynomial  b)

Overload operator /= ExactDivision

Parameters
b,:A univariate integer polynomial
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator/= ( Integer  e)
inline

Overload operator /=

Parameters
e,:An integer
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator<< ( int  k)

Overload operator << replace by muplitying x^k

Parameters
k,:The exponent of variable, k > 0
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator<<= ( int  k)
inline

Overload operator << replace by muplitying x^k

Parameters
k,:The exponent of variable, k > 0
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator= ( DenseUnivariateIntegerPolynomial  b)
inline

Overload operator =

Parameters
b,:A univariate integer polynoial
bool DenseUnivariateIntegerPolynomial::operator== ( DenseUnivariateIntegerPolynomial b)
inline

Overload operator ==

Parameters
b,:A univariate integer polynoial
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator>> ( int  k)

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

Parameters
k,:The exponent of variable, k > 0
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::operator^ ( int  e)

Overload operator ^ replace xor operation by exponentiation

Parameters
e,:The exponentiation, e > 0
DenseUnivariateIntegerPolynomial& DenseUnivariateIntegerPolynomial::operator^= ( int  e)
inline

Overload operator ^= replace xor operation by exponentiation

Parameters
e,:The exponentiation, e > 0
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::pseudoDivide ( DenseUnivariateIntegerPolynomial b,
mpz_class *  d = NULL 
)

Pseudo dividsion Return the quotient and itself becomes remainder

Parameters
b,:The divident polynomial
d,:The leading coefficient of b to the power deg(a) - deg(b) + 1
DenseUnivariateIntegerPolynomial DenseUnivariateIntegerPolynomial::pseudoDivide ( DenseUnivariateIntegerPolynomial b,
DenseUnivariateIntegerPolynomial rem,
mpz_class *  d 
)

Pseudo dividsion Return the quotient

Parameters
b,:The divident polynomial
rem,:The remainder polynomial
d,:The leading coefficient of b to the power deg(a) - deg(b) + 1
void DenseUnivariateIntegerPolynomial::setCoefficient ( int  k,
mpz_class  value 
)
inline

Set a coefficient of the polynomial

Parameters
k,:Offset
val,:Coefficient
void DenseUnivariateIntegerPolynomial::setVariableName ( std::string  x)
inlinevirtual

Set variable's name

Parameters
x,:Varable's name

Implements BPASUnivariatePolynomial.

std::vector<DenseUnivariateIntegerPolynomial> DenseUnivariateIntegerPolynomial::squareFree ( )

Square free

Parameters
void DenseUnivariateIntegerPolynomial::subtract ( DenseUnivariateIntegerPolynomial  b)

Subtract another polynomial from itself

Parameters
b,:A univariate integer polynomial
std::string DenseUnivariateIntegerPolynomial::variable ( )
inlinevirtual

Get variable's name

Parameters

Implements BPASUnivariatePolynomial.

void DenseUnivariateIntegerPolynomial::zero ( )
inlinevirtual

Zero polynomial

Parameters

Implements BPASRing.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
DenseUnivariateIntegerPolynomial  b 
)
friend

Overload stream operator <<

Parameters
out,:Stream object
b,:A univariate integer polynoial

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