Macaulay2 Engine
Loading...
Searching...
No Matches
ringelement.h File Reference

Engine-boundary C API for constructing, querying, and operating on RingElement values. More...

Go to the source code of this file.

Functions

unsigned int rawRingElementHash (const RingElement *a)
const RingIM2_RingElement_ring (const RingElement *a)
M2_string IM2_RingElement_to_string (const RingElement *f)
const RingElementIM2_RingElement_from_Integer (const Ring *R, gmp_ZZ d)
const RingElementIM2_RingElement_from_rational (const Ring *R, mpq_srcptr r)
const RingElementIM2_RingElement_from_BigComplex (const Ring *R, gmp_CC z)
const RingElementIM2_RingElement_from_BigReal (const Ring *R, gmp_RR z)
const RingElementIM2_RingElement_from_Interval (const Ring *R, gmp_RRi z)
const RingElementIM2_RingElement_from_ComplexInterval (const Ring *R, gmp_CCi z)
gmp_ZZorNull IM2_RingElement_to_Integer (const RingElement *a)
gmp_QQorNull IM2_RingElement_to_rational (const RingElement *a)
gmp_RRorNull IM2_RingElement_to_BigReal (const RingElement *a)
gmp_CCorNull IM2_RingElement_to_BigComplex (const RingElement *a)
gmp_RRiorNull IM2_RingElement_to_Interval (const RingElement *a)
gmp_CCiorNull IM2_RingElement_to_ComplexInterval (const RingElement *a)
long rawDiscreteLog (const RingElement *h)
const RingElementrawMultiplicativeGenerator (const Ring *R)
const RingElementIM2_RingElement_make_var (const Ring *R, int v)
M2_bool IM2_RingElement_is_zero (const RingElement *a)
M2_bool IM2_RingElement_is_equal (const RingElement *a, const RingElement *b)
engine_RawRingElementPair IM2_RingElement_divmod (const RingElement *a, const RingElement *b)
int rawRingElementCompare (const RingElement *a, const RingElement *b)
const RingElementIM2_RingElement_promote (const Ring *S, const RingElement *f)
const RingElementIM2_RingElement_lift (int *success_return, const Ring *S, const RingElement *f)
M2_bool IM2_RingElement_is_graded (const RingElement *a)
M2_arrayint IM2_RingElement_multidegree (const RingElement *a)
const RingElementrawRingElementAntipode (const RingElement *f)
gmp_ZZpairOrNull rawWeightRange (M2_arrayint wts, const RingElement *a)
const RingElementIM2_RingElement_homogenize_to_degree (const RingElement *a, int v, int deg, M2_arrayint wts)
const RingElementIM2_RingElement_homogenize (const RingElement *a, int v, M2_arrayint wts)
const RingElementIM2_RingElement_term (const Ring *R, const RingElement *a, const EngineMonomial *m)
const RingElementIM2_RingElement_get_terms (int nvars, const RingElement *a, int lo, int hi)
const RingElementIM2_RingElement_get_coeff (const Ring *coeffRing, const RingElement *a, const EngineMonomial *m)
const RingElementIM2_RingElement_lead_coeff (const Ring *coeffRing, const RingElement *a)
const EngineMonomialIM2_RingElement_lead_monomial (int nvars, const RingElement *a)
int IM2_RingElement_n_terms (int nvars, const RingElement *a)
engine_RawArrayPairOrNull IM2_RingElement_list_form (const Ring *coeffRing, const RingElement *f)
engine_RawRingElementArray rawGetParts (const M2_arrayint wts, const RingElement *f)
engine_RawRingElementArrayOrNull rawConvolve (engine_RawRingElementArray H, int convolve_type)
const RingElementrawGetPart (const M2_arrayint wts, const RingElement *f, M2_bool lobound_given, M2_bool hibound_given, long lobound, long hibound)
int IM2_RingElement_index_if_var (const RingElement *f)
M2_arrayint rawRingElementIndices (const RingElement *f)
const RingElementrawAssociateDivisor (const RingElement *f)
const RingElementrawRingElementContent (const RingElement *f)
const RingElementrawRingElementRemoveContent (const RingElement *f)
const RingElementrawRingElementSplitContent (const RingElement *f, const RingElement **result)
const RingElementIM2_RingElement_numerator (const RingElement *a)
const RingElementIM2_RingElement_denominator (const RingElement *a)
const RingElementIM2_RingElement_fraction (const Ring *R, const RingElement *a, const RingElement *b)
gmp_ZZorNull rawSchurDimension (const RingElement *f)
const RingElementrawSchurSnTensorMult (const RingElement *a, const RingElement *b)
const RingElementrawSchurFromPartition (const Ring *R, M2_arrayint part)
int rawDegree (int v, const RingElement *f)
int rawExtensionDegree (int firstvar, const Ring *R1)
const RingElementrawDiff (int v, const RingElement *f)
const RingElementrawLowerP (const RingElement *f)
const RingElementrawPowerMod (const RingElement *f, mpz_srcptr n, const RingElement *g)
const MatrixrawHomogenizeMatrix (const Matrix *a, const Matrix *b, const Matrix *c)
const RingElementrawTowerTranslatePoly (const Ring *newRing, const RingElement *F)

Detailed Description

Engine-boundary C API for constructing, querying, and operating on RingElement values.

Note
AI-generated documentation. Verify against the source before relying on it.

Declares the extern "C" entry points that cover the full life cycle of a RingElement. Construction: scalar coercions (IM2_RingElement_from_Integer / _from_rational / _from_BigReal / _from_BigComplex / _from_Interval / _from_ComplexInterval) plus the single-variable factory IM2_RingElement_make_var(R, v) and the (coeff, monomial) term factory IM2_RingElement_term(R, ...) bound as rawTerm. Built-in polymorphic arithmetic operators (+, -, *, /, etc.) are dispatched through the M2 interpreter directly off the element's Ring*; this header carries only the named helpers IM2_RingElement_divmod, rawDiff, rawConvolve, rawHomogenize, rawPowerMod, and rawRingElementAntipode — there is no IM2_RingElement_plus entry. Projection and decomposition: IM2_RingElement_lead_coeff / _lead_monomial / _get_terms / _get_coeff / _n_terms / _list_form (bound as rawLeadCoefficient / rawLeadMonomial / rawGetTerms / rawCoefficient / rawTermCount / rawListForm). Homogeneity / degree introspection: IM2_RingElement_is_graded, IM2_RingElement_multidegree, rawWeightRange, IM2_RingElement_homogenize / _homogenize_to_degree. Coefficient-ring boundary: IM2_RingElement_promote / _lift (rawPromote / rawLift). Fraction-field access: IM2_RingElement_numerator / _denominator / _fraction. Number-theoretic helpers rawDiscreteLog and rawMultiplicativeGenerator live here too (the latter shared with the GF surface in interface/aring.h).

Most entry points read the Ring* off the input and forward through it — RingElement carries no algorithmic logic of its own. The opaque EngineMonomial type passed to IM2_RingElement_get_coeff / _lead_monomial is the single-monomial handle the interpreter uses elsewhere in interface/, so the same vocabulary covers polynomials, monomial ideals, and ring elements.

See also
ringelement.cpp
ring.h
ringmap.h
engine-includes.hpp

Definition in file ringelement.h.