Macaulay2 Engine
Loading...
Searching...
No Matches
ringelem.hpp File Reference

ring_elem — the universal value type carried by every Ring* in the engine. More...

#include "M2/math-include.h"
#include "monoid.hpp"
#include "newdelete.hpp"

Go to the source code of this file.

Classes

struct  cc_struct
struct  cc_doubles_struct
struct  cci_struct
union  ring_elem
struct  Nterm
 Singly linked-list node carrying one term of a polynomial-ring element. More...
struct  vec
struct  TermIterator< T >

Macros

#define MPQ_VAL(f)
#define BIGCC_IM(f)
#define BIGCC_RE(f)
#define TOWER_VAL(f)
#define TOWER_RINGELEM(a)

Typedefs

using ZZ = mpz_srcptr
using ZZmutable = mpz_ptr
using QQ = mpq_srcptr
using QQmutable = mpq_ptr
using RRRelement = mpfr_srcptr
using RRRmutable = mpfr_ptr
using RRielement = mpfi_srcptr
using RRimutable = mpfi_ptr
using cc_ptr = cc_struct *
using cc_srcptr = cc_struct const *
using cc_doubles_srcptr = cc_doubles_struct const *
using cc_doubles_ptr = cc_doubles_struct *
using cci_ptr = cci_struct *
using cci_srcptr = cci_struct const *
typedef Ntermtpoly

Functions

TermIterator< Ntermbegin (Nterm *ptr)
TermIterator< Ntermend (Nterm *)
TermIterator< vectermbegin (vecterm *ptr)
TermIterator< vectermend (vecterm *)

Detailed Description

ring_elem — the universal value type carried by every Ring* in the engine.

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

Declares the ring_elem union plus the GMP/MPFR/MPFI const and mutable pointer aliases (ZZ, ZZmutable, QQ, QQmutable, RRRelement, RRRmutable, RRielement, RRimutable) and the inline cc_struct (MPFR pair), cc_doubles_struct (double pair), and cci_struct (MPFI pair) complex-number record types. The aliases exist so engine function signatures can make const-ness explicit (void foo(ZZ a, ZZmutable result) reads more clearly than its mpz_srcptr / mpz_ptr expansion) and so a single search-and-replace can flip the underlying GMP / MPFR / MPFI type if that surface ever changes.

ring_elem is the value the Ring-virtual API trafficks in everywhere; each Ring subclass knows how to interpret the union. The fields available are int_val / long_val / double_val (primitives), mpz_val / mpq_val / mpfr_val / mpfi_val (arbitrary-precision pointers), cc_doubles_val / cc_val / cci_val (complex variants), poly_val (Nterm* for PolyRing lists), mPolyVal (opaque void* for non-commutative polynomials), schur_poly_val, and local_val. Constructors and get_* accessors pair up so each ring writes its values in and reads them back out through the matching tag.

See also
ring.hpp
relem.hpp

Definition in file ringelem.hpp.