PolyRing is an abstract class representing rings of polynomials. The polynomials may be (dense) univariate or (sparse) multivariate. Only a few operations are available at this level of abstraction. Use SparsePolyRing or DUPolyRing for more operations on polynomials of known representation.
Currently there are several functions to create polynomial rings:
see SparsePolyRing
for the sparse implementation
and DenseUPolyRing
for the dense implementation (only for
univariate polynomials).
- CoeffRing
is the ring of coefficients (must be commutative),
- NumIndets
specifies how many indeterminates there are; by default
the indet names will be x[0],..x[NumIndets-1], and the ordering is
StdDegRevLex
-- see PPOrdering
.
Let P
be an object of type PolyRing
.
Let R
be an object of type ring
.
NumIndets(P)
-- the number of indeterminates in P
CoeffRing(P)
-- the ring of coefficients of P
IsPolyRing(R)
-- returns true if the CoCoA::ring R is indeed a PolyRing
AsPolyRing(R)
-- returns a PolyRing refering to the ring underlying R
indets(P)
-- a const std::vector of RingElem
s whose i-th
element is the i-th indeterminate in P
IndetsCalled(str, P)
-- a std::vector of RingElem
s with all
indeterminates in P whose head is the string str
indet(P,i)
-- the i-th indet of P as a RingElem
IndetPower(P,i,n)
-- the n-th power of the i-th indet of P as a RingElem
CoeffEmbeddingHom(P)
-- the homomorphism which embeds CoeffRing(P) into P
IsPolyRing(R)
-- returns true if R is indeed a PolyRing
.
AsPolyRing(R)
-- returns a PolyRing
refering to the ring underlying R.
See documentation for RingElem
.
Let P
be an object of type PolyRing
.
Let R
be an object of type ring
.
CoeffEmbeddingHom(P)
PolyRingHom(P, R, CoeffHom, IndetImages)
CoeffHom
, and
maps the k-th indet into IndetImages[k]
EvalHom(P, IndetImages)
IndetImages[k]
PolyAlgebraHom(P, R, IndetImages)
IndetImages[k]
The hard part has been deciding which member functions should be in
PolyRingBase
and which should be in less abstract classes. If you
want to modify the code here, you should probably also look at
SparsePolyRing and DUPolyRing... before messing with the code!
The implementations in PolyRing.C are all very simple: they just conduct some sanity checks on the function arguments before passing them to the PolyRing member function which will actually do the work.
What precisely should the fancy version of deriv do? What are permitted values for the second arg? Must coeff=1? What if the second arg does not have precisely one term?
The range of member functions on RawValues is rather a hotch-potch. Hopefully, experience and use of the code will bring some better order to the chaos.
Verify the true need for myRemoveBigContent, myMulByCoeff, myDivByCoeff. If the coeff ring has zero divisors then myMulByCoeff could change the structure of the poly!
Maintainer doc is largely absent.