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

Legacy RingZZ — a Ring-derived integer ring backed by GMP mpz_t. More...

#include "error.h"
#include "ring.hpp"
#include <cstddef>

Go to the source code of this file.

Classes

class  RingZZ
 Engine-side ring of integers, backed by GMP mpz_ptr elements. More...

Namespaces

namespace  M2

Functions

int mask_mpz_cmp_si (mpz_srcptr x, long int i)
int mask_mpq_cmp_si (mpq_srcptr x, long int i, long int j)
unsigned int computeHashValue_mpz (mpz_srcptr a)

Detailed Description

Legacy RingZZ — a Ring-derived integer ring backed by GMP mpz_t.

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

RingZZ is the engine's original integer-ring class, pre-dating the aring framework. It inherits from Ring directly, uses mpz_ptr as its element_type, and is the type of the global globalZZ instance created by PolyRing::make_trivial_ZZ_poly_ring() (per the in-source comment near the constructors). The class also friends M2::ARingZZGMP and carries an ARingZZGMP* coeffR exposed by get_ARing(), so callers on the legacy side can hand the aring view to code that prefers it.

Three integer rings coexist today: RingZZ (this file, GMP) — which is what ring.cpp::makeIntegerRing actually returns as new RingZZ — plus the two aring siblings M2::ARingZZGMP (GMP via the aring framework, aring-zz-gmp.hpp) and M2::ARingZZ (FLINT via the aring framework, aring-zz-flint.hpp). RingZZ itself holds an ARingZZGMP *coeffR (exposed by get_ARing()) and uses it via RingZZ::makeMutableMatrix to build MutableMat<DMat< ARingZZGMP>> / MutableMat<SMat<ARingZZGMP>> for mutable matrices; the FLINT-backed ARingZZ is used directly by the dense linear-algebra path via DMat<ARingZZ> (alias DMatZZ). The two mask_mpz_cmp_si / mask_mpq_cmp_si wrapper functions at the top of the header exist purely to silence GMP's old-style-cast warnings, as the adjacent in-source comment notes.

See also
aring-zz-flint.hpp
aring-zz-gmp.hpp
aring.hpp
aring-glue.hpp

Definition in file ZZ.hpp.