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 two functions to create a polynomial ring:
NewPolyRing(CoeffRing, NumIndets) NewPolyRing(CoeffRing, NumIndets, IndetName)
- 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 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 the i-th indet of P as a RingElem. CoeffEmbeddingHom(P)-- the homomorphism which embeds CoeffRing(P) into P
See documentation for RingElem
.
CoeffEmbeddingHom(P)
PolyRingHom(P, R, CoeffHom, IndetImages)
EvalHom(P, IndetImages)
PolyAlgebraHom(P, R, IndetImages)
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.