DenseUPolyRing
is an abstract class representing rings of polynomials;
in particular, rings of dense univariate polynomials.
Currently there are these functions to create a polynomial ring:
NewPolyRing_DUP(CoeffRing); ///< default indet name is x NewPolyRing_DUP(CoeffRing, IndetName); NewPolyRing_DUP(CoeffRing, IndetName, MinCapacity);
A polynomial is viewed abstractly as a vector of coefficients (belonging to the coefficient ring). Indices are std::size_t. All meaninful coefficients are in the positions 0 to deg. Between deg+1 and size-1 the coefficients are guaranteed to be valid and valued 0.
Zero polynomial is represented with myDegPlus1 = 0
.
We list here the operations available for an object of type DenseUPolyRing
;
you should also consult the documentation in PolyRing
for operations on
more general sorts of polynomial ring.
Let P be an object of type DenseUPolyRing
. Let R be an object of type ring
.
NumIndets(P) | the number of indeterminates in P |
CoeffRing(P) | the ring of coefficients of P |
IsDenseUPolyRing(R) | returns true if the ring R is indeed a DenseUPolyRing |
AsDenseUPolyRing(R) | returns a DenseUPolyRing refering to the ring underlying R |
indets(P) | a const std::vector<RingElems> whose i-th |
element is the i-th indeterminate in P |
|
indet(P,i) | the i -th indet of P as a RingElem |
IndetPower(P,i,n) | the n -th power of indet of P as a RingElem (i=0) |
The constructor of a DenseUPolyRing
also should allow to specify the minimum
capacity for the coefficient vector (in order to minimize
reallocations)
In addition to the standard ring
and PolyRing
operations, elements of a
DenseUPolyRing
may used in other functions.
Let P denote a DenseUPolyRing
.
Let f denote a non-const element of P.
Let f1, f2 denote const elements of P.
owner(f1) |
the owner of f1 as a ring |
to get the owner as a DenseUPolyRing use AsDenseUPolyRing(owner(f1)) |
|
NumTerms(f1) |
the number of terms in f1 |
monomial(P,c,returns) |
c *x^d as an element of P (c in CoeffRing(P ), d integer) |
coeff(f1, i) |
the i -th coefficient of f1 (as a ConstRingElem, read-only) |
!!Use this function with great care: no checks on size and degree
myAssignCoeff(f,c,d) |
assigns the d -th coefficient in f to c |
myAssignZeroCoeff(f,d) |
|
myAssignNonZeroCoeff(f,c,d) |