Basic Polynomial Algebra Subprograms (BPAS)  v. 1.548
Public Member Functions | Static Public Attributes | Friends | List of all members
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial Class Reference

A multivariate polynomial with coefficients in a small prime field using a dense representation. More...

#include <sdmpolynomial.h>

Simplified semantic inheritance diagram for SmallPrimeFieldDistributedDenseMultivariateModularPolynomial:
- Full inheritance diagram for SmallPrimeFieldDistributedDenseMultivariateModularPolynomial:
[legend]

Public Member Functions

 SmallPrimeFieldDistributedDenseMultivariateModularPolynomial ()
 Constructor using a default prime.
 
 SmallPrimeFieldDistributedDenseMultivariateModularPolynomial (sfixn m)
 Constructor with the field. More...
 
 SmallPrimeFieldDistributedDenseMultivariateModularPolynomial (int v, int *ds, sfixn m)
 Constructor with number of variables and terms. More...
 
 SmallPrimeFieldDistributedDenseMultivariateModularPolynomial (Symbol x, sfixn m)
 Construct with a variable name such that f(x) = x;. More...
 
 SmallPrimeFieldDistributedDenseMultivariateModularPolynomial (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b)
 Copy constructor. More...
 
 ~SmallPrimeFieldDistributedDenseMultivariateModularPolynomial ()
 Deconstructor. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator= (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b)
 Overload operator =. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator= (const sfixn &b)
 
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...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial unitCanonical (SmallPrimeFieldDistributedDenseMultivariateModularPolynomial *u=NULL, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial *v=NULL) const
 Obtain the unit normal (a.k.a canonical associate) of an element. 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
 Total degree.
 
Integer degree (const Symbol &x) const
 Get a partial degree of variable x. More...
 
sfixn leadingCoefficient () const
 Get the leading coefficient. More...
 
sfixn trailingCoefficient () const
 
bool isConstantTermZero () const
 
sfixn coefficient (int v, const int *d) const
 Get a coefficient. More...
 
sfixn coefficient (const std::vector< int > &v) const
 
void setCoefficient (int v, const int *d, const sfixn &val)
 Set a coefficient. More...
 
void setCoefficient (const std::vector< int > &v, const sfixn &val)
 
void setCoefficient (int k, const sfixn &val)
 Set a coefficient. More...
 
std::vector< SymbolringVariables () const
 Get variable names. More...
 
void setRingVariables (const std::vector< Symbol > &xs)
 Set variable names. More...
 
std::vector< Symbolvariables () const
 
void differentiate (const Symbol &s, int k)
 Convert current object to its k-th derivative. More...
 
void differentiate (const Symbol &s)
 Convert current object to its derivative. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial derivative (const Symbol &s, int k) const
 Return k-th derivative. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial derivative (const Symbol &s) const
 Compute derivative. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial evaluate (int, const Symbol *syms, const sfixn *xs) const
 Evaluate f(x) More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial evaluate (const std::vector< Symbol > &syms, const std::vector< sfixn > &xs) const
 Evaluate f(x) More...
 
bool operator== (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b) const
 Overload operator ==. More...
 
bool operator!= (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b) const
 Overload operator !=. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator+ (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b) const
 Overload operator +. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator+= (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b)
 Overload operator +=. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator+ (const sfixn &e) const
 Overload operator +. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator+= (const sfixn &e)
 Overload operator +=. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator- (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b) const
 Overload operator -. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator-= (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b)
 Overload operator -=. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator- (const sfixn &e) const
 Overload operator -. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator-= (const sfixn &e)
 Overload operator -=. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator- () const
 Overload operator -, negate. More...
 
void negate ()
 Negate, f(-x) More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator* (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b) const
 Overload operator *. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator*= (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &b)
 Overload operator *=. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator* (const sfixn &e) const
 Overload operator *. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator*= (const sfixn &e)
 Overload operator *=. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator^ (long long int e) const
 Overload operator ^ for exponentiation.
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator^= (long long int e)
 Overload operator ^ for exponentiation.
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator/ (const sfixn &e) const
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator/= (const sfixn &e)
 
sfixn content () const
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial primitivePart () const
 
void print (std::ostream &out) const
 Print the Ring element. More...
 
ExpressionTree convertToExpressionTree () const
 Convert *this to an expression tree. More...
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator/ (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &p) const
 Exact division.
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomialoperator/= (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &p)
 Exact division assignment.
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial gcd (const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &p) const
 Get GCD of *this and other.
 
Factors< SmallPrimeFieldDistributedDenseMultivariateModularPolynomialsquareFree () const
 Compute squarefree factorization of *this.
 

Static Public Attributes

static mpz_class characteristic
 
static RingProperties properties
 

Friends

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator+ (const sfixn &e, const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &f)
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator- (const sfixn &e, const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &r)
 
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial operator* (const sfixn &e, const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial &f)
 

Detailed Description

A multivariate polynomial with coefficients in a small prime field using a dense representation.

Constructor & Destructor Documentation

◆ SmallPrimeFieldDistributedDenseMultivariateModularPolynomial() [1/4]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::SmallPrimeFieldDistributedDenseMultivariateModularPolynomial ( sfixn  m)
inline

Constructor with the field.

Parameters
mThe prime

◆ SmallPrimeFieldDistributedDenseMultivariateModularPolynomial() [2/4]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::SmallPrimeFieldDistributedDenseMultivariateModularPolynomial ( int  v,
int *  ds,
sfixn  m 
)
inline

Constructor with number of variables and terms.

Parameters
vNumber of variables
dsPartial degrees
mThe prime

◆ SmallPrimeFieldDistributedDenseMultivariateModularPolynomial() [3/4]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::SmallPrimeFieldDistributedDenseMultivariateModularPolynomial ( Symbol  x,
sfixn  m 
)
inline

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

Parameters
xThe variable name
mThe prime

◆ SmallPrimeFieldDistributedDenseMultivariateModularPolynomial() [4/4]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::SmallPrimeFieldDistributedDenseMultivariateModularPolynomial ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b)
inline

Copy constructor.

Parameters
bA multivariate modular polynomial

◆ ~SmallPrimeFieldDistributedDenseMultivariateModularPolynomial()

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::~SmallPrimeFieldDistributedDenseMultivariateModularPolynomial ( )
inline

Deconstructor.

Parameters

Member Function Documentation

◆ coefficient()

sfixn SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::coefficient ( int  v,
const int *  d 
) const
inlinevirtual

Get a coefficient.

Parameters
vNumber of variables
dThe exponent of each variable

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ convertToExpressionTree()

ExpressionTree SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::convertToExpressionTree ( ) const
virtual

Convert *this to an expression tree.

Implements ExpressionTreeConvert.

◆ degree()

Integer SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::degree ( const Symbol x) const
inlinevirtual

Get a partial degree of variable x.

Parameters
xThe variable name

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ derivative() [1/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::derivative ( const Symbol s,
int  k 
) const
inlinevirtual

Return k-th derivative.

Parameters
sSymbol to differentiate with respect to
kOrder of the k-th derivative, k > 0

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ derivative() [2/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::derivative ( const Symbol s) const
inlinevirtual

Compute derivative.

Parameters
sSymbol to differentiate with respect to

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ differentiate() [1/2]

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::differentiate ( const Symbol s,
int  k 
)
inlinevirtual

Convert current object to its k-th derivative.

Parameters
sSymbol to differentiate with respect to
kOrder of the derivative, k > 0

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ differentiate() [2/2]

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::differentiate ( const Symbol s)
inlinevirtual

Convert current object to its derivative.

Parameters
sSymbol to differentiate with respect to

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ evaluate() [1/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::evaluate ( int  ,
const Symbol syms,
const sfixn *  xs 
) const
inlinevirtual

Evaluate f(x)

Parameters
symsArray of Symbols to evaluate at corresponding xs
xsEvaluation points

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ evaluate() [2/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::evaluate ( const std::vector< Symbol > &  syms,
const std::vector< sfixn > &  xs 
) const
inlinevirtual

Evaluate f(x)

Parameters
symsVector of Symbols to evaluate at corresponding xs
xsCorresponding evaluation points

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ isConstant()

int SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::isConstant ( ) const
inline

Is a constant.

Parameters

◆ isNegativeOne()

bool SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::isNegativeOne ( ) const
inline

Is polynomial -1.

Parameters

◆ isOne()

bool SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::isOne ( ) const
inlinevirtual

◆ isZero()

bool SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::isZero ( ) const
inlinevirtual

◆ leadingCoefficient()

sfixn SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::leadingCoefficient ( ) const
inline

Get the leading coefficient.

Parameters

◆ negate()

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::negate ( )

Negate, f(-x)

Parameters

◆ negativeOne()

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::negativeOne ( )
inline

Set polynomial to -1.

Parameters

◆ numberOfTerms()

Integer SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::numberOfTerms ( ) const
inline

Get the number of non-zero terms.

Parameters

◆ numberOfVariables()

int SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::numberOfVariables ( ) const
inlinevirtual

◆ one()

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::one ( )
inlinevirtual

◆ operator!=()

bool SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator!= ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b) const
inlinevirtual

Overload operator !=.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator*() [1/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator* ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b) const
virtual

Overload operator *.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator*() [2/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator* ( const sfixn &  e) const
inline

Overload operator *.

Parameters
eA constant

◆ operator*=() [1/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial& SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator*= ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b)
inlinevirtual

Overload operator *=.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator*=() [2/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial& SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator*= ( const sfixn &  e)

Overload operator *=.

Parameters
eA constant

◆ operator+() [1/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator+ ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b) const
virtual

Overload operator +.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator+() [2/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator+ ( const sfixn &  e) const
inline

Overload operator +.

Parameters
eA constant

◆ operator+=() [1/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial& SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator+= ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b)
inlinevirtual

Overload operator +=.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator+=() [2/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial& SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator+= ( const sfixn &  e)

Overload operator +=.

Parameters
eA constant

◆ operator-() [1/3]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator- ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b) const
virtual

Overload operator -.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator-() [2/3]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator- ( const sfixn &  e) const
inline

Overload operator -.

Parameters
eA constant

◆ operator-() [3/3]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator- ( ) const
virtual

Overload operator -, negate.

Parameters

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator-=() [1/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial& SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator-= ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b)
inlinevirtual

Overload operator -=.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator-=() [2/2]

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial& SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator-= ( const sfixn &  e)

Overload operator -=.

Parameters
eA constant

◆ operator=()

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial& SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator= ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b)
inlinevirtual

Overload operator =.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ operator==()

bool SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::operator== ( const SmallPrimeFieldDistributedDenseMultivariateModularPolynomial b) const
virtual

Overload operator ==.

Parameters
bA multivariate modular polynomial

Implements BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ print()

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::print ( std::ostream &  ostream) const
virtual

Print the Ring element.

Derived classes may override this to get custom printing that may be more expressive (and prettier) than expression tree printing.

Reimplemented from BPASRing< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ ringVariables()

std::vector<Symbol> SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::ringVariables ( ) const
inlinevirtual

◆ setCoefficient() [1/2]

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::setCoefficient ( int  v,
const int *  d,
const sfixn &  val 
)
inlinevirtual

Set a coefficient.

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

Implements BPASMultivariatePolynomial< sfixn, SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ setCoefficient() [2/2]

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::setCoefficient ( int  k,
const sfixn &  val 
)
inline

Set a coefficient.

Parameters
kThe offset in the coefficient array
valValue of the coefficient

◆ setRingVariables()

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::setRingVariables ( const std::vector< Symbol > &  xs)
inlinevirtual

◆ size()

int SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::size ( ) const
inline

Get the size of the polynomial.

Parameters

◆ unitCanonical()

SmallPrimeFieldDistributedDenseMultivariateModularPolynomial SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::unitCanonical ( SmallPrimeFieldDistributedDenseMultivariateModularPolynomial u = NULL,
SmallPrimeFieldDistributedDenseMultivariateModularPolynomial v = NULL 
) 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< SmallPrimeFieldDistributedDenseMultivariateModularPolynomial >.

◆ zero()

void SmallPrimeFieldDistributedDenseMultivariateModularPolynomial::zero ( )
inlinevirtual

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