Macaulay2 Engine
Loading...
Searching...
No Matches
RingElement Class Reference

Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meaning. More...

#include <relem.hpp>

Inheritance diagram for RingElement:
EngineObject our_new_delete

Public Member Functions

 RingElement (const Ring *R, ring_elem f)
ring_elem get_value () const
const Ringget_ring () const
bool is_zero () const
bool is_equal (const RingElement &b) const
bool is_unit () const
RingElementoperator- () const
RingElementoperator+ (const RingElement &b) const
RingElementoperator- (const RingElement &b) const
RingElementoperator* (const RingElement &b) const
RingElementoperator* (int n) const
RingElementpower (mpz_srcptr n) const
RingElementpower (int n) const
RingElementoperator/ (const RingElement &b) const
RingElementinvert () const
void text_out (buffer &o) const
bool promote (const Ring *S, const RingElement *&result) const
bool lift (const Ring *S, const RingElement *&result) const
RingElementlead_term (int n=-1) const
RingElementrest () const
int n_terms (int nvars) const
RingElementget_terms (int nvars, int lo, int hi) const
RingElementget_coeff (const Ring *coeffR, const EngineMonomial *m) const
RingElementlead_coeff (const Ring *coeffR) const
EngineMonomiallead_monom (int nvars) const
bool is_homogeneous () const
RingElementhomogenize (int v, const std::vector< int > &wts) const
RingElementhomogenize (int v, int deg, const std::vector< int > &wts) const
void degree_weights (const std::vector< int > &wts, int &lo, int &hi) const
const_monomial degree () const
bool multi_degree (monomial d) const
const RingElementcontent () const
const RingElementremove_content () const
const RingElementsplit_off_content (const RingElement *&result) const
RingElementnumerator () const
RingElementdenominator () const
RingElementfraction (const Ring *R, const RingElement *bottom) const
bool getSmallIntegerCoefficients (std::vector< long > &result_coeffs) const
M2_arrayintOrNull getSmallIntegerCoefficients () const
Public Member Functions inherited from EngineObject
 EngineObject ()
virtual ~EngineObject ()
unsigned int hash () const

Static Public Member Functions

static RingElementmake_raw (const Ring *R, ring_elem f)
static RingElementrandom (const Ring *R)
Static Public Member Functions inherited from our_new_delete
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void operator delete (void *obj)
static void operator delete[] (void *obj)
static void * operator new (size_t size, void *existing_memory)
static void * operator new[] (size_t size, void *existing_memory)
static void operator delete (void *obj, void *existing_memory)
static void operator delete[] (void *obj, void *existing_memory)

Protected Member Functions

virtual unsigned int computeHashValue () const

Private Attributes

const RingR
ring_elem val

Detailed Description

Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meaning.

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

The interpreter handles ring elements as opaque RingElement* pointers and asks the engine to do arithmetic by dispatching through get_ring(). Inherits from EngineObject so the hash is content-based (computed via the ring's computeHashValue) and the element is immutable once exposed to the front end. make_raw is the standard factory the interface layer uses to wrap a freshly produced ring_elem.

Definition at line 66 of file relem.hpp.


The documentation for this class was generated from the following files: