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

A multivariate polynomial with coefficients in an arbitrary finite field represented densely. More...

#include <dmpolynomial.h>

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

Public Member Functions

 DistributedDenseMultivariateModularPolynomial ()
 Constructor using a default field.
 
 DistributedDenseMultivariateModularPolynomial (const Field &m)
 Constructor with the Field. More...
 
 DistributedDenseMultivariateModularPolynomial (int v, int *ds, Field m)
 Constructor with number of variables and terms. More...
 
 DistributedDenseMultivariateModularPolynomial (const Symbol &x, const Field &m)
 Construct with a variable name such that f(x) = x;. More...
 
 DistributedDenseMultivariateModularPolynomial (const DistributedDenseMultivariateModularPolynomial< Field > &b)
 Copy constructor. More...
 
 ~DistributedDenseMultivariateModularPolynomial ()
 Deconstructor. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator= (const DistributedDenseMultivariateModularPolynomial< Field > &b)
 Overload operator =. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator= (const Field &f)
 Overload operator =. More...
 
mpz_class getCharacteristic () const override
 The characteristic of this ring class.
 
bool isZero () const
 Is a zero polynomial. More...
 
void zero ()
 Zero polynomial. More...
 
bool isOne () const
 Is polynomial 1. More...
 
void one ()
 Set polynomial to 1. More...
 
bool isNegativeOne () const
 Is polynomial -1. More...
 
void negativeOne ()
 Set polynomial to -1. More...
 
int isConstant () const
 Is a constant. More...
 
int numberOfVariables () const
 Get the number of variables. More...
 
int numberOfRingVariables () const
 Get the number of variables in this polynomial ring.
 
Integer numberOfTerms () const
 Get the number of non-zero terms. More...
 
int size () const
 Get the size of the polynomial. More...
 
Integer degree () const
 Get the total degree.
 
Integer degree (const Symbol &x) const
 Get a partial degree of variable x. More...
 
Field leadingCoefficient () const
 Get the leading coefficient. More...
 
Field trailingCoefficient () const
 
bool isConstantTermZero () const
 
DistributedDenseMultivariateModularPolynomial< Field > unitCanonical (DistributedDenseMultivariateModularPolynomial *u=NULL, DistributedDenseMultivariateModularPolynomial *v=NULL) const
 
Field coefficient (int v, const int *d) const
 Get a coefficient. More...
 
Field coefficient (const std::vector< int > &v) const
 Get the coefficient of this polynomial with respect to the monomial defined by exponent vector exps. More...
 
void setCoefficient (int v, const int *d, const Field &val)
 Set a coefficient. More...
 
void setCoefficient (const std::vector< int > &v, const Field &val)
 Set the coefficient of this polynomial for the monomial defined by exponent vector exps to r. More...
 
void setCoefficient (int k, const Field &val)
 Set a coefficient. More...
 
Field content () const
 
DistributedDenseMultivariateModularPolynomial primitivePart () const
 
bool operator== (const DistributedDenseMultivariateModularPolynomial< Field > &b) const
 Overload operator ==. More...
 
bool operator!= (const DistributedDenseMultivariateModularPolynomial< Field > &b) const
 Overload operator !=. More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator+ (const DistributedDenseMultivariateModularPolynomial< Field > &b) const
 Overload operator +. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator+= (const DistributedDenseMultivariateModularPolynomial< Field > &b)
 Overload operator +=. More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator+ (const Field &e) const
 Overload operator +. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator+= (const Field &e)
 Overload operator +=. More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator- (const DistributedDenseMultivariateModularPolynomial< Field > &b) const
 Overload operator -. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator-= (const DistributedDenseMultivariateModularPolynomial< Field > &b)
 Overload operator -=. More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator- () const
 Overload operator -, negate. More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator- (const Field &e) const
 Overload operator -. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator-= (const Field &e)
 Overload operator -=. More...
 
void negate ()
 Negate, f(-x) More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator* (const DistributedDenseMultivariateModularPolynomial< Field > &b) const
 Overload operator *. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator*= (const DistributedDenseMultivariateModularPolynomial< Field > &b)
 Overload operator *=. More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator* (const Field &e) const
 Overload operator *. More...
 
DistributedDenseMultivariateModularPolynomial< Field > & operator*= (const Field &f)
 Overload operator *=. More...
 
DistributedDenseMultivariateModularPolynomial< Field > operator^ (long long int e) const
 
DistributedDenseMultivariateModularPolynomial< Field > & operator^= (long long int e)
 
DistributedDenseMultivariateModularPolynomial< Field > operator/ (const DistributedDenseMultivariateModularPolynomial< Field > &p) const
 
DistributedDenseMultivariateModularPolynomial< Field > & operator/= (const DistributedDenseMultivariateModularPolynomial< Field > &p)
 
DistributedDenseMultivariateModularPolynomial< Field > operator/ (const Field &e) const
 
DistributedDenseMultivariateModularPolynomial< Field > & operator/= (const Field &e)
 
void setRingVariables (const std::vector< Symbol > &xs)
 Set variable names. More...
 
std::vector< SymbolringVariables () const
 Get variable names. More...
 
std::vector< Symbolvariables () const
 Get all the variables in this polynomial with positive degree. More...
 
void print (std::ostream &out) const
 Overload stream operator <<. More...
 
ExpressionTree convertToExpressionTree () const
 Convert *this to an expression tree.
 
void differentiate (const Symbol &s, int k)
 Differentiate this polynomial k times, with respect to a particular variable, setting itself to its derivative. More...
 
void differentiate (const Symbol &s)
 Differentiate this polynomial, with respect to a particular variable, setting itself to its derivative. More...
 
DistributedDenseMultivariateModularPolynomial< Field > derivative (const Symbol &s, int k) const
 Differentiate this polynomial k times, with respect to a particular variable, setting itself to its derivative. More...
 
DistributedDenseMultivariateModularPolynomial< Field > derivative (const Symbol &s) const
 Differentiate this polynomial, with respect to a particular variable, setting itself to its derivative. More...
 
DistributedDenseMultivariateModularPolynomial< Field > evaluate (const std::vector< Symbol > &syms, const std::vector< Field > &vals) const
 Evaluate this polynomial by substituting the input ring elements elems for the variables vars, such that vars[i] = elems[i]. More...
 
DistributedDenseMultivariateModularPolynomial< Field > evaluate (int n, const Symbol *syms, const Field *vals) const
 Evaluate this polynomial by substituting the input ring elements elems for the variables vars, such that vars[i] = elems[i]. More...
 
DistributedDenseMultivariateModularPolynomial< Field > gcd (const DistributedDenseMultivariateModularPolynomial< Field > &p) const
 
Factors< DistributedDenseMultivariateModularPolynomialsquareFree () const
 Compute squarefree factorization of *this.
 

Static Public Attributes

static mpz_class characteristic
 

Friends

DistributedDenseMultivariateModularPolynomial< Field > operator+ (const Field &e, const DistributedDenseMultivariateModularPolynomial< Field > &f)
 
DistributedDenseMultivariateModularPolynomial< Field > operator- (const Field &e, const DistributedDenseMultivariateModularPolynomial< Field > &f)
 
DistributedDenseMultivariateModularPolynomial< Field > operator* (const Field &e, const DistributedDenseMultivariateModularPolynomial< Field > &f)
 

Detailed Description

template<class Field>
class DistributedDenseMultivariateModularPolynomial< Field >

A multivariate polynomial with coefficients in an arbitrary finite field represented densely.

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

Constructor & Destructor Documentation

◆ DistributedDenseMultivariateModularPolynomial() [1/4]

template<class Field>
DistributedDenseMultivariateModularPolynomial< Field >::DistributedDenseMultivariateModularPolynomial ( const Field &  m)
inline

Constructor with the Field.

Parameters
mThe prime

◆ DistributedDenseMultivariateModularPolynomial() [2/4]

template<class Field>
DistributedDenseMultivariateModularPolynomial< Field >::DistributedDenseMultivariateModularPolynomial ( int  v,
int *  ds,
Field  m 
)
inline

Constructor with number of variables and terms.

Parameters
vNumber of variables
dsPartial degrees
mThe prime

◆ DistributedDenseMultivariateModularPolynomial() [3/4]

template<class Field>
DistributedDenseMultivariateModularPolynomial< Field >::DistributedDenseMultivariateModularPolynomial ( const Symbol x,
const Field &  m 
)
inline

Construct with a variable name such that f(x) = x;.

Parameters
xThe variable name
mThe prime

◆ DistributedDenseMultivariateModularPolynomial() [4/4]

Copy constructor.

Parameters
bA multivariate modular polynomial

◆ ~DistributedDenseMultivariateModularPolynomial()

Deconstructor.

Parameters

Member Function Documentation

◆ coefficient() [1/2]

template<class Field>
Field DistributedDenseMultivariateModularPolynomial< Field >::coefficient ( int  v,
const int *  d 
) const
inlinevirtual

Get a coefficient.

Parameters
vNumber of variables
dThe exponent of each variable

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ coefficient() [2/2]

template<class Field>
Field DistributedDenseMultivariateModularPolynomial< Field >::coefficient ( const std::vector< int > &  exps) const
inlinevirtual

Get the coefficient of this polynomial with respect to the monomial defined by exponent vector exps.

The exponent vector should be defined over all variables in the polynomial ring.

Parameters
expsthe exponent vector

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ degree()

template<class Field>
Integer DistributedDenseMultivariateModularPolynomial< Field >::degree ( const Symbol x) const
inlinevirtual

Get a partial degree of variable x.

Parameters
xThe variable name

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ derivative() [1/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::derivative ( const Symbol ,
int   
) const
inlinevirtual

Differentiate this polynomial k times, with respect to a particular variable, setting itself to its derivative.

Parameters
varthe variable to derive with respect to.
kthe number of times to differentiate.
Returns
the derivative.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ derivative() [2/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::derivative ( const Symbol ) const
inlinevirtual

Differentiate this polynomial, with respect to a particular variable, setting itself to its derivative.

Parameters
varthe variable to derive with respect to.
Returns
the derivative.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ differentiate() [1/2]

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::differentiate ( const Symbol var,
int  k 
)
inlinevirtual

Differentiate this polynomial k times, with respect to a particular variable, setting itself to its derivative.

Parameters
varthe variable to derive with respect to.
kthe number of times to differentiate.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ differentiate() [2/2]

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::differentiate ( const Symbol var)
inlinevirtual

Differentiate this polynomial, with respect to a particular variable, setting itself to its derivative.

Parameters
varthe variable to derive with respect to.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ evaluate() [1/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::evaluate ( const std::vector< Symbol > &  vars,
const std::vector< Field > &  elems 
) const
inlinevirtual

Evaluate this polynomial by substituting the input ring elements elems for the variables vars, such that vars[i] = elems[i].

Parameters
varsthe variables to evaluate.
elemsthe ring elements to substitute for the varibales.
Returns
the evaluation of this polynomial for the variables in vars.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ evaluate() [2/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::evaluate ( int  n,
const Symbol vars,
const Field *  elems 
) const
inlinevirtual

Evaluate this polynomial by substituting the input ring elements elems for the variables vars, such that vars[i] = elems[i].

Parameters
nthe size of the vars and elems arrays.
varsthe variables to evaluate.
elemsthe ring elements to substitute for the varibales.
Returns
the evaluation of this polynomial for the variables in vars.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ isConstant()

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

Is a constant.

Parameters

◆ isNegativeOne()

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

Is polynomial -1.

Parameters

◆ isOne()

template<class Field>
bool DistributedDenseMultivariateModularPolynomial< Field >::isOne ( ) const
inline

Is polynomial 1.

Parameters

◆ isZero()

template<class Field>
bool DistributedDenseMultivariateModularPolynomial< Field >::isZero ( ) const
inline

Is a zero polynomial.

Parameters

◆ leadingCoefficient()

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

Get the leading coefficient.

Parameters

◆ negate()

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

Negate, f(-x)

Parameters

◆ negativeOne()

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

Set polynomial to -1.

Parameters

◆ numberOfTerms()

template<class Field>
Integer DistributedDenseMultivariateModularPolynomial< Field >::numberOfTerms ( ) const
inline

Get the number of non-zero terms.

Parameters

◆ numberOfVariables()

template<class Field>
int DistributedDenseMultivariateModularPolynomial< Field >::numberOfVariables ( ) const
inlinevirtual

◆ one()

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::one ( )
inline

Set polynomial to 1.

Parameters

◆ operator!=()

template<class Field>
bool DistributedDenseMultivariateModularPolynomial< Field >::operator!= ( const DistributedDenseMultivariateModularPolynomial< Field > &  b) const
inline

Overload operator !=.

Parameters
bA multivariate modular polynomial

◆ operator*() [1/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::operator* ( const DistributedDenseMultivariateModularPolynomial< Field > &  b) const
inline

Overload operator *.

Parameters
bA multivariate modular polynomial

◆ operator*() [2/2]

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

Overload operator *.

Parameters
eA constant

◆ operator*=() [1/2]

Overload operator *=.

Parameters
bA multivariate modular polynomial

◆ operator*=() [2/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field>& DistributedDenseMultivariateModularPolynomial< Field >::operator*= ( const Field &  f)
inline

Overload operator *=.

Parameters
eA constant

◆ operator+() [1/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::operator+ ( const DistributedDenseMultivariateModularPolynomial< Field > &  b) const
inline

Overload operator +.

Parameters
bA multivariate modular polynomial

◆ operator+() [2/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::operator+ ( const Field &  e) const
inline

Overload operator +.

Parameters
eA constant

◆ operator+=() [1/2]

Overload operator +=.

Parameters
bA multivariate modular polynomial

◆ operator+=() [2/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field>& DistributedDenseMultivariateModularPolynomial< Field >::operator+= ( const Field &  e)
inline

Overload operator +=.

Parameters
eA constant

◆ operator-() [1/3]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::operator- ( const DistributedDenseMultivariateModularPolynomial< Field > &  b) const
inline

Overload operator -.

Parameters
bA multivariate modular polynomial

◆ operator-() [2/3]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::operator- ( ) const
inline

Overload operator -, negate.

Parameters

◆ operator-() [3/3]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field> DistributedDenseMultivariateModularPolynomial< Field >::operator- ( const Field &  e) const
inline

Overload operator -.

Parameters
eA constant

◆ operator-=() [1/2]

Overload operator -=.

Parameters
bA multivariate modular polynomial

◆ operator-=() [2/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field>& DistributedDenseMultivariateModularPolynomial< Field >::operator-= ( const Field &  e)
inline

Overload operator -=.

Parameters
eA constant

◆ operator=() [1/2]

Overload operator =.

Parameters
bA multivariate modular polynomial

◆ operator=() [2/2]

template<class Field>
DistributedDenseMultivariateModularPolynomial<Field>& DistributedDenseMultivariateModularPolynomial< Field >::operator= ( const Field &  f)
inline

Overload operator =.

Assign this to a be a base Field element.

◆ operator==()

template<class Field>
bool DistributedDenseMultivariateModularPolynomial< Field >::operator== ( const DistributedDenseMultivariateModularPolynomial< Field > &  b) const
inline

Overload operator ==.

Parameters
bA multivariate modular polynomial

◆ print()

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::print ( std::ostream &  out) const
inline

Overload stream operator <<.

Parameters
outStream object
bThe multivariate modular polynomial

◆ ringVariables()

template<class Field>
std::vector<Symbol> DistributedDenseMultivariateModularPolynomial< Field >::ringVariables ( ) const
inlinevirtual

◆ setCoefficient() [1/3]

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::setCoefficient ( int  v,
const int *  d,
const Field &  val 
)
inlinevirtual

Set a coefficient.

Parameters
vNumber of variables
dThe exponent of each variable
valValue of the coefficient

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ setCoefficient() [2/3]

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::setCoefficient ( const std::vector< int > &  v,
const Field &  r 
)
inlinevirtual

Set the coefficient of this polynomial for the monomial defined by exponent vector exps to r.

The exponent vector should be defined over all variables in the polynomial ring.

Parameters
expsthe exponent vector
rthe ring element to set as coefficient.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ setCoefficient() [3/3]

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::setCoefficient ( int  k,
const Field &  val 
)
inline

Set a coefficient.

Parameters
kThe offset in the coefficient array
valValue of the coefficient

◆ setRingVariables()

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::setRingVariables ( const std::vector< Symbol > &  xs)
inlinevirtual

Set variable names.

Parameters
xsVariable names

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ size()

template<class Field>
int DistributedDenseMultivariateModularPolynomial< Field >::size ( ) const
inline

Get the size of the polynomial.

Parameters

◆ variables()

template<class Field>
std::vector<Symbol> DistributedDenseMultivariateModularPolynomial< Field >::variables ( ) const
inlinevirtual

Get all the variables in this polynomial with positive degree.

Returns
a vector of all the variables in this polynomial with positive degree.

Implements BPASMultivariatePolynomial< Field, DistributedDenseMultivariateModularPolynomial< Field > >.

◆ zero()

template<class Field>
void DistributedDenseMultivariateModularPolynomial< Field >::zero ( )
inline

Zero polynomial.

Parameters

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