Examples
User documentation for PolyRing
PolyRing is an abstract class (inheriting from ring
) representing
rings of polynomials with coefficients in a commutative ring
R
.
The polynomials may be (dense) univariate or (sparse) multivariate.
See RingElem
PolyRing for operations on its elements, but
only a few operations are available at this level of abstraction:
see RingElem
SparsePolyRing or RingElem
DenseUPolyRing for more
operations on polynomials of SparsePolyRing
or DenseUPolyRing
.
Pseudo-constructors
There are several functions to create polynomial rings: see
SparsePolyRing
constructors for the sparse implementation andDenseUPolyRing
constructors for the dense (univariate) implementation.
PolyRing(R)
-- sort of downcast the ringR
to a poly ring; will throw anErrorInfo
object with codeERR::NotPolyRing
if needed.
Queries and views
Let R
be an object of type ring
.
IsPolyRing(R)
--true
ifR
is actuallyPolyRing
PolyRingPtr(R)
-- pointer to impl ofR
(for calling mem fns); will throw anErrorInfo
object with codeERR::NotPolyRing
if needed
Operations on a PolyRing
In addition to the standard ring
operations, a PolyRing
may be
used in other functions.
Let P
be an object of type PolyRing
.
NumIndets(P)
-- the number of indeterminates inP
CoeffRing(P)
-- the ring of coefficients ofP
indets(P)
-- a const std::vector ofRingElem
s whose i-th element is the i-th indeterminate inP
indets(P, str)
-- a std::vector ofRingElem
s with all indeterminates inP
whose head is the stringstr
indet(P,i)
-- thei
-th indet ofP
as aRingElem
IndetPower(P,i,n)
-- then
-th power of thei
-th indet ofP
as aRingElem
Homomorphisms
Let P
be an object of type PolyRing
.
Let R
be an object of type ring
.
CoeffEmbeddingHom(P)
-
-- the homomorphism which maps
CoeffRing(P)
intoP
PolyRingHom(P, R, CoeffHom, IndetImages)
-
-- the homomorphism from
P
toR
which maps the coeffs usingCoeffHom
, and maps the k-th indet intoIndetImages[k]
EvalHom(P, IndetImages)
-
-- the evaluation homomorphism from
P
toCoeffRing(P)
which is the identity on the coeffs, and maps the kth indet intoIndetImages[k]
PolyAlgebraHom(P, R, IndetImages)
-
-- this is the identity on coeffs, and maps the k-th indet into
IndetImages[k]
Maintainer documentation for PolyRing
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.
Bugs, Shortcomings and other ideas
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.