Basic Polynomial Algebra Subprograms (BPAS)  v. 1.791
Public Member Functions | List of all members
BPASUnivariatePolynomial< Ring, Derived > Class Template Referenceabstract

An abstract class defining the interface of a univariate polynomial over an arbitrary BPASRing. More...

#include <BPASUnivarPolynomial.hpp>

Simplified semantic inheritance diagram for BPASUnivariatePolynomial< Ring, Derived >:
- Full inheritance diagram for BPASUnivariatePolynomial< Ring, Derived >:
[legend]

Public Member Functions

virtual void differentiate ()=0
 Differentiate this polynomial, setting itself to its derivative.
 
virtual void differentiate (int k)=0
 Differentiate this polynomial k times, setting itself to the final derivative. More...
 
virtual Derived derivative () const =0
 Obtain the derivative of this polynomial. More...
 
virtual Derived derivative (int) const =0
 Obtain the kth derivative of this polynomial. More...
 
virtual Ring evaluate (const Ring &r) const =0
 Evaluate this polynomial by substituting the input ring element r for the indeterminate. More...
 
virtual Derived monicDivide (const Derived &d)=0
 Divide this polynomial by the monic polynomial d, setting this polynomial to be the remainder. More...
 
virtual Derived monicDivide (const Derived &d, Derived *q=NULL) const =0
 Divide this polynomial by the monic polynomial d. More...
 
virtual Derived lazyPseudoDivide (const Derived &d, Ring *h1, Ring *h2)=0
 Perform a lazy pseudo-divison, also known as sparse pseudo-division. More...
 
virtual Derived lazyPseudoDivide (const Derived &d, Derived *q, Ring *h1, Ring *h2) const =0
 Perform a lazy pseudo-divison, also known as sparse pseudo-division. More...
 
virtual Derived pseudoDivide (const Derived &d, Ring *he)=0
 Perform a pseudo-divison, specifically, determine q and r, as in division, but satisfying h^e * this = q*d + r, where h is the leading coefficient of d and e is a positive integer equal to deg(this) - deg(d) + 1 Return the quotient and this becomes the remainder. More...
 
virtual Derived pseudoDivide (const Derived &d, Derived *q, Ring *he) const =0
 Perform a pseudo-divison, specifically, determine q and r, as in division, but satisfying h^e * this = q*d + r, where h is the leading coefficient of d and e is a positive integer equal to deg(this) - deg(d) + 1 Return the quotient and this becomes the remainder. More...
 
virtual Ring coefficient (int d) const =0
 Get the coefficient of the monomial with degree d. More...
 
virtual void setCoefficient (int d, const Ring &r)=0
 Set the coefficient of the monomial with degree d to be the Ring element r. More...
 
virtual void setVariableName (const Symbol &sym)=0
 Set the indeterminate of this polynomial to be the input symbol. More...
 
virtual Symbol variable () const =0
 Get the indeterminate of this polynomial. More...
 
virtual Derived operator<< (int i) const =0
 Shift this polynomial left i times, that is, multiply by x^i, where x is this polynomial's indeterminate. More...
 
virtual Derived & operator<<= (int i)=0
 Shift this polynomial left i times, that is, multiply by x^i, where x is this polynomial's indeterminate, and set this polynomial to the result. More...
 
virtual Derived operator>> (int) const =0
 Shift this polynomial right i times, that is, divide by x^i, where x is this polynomial's indeterminate,. More...
 
virtual Derived & operator>>= (int)=0
 Shift this polynomial right i times, that is, divide by x^i, where x is this polynomial's indeterminate, and set this polynomial to the result. More...
 

Detailed Description

template<class Ring, class Derived>
class BPASUnivariatePolynomial< Ring, Derived >

An abstract class defining the interface of a univariate polynomial over an arbitrary BPASRing.

Depending on the specialization of the template Ring parameter, this class might form a Euclidean domain, and if so, fulfills the Euclidean domain interface also.

Derived should be the conrete class being implemented, following the Curiously Recurring Template Pattern.

Member Function Documentation

◆ coefficient()

template<class Ring, class Derived>
virtual Ring BPASUnivariatePolynomial< Ring, Derived >::coefficient ( int  d) const
pure virtual

Get the coefficient of the monomial with degree d.

Parameters
dthe degree of the monomial.
Returns
the coefficient of that monomial.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateRationalPolynomial, and DenseUnivariateIntegerPolynomial.

◆ derivative() [1/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::derivative ( ) const
pure virtual

◆ derivative() [2/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::derivative ( int  ) const
pure virtual

Obtain the kth derivative of this polynomial.

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

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ differentiate()

template<class Ring, class Derived>
virtual void BPASUnivariatePolynomial< Ring, Derived >::differentiate ( int  k)
pure virtual

Differentiate this polynomial k times, setting itself to the final derivative.

Parameters
kthe number of times to differentiate.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ evaluate()

template<class Ring, class Derived>
virtual Ring BPASUnivariatePolynomial< Ring, Derived >::evaluate ( const Ring &  r) const
pure virtual

Evaluate this polynomial by substituting the input ring element r for the indeterminate.

Parameters
rthe input ring element
Returns
the evaluation of this polynomial at r.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ lazyPseudoDivide() [1/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::lazyPseudoDivide ( const Derived &  d,
Ring *  h1,
Ring *  h2 
)
pure virtual

Perform a lazy pseudo-divison, also known as sparse pseudo-division.

Specifically, determine q and r, as in division, but satisfying h^e * this = q*d + r, where h is the leading coefficient of d and e is a positive integer equal to the number of division steps performed. Return the quotient and this becomes the remainder.

Parameters
dthe divisor.
[out]h1The leading coefficient of b to the power e
[out]h2h to the power deg(a) - deg(b) + 1 - e
Returns
the quotient.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ lazyPseudoDivide() [2/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::lazyPseudoDivide ( const Derived &  d,
Derived *  q,
Ring *  h1,
Ring *  h2 
) const
pure virtual

Perform a lazy pseudo-divison, also known as sparse pseudo-division.

Specifically, determine q and r, as in division, but satisfying h^e * this = q*d + r, where h is the leading coefficient of d and e is a positive integer equal to the number of division steps performed. Return the quotient and this becomes the remainder.

Parameters
dthe divisor.
[out]qa pointer to the quotient to output.
[out]h1The leading coefficient of b to the power e
[out]h2h to the power deg(this) - deg(d) + 1 - e
Returns
the remainder.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ monicDivide() [1/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::monicDivide ( const Derived &  d)
pure virtual

Divide this polynomial by the monic polynomial d, setting this polynomial to be the remainder.

Parameters
dthe monic divison.
Returns
the quotient.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ monicDivide() [2/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::monicDivide ( const Derived &  d,
Derived *  q = NULL 
) const
pure virtual

Divide this polynomial by the monic polynomial d.

The remainder is returned and the quotient returned via pointer q.

Parameters
dthe monic divisor.
[out]qa pointer to the quotient to return.
Returns
the remainder.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ operator<<()

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::operator<< ( int  i) const
pure virtual

Shift this polynomial left i times, that is, multiply by x^i, where x is this polynomial's indeterminate.

Returns
the shifted polynomial.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariateRationalPolynomial, DenseUnivariatePolynomial< Field >, and DenseUnivariateIntegerPolynomial.

◆ operator<<=()

template<class Ring, class Derived>
virtual Derived& BPASUnivariatePolynomial< Ring, Derived >::operator<<= ( int  i)
pure virtual

Shift this polynomial left i times, that is, multiply by x^i, where x is this polynomial's indeterminate, and set this polynomial to the result.

Returns
a reference to this polynomial after shifting.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariateRationalPolynomial, DenseUnivariateIntegerPolynomial, and DenseUnivariatePolynomial< Field >.

◆ operator>>()

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::operator>> ( int  ) const
pure virtual

Shift this polynomial right i times, that is, divide by x^i, where x is this polynomial's indeterminate,.

Returns
the shifted polynomial.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateRationalPolynomial, and DenseUnivariateIntegerPolynomial.

◆ operator>>=()

template<class Ring, class Derived>
virtual Derived& BPASUnivariatePolynomial< Ring, Derived >::operator>>= ( int  )
pure virtual

Shift this polynomial right i times, that is, divide by x^i, where x is this polynomial's indeterminate, and set this polynomial to the result.

Returns
a reference to this polynomial after shifting.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateRationalPolynomial, and DenseUnivariateIntegerPolynomial.

◆ pseudoDivide() [1/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::pseudoDivide ( const Derived &  d,
Ring *  he 
)
pure virtual

Perform a pseudo-divison, specifically, determine q and r, as in division, but satisfying h^e * this = q*d + r, where h is the leading coefficient of d and e is a positive integer equal to deg(this) - deg(d) + 1 Return the quotient and this becomes the remainder.

Parameters
dthe divisor.
[out]heh to the power deg(this) - deg(d) + 1
Returns
the quotient.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ pseudoDivide() [2/2]

template<class Ring, class Derived>
virtual Derived BPASUnivariatePolynomial< Ring, Derived >::pseudoDivide ( const Derived &  d,
Derived *  q,
Ring *  he 
) const
pure virtual

Perform a pseudo-divison, specifically, determine q and r, as in division, but satisfying h^e * this = q*d + r, where h is the leading coefficient of d and e is a positive integer equal to deg(this) - deg(d) + 1 Return the quotient and this becomes the remainder.

Parameters
dthe divisor.
[out]qa pointer to the quotient to output.
[out]heh to the power deg(this) - deg(d) + 1
Returns
the remainder.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateIntegerPolynomial, and DenseUnivariateRationalPolynomial.

◆ setCoefficient()

template<class Ring, class Derived>
virtual void BPASUnivariatePolynomial< Ring, Derived >::setCoefficient ( int  d,
const Ring &  r 
)
pure virtual

Set the coefficient of the monomial with degree d to be the Ring element r.

Parameters
dthe degree of the monomial.
rthe ring element

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateRationalPolynomial, and DenseUnivariateIntegerPolynomial.

◆ setVariableName()

template<class Ring, class Derived>
virtual void BPASUnivariatePolynomial< Ring, Derived >::setVariableName ( const Symbol sym)
pure virtual

Set the indeterminate of this polynomial to be the input symbol.

Parameters
symthe new symbol for the indeterminate.

Implemented in SparseUnivariateTempPoly< Ring, Derived >, SparseUnivariateTempPoly< Field, Derived >, DenseUnivariatePolynomial< Field >, DenseUnivariateRationalPolynomial, and DenseUnivariateIntegerPolynomial.

◆ variable()

template<class Ring, class Derived>
virtual Symbol BPASUnivariatePolynomial< Ring, Derived >::variable ( ) const
pure virtual

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