All Classes Functions Friends
Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
SparseMultivariateRationalPolynomial Class Reference
The concrete class SparseMultivariateRationalPolynomial inherits from BPASMultivariatePolynomial and implements a multivariate polynomial ring over the rational numbers with a sparse representation. It overrides all the public member functions of BPASRing, BPASPolynomial and BPASMultivariatePolynomial. One can construct a SparseMultivariateRationalPolynomial object as the zero polynomial with or without specifying the number of variables. One can also construct a SparseMultivariateRationalPolynomial object from a variable (thus a monomial equal to that variable), or from another SparseMultivariateRationalPolynomial object. Other operations include conversion to straight line program representation.
Inheritance diagram for SparseMultivariateRationalPolynomial:
BPASMultivariatePolynomial BPASPolynomial BPASRing

Public Member Functions

 SparseMultivariateRationalPolynomial ()
 
 SparseMultivariateRationalPolynomial (int v)
 
 SparseMultivariateRationalPolynomial (std::string x)
 
 SparseMultivariateRationalPolynomial (const SparseMultivariateRationalPolynomial &b)
 
 SparseMultivariateRationalPolynomial (DenseUnivariateRationalPolynomial &p)
 
 SparseMultivariateRationalPolynomial (SparseUnivariatePolynomial< SparseMultivariateRationalPolynomial > &s)
 
 ~SparseMultivariateRationalPolynomial ()
 
int numberOfVariables ()
 
int numberOfTerms ()
 
int degree (std::string x)
 
std::string leadingVariable ()
 
int leadingVariableDegree ()
 
mpq_class leadingCoefficient ()
 
SparseMultivariateRationalPolynomial leadingCoefficientInVariable (std::string x, int *e=NULL)
 
bool isZero ()
 
void zero ()
 
bool isOne ()
 
void one ()
 
bool isNegativeOne ()
 
void negativeOne ()
 
int isConstant ()
 
SparseMultivariateRationalPolynomialoperator= (SparseMultivariateRationalPolynomial b)
 
bool operator== (SparseMultivariateRationalPolynomial &b)
 
bool operator!= (SparseMultivariateRationalPolynomial &b)
 
SparseMultivariateRationalPolynomial operator^ (int e)
 
SparseMultivariateRationalPolynomialoperator^= (int e)
 
SparseMultivariateRationalPolynomial operator+ (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomialoperator+= (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomial operator+ (mpq_class c)
 
SparseMultivariateRationalPolynomial operator+ (RationalNumber c)
 
SparseMultivariateRationalPolynomialoperator+= (mpq_class c)
 
SparseMultivariateRationalPolynomialoperator+= (RationalNumber c)
 
SparseMultivariateRationalPolynomial operator- (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomialoperator-= (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomial operator- (mpq_class c)
 
SparseMultivariateRationalPolynomial operator- (RationalNumber c)
 
SparseMultivariateRationalPolynomialoperator-= (mpq_class c)
 
SparseMultivariateRationalPolynomialoperator-= (RationalNumber c)
 
SparseMultivariateRationalPolynomial operator- ()
 
SparseMultivariateRationalPolynomial operator* (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomialoperator*= (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomial operator* (sfixn e)
 
SparseMultivariateRationalPolynomial operator* (mpq_class e)
 
SparseMultivariateRationalPolynomial operator* (RationalNumber e)
 
SparseMultivariateRationalPolynomialoperator*= (mpq_class e)
 
SparseMultivariateRationalPolynomialoperator*= (RationalNumber e)
 
SparseMultivariateRationalPolynomialoperator*= (sfixn e)
 
SparseMultivariateRationalPolynomial operator/ (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomialoperator/= (SparseMultivariateRationalPolynomial b)
 
SparseMultivariateRationalPolynomial operator/ (mpq_class e)
 
SparseMultivariateRationalPolynomial operator/ (RationalNumber e)
 
SparseMultivariateRationalPolynomialoperator/= (mpq_class e)
 
SparseMultivariateRationalPolynomialoperator/= (RationalNumber e)
 
void setVariableNames (std::vector< std::string > xs)
 
std::vector< std::string > variables ()
 
mpq_class coefficient (int v, int *d)
 
void setCoefficient (int v, int *d, mpq_class val)
 
void negate ()
 
bool isTrailingCoefficientZero ()
 
SparseUnivariatePolynomial
< SparseMultivariateRationalPolynomial
convertToSUP (std::string x)
 
void straightLineProgram ()
 
void printSLP ()
 
int positiveRealRootIsolation (Intervals *pIs, Intervals &apIs, mpq_class width, int ts=-1, bool s=0, bool check=1)
 
- Public Member Functions inherited from BPASMultivariatePolynomial
DataType leadingCoefficient ()
 
DataType coefficient (int, int *)
 
void setCoefficient (int, int *, 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 &)
 

Public Attributes

std::vector< SLPRepresentationslp
 

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

SparseMultivariateRationalPolynomial operator+ (mpq_class c, SparseMultivariateRationalPolynomial p)
 
SparseMultivariateRationalPolynomial operator- (mpq_class c, SparseMultivariateRationalPolynomial p)
 
SparseMultivariateRationalPolynomial operator* (mpq_class c, SparseMultivariateRationalPolynomial p)
 
SparseMultivariateRationalPolynomial operator* (sfixn c, SparseMultivariateRationalPolynomial p)
 
SparseMultivariateRationalPolynomial operator/ (mpq_class c, SparseMultivariateRationalPolynomial p)
 
std::ostream & operator<< (std::ostream &out, SparseMultivariateRationalPolynomial b)
 

Constructor & Destructor Documentation

SparseMultivariateRationalPolynomial::SparseMultivariateRationalPolynomial ( )
inline

Construct a multivariate polynomial

Parameters
SparseMultivariateRationalPolynomial::SparseMultivariateRationalPolynomial ( int  v)
inline

Construct a multivariate polynomial with number of terms and variates

Parameters
v,:Number of variables
SparseMultivariateRationalPolynomial::SparseMultivariateRationalPolynomial ( std::string  x)
inline

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

Parameters
x,:The variable name
SparseMultivariateRationalPolynomial::SparseMultivariateRationalPolynomial ( const SparseMultivariateRationalPolynomial b)
inline

Copy Constructor

Parameters
b,:A sparse multivariate polynomial
SparseMultivariateRationalPolynomial::SparseMultivariateRationalPolynomial ( SparseUnivariatePolynomial< SparseMultivariateRationalPolynomial > &  s)

Construct from a SUP<SMQP> polynomial

Parameters
s,:The SUP<SMQP> polynomial
SparseMultivariateRationalPolynomial::~SparseMultivariateRationalPolynomial ( )
inline

Destroy the polynomial

Parameters

Member Function Documentation

mpq_class SparseMultivariateRationalPolynomial::coefficient ( int  v,
int *  d 
)

Get the coefficient of one term

Parameters
d,:The exponet of each variable
v,:Number of variables
SparseUnivariatePolynomial<SparseMultivariateRationalPolynomial> SparseMultivariateRationalPolynomial::convertToSUP ( std::string  x)

Convert to SUP<SMQP>

Parameters
x,:The variable name
int SparseMultivariateRationalPolynomial::degree ( std::string  x)
inlinevirtual

Get the degree of a variable

Parameters
x,:The variable name

Implements BPASMultivariatePolynomial.

int SparseMultivariateRationalPolynomial::isConstant ( )
inlinevirtual

Is a constant

Parameters

Implements BPASRing.

bool SparseMultivariateRationalPolynomial::isNegativeOne ( )
inlinevirtual

Is polynomial a constant -1

Parameters

Implements BPASRing.

bool SparseMultivariateRationalPolynomial::isOne ( )
inlinevirtual

Is polynomial a constant 1

Parameters

Implements BPASRing.

bool SparseMultivariateRationalPolynomial::isTrailingCoefficientZero ( )

Has the zero root of the most weighted variate

Parameters
bool SparseMultivariateRationalPolynomial::isZero ( )
inlinevirtual

Is zero polynomial

Parameters

Implements BPASRing.

mpq_class SparseMultivariateRationalPolynomial::leadingCoefficient ( )
inline

Get the leading coefficient

Parameters
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::leadingCoefficientInVariable ( std::string  x,
int *  e = NULL 
)

Get the leading coefficient over a variable

Parameters
x,:The name of the variable
e,:The leading exponent of the variable
std::string SparseMultivariateRationalPolynomial::leadingVariable ( )
inline

Get the leading variable

Parameters
int SparseMultivariateRationalPolynomial::leadingVariableDegree ( )
inline

Get the leading term's leading variable's degree

Parameters
void SparseMultivariateRationalPolynomial::negate ( )

Negate all the coefficients

Parameters
void SparseMultivariateRationalPolynomial::negativeOne ( )
inlinevirtual

Set polynomial to -1

Parameters

Implements BPASRing.

int SparseMultivariateRationalPolynomial::numberOfTerms ( )
inlinevirtual

Get number of non-zero terms

Parameters

Implements BPASMultivariatePolynomial.

int SparseMultivariateRationalPolynomial::numberOfVariables ( )
inlinevirtual

Get number of variables

Parameters

Implements BPASMultivariatePolynomial.

void SparseMultivariateRationalPolynomial::one ( )
inlinevirtual

Set polynomial to 1

Parameters

Implements BPASRing.

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

Overload operator !=

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator* ( SparseMultivariateRationalPolynomial  b)

Overload operator *

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator* ( sfixn  e)
inline

Overload operator *

Parameters
e,:A constant
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator*= ( SparseMultivariateRationalPolynomial  b)
inline

Overload operator *=

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator*= ( mpq_class  e)
inline

Overload operator *=

Parameters
e,:A constant
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator*= ( sfixn  e)
inline

Overload operator *=

Parameters
e,:A machine-word constant
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator+ ( SparseMultivariateRationalPolynomial  b)

Overload operator +

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator+ ( mpq_class  c)
inline

Overload operator +

Parameters
c,:A constant
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator+= ( SparseMultivariateRationalPolynomial  b)
inline

Overload operator +=

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator+= ( mpq_class  c)
inline

Overload operator +=

Parameters
c,:A constant
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator- ( SparseMultivariateRationalPolynomial  b)

Overload operator -

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator- ( mpq_class  c)
inline

Overload operator -

Parameters
c,:A constant
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator- ( )

Overload operator - (negate)

Parameters
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator-= ( SparseMultivariateRationalPolynomial  b)
inline

Overload operator -=

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator-= ( mpq_class  c)
inline

Overload operator -=

Parameters
c,:A constant
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator/ ( SparseMultivariateRationalPolynomial  b)
inline

Overload operator /

Parameters
b,:A multivariate polynomial
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator/ ( mpq_class  e)
inline

Overload operator /

Parameters
e,:A constant
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator/= ( SparseMultivariateRationalPolynomial  b)

Overload operator /=

Parameters
b,:A multivariate polynomial
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator/= ( mpq_class  e)
inline

Overload operator /=

Parameters
e,:A constant
SparseMultivariateRationalPolynomial& SparseMultivariateRationalPolynomial::operator= ( SparseMultivariateRationalPolynomial  b)
inline

Overload operator =

Parameters
b,:A sparse multivariate polynomial
bool SparseMultivariateRationalPolynomial::operator== ( SparseMultivariateRationalPolynomial b)
inline

Overload operator ==

Parameters
b,:A multivariate rational polynomial
SparseMultivariateRationalPolynomial SparseMultivariateRationalPolynomial::operator^ ( int  e)

Overload operator ^ replace xor operation by exponentiation

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

Overload operator ^= replace xor operation by exponentiation

Parameters
e,:The exponentiation, e > 0
int SparseMultivariateRationalPolynomial::positiveRealRootIsolation ( Intervals pIs,
Intervals apIs,
mpq_class  width,
int  ts = -1,
bool  s = 0,
bool  check = 1 
)

Given one real root for x_1, .., x_{n-1}, isolate positive roots for x_n

Parameters
mpIs,:Roots of x_n (Output)
apIs,:A root of previous polynomials
s,:deal with 0: positive roots; 1: negative roots
check,:1: check the leading or tail coefficient; 0: do not
width,:Interval's right - left < width
ts,:Taylor Shift option

Return 1: Need to refine preious polynomials 0: Found positive real roots

void SparseMultivariateRationalPolynomial::printSLP ( )

Print SLP representation

Parameters
void SparseMultivariateRationalPolynomial::setCoefficient ( int  v,
int *  d,
mpq_class  val 
)

Set the coefficients of one term

Parameters
v,:Number of variables
d,:Its exponent of each variable
val,:Coefficient
void SparseMultivariateRationalPolynomial::setVariableNames ( std::vector< std::string >  xs)
virtual

Set variable names

Parameters
xs,:Variable names

Implements BPASMultivariatePolynomial.

void SparseMultivariateRationalPolynomial::straightLineProgram ( )

SLP's representation of the polynomial

Parameters
std::vector<std::string> SparseMultivariateRationalPolynomial::variables ( )
inlinevirtual

Get variable names

Parameters

Implements BPASMultivariatePolynomial.

void SparseMultivariateRationalPolynomial::zero ( )
inlinevirtual

Zero polynomial

Parameters

Implements BPASRing.

Friends And Related Function Documentation

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

Overload stream operator <<

Parameters
out,:Stream object
b,:A multivariate rational polynoial

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