Macaulay2 Engine
Loading...
Searching...
No Matches
aring-CCC.hpp File Reference

M2::ARingCCC — arbitrary-precision complex numbers (pair of MPFR floats). More...

#include "interface/gmp-util.h"
#include "interface/random.h"
#include "aring.hpp"
#include "buffer.hpp"
#include "ringelem.hpp"
#include "ringmap.hpp"
#include "aring-RRR.hpp"

Go to the source code of this file.

Classes

class  M2::ARingCCC
 aring-style adapter for arbitrary-precision complex numbers, stored as (MPFR, MPFR) pairs. More...

Namespaces

namespace  M2

Detailed Description

M2::ARingCCC — arbitrary-precision complex numbers (pair of MPFR floats).

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

ARingCCC is the complex counterpart to ARingRRR: a SimpleARing<ARingCCC> whose element type is cc_struct — a pair of MPFR floats with mantissa precision chosen at construction. The class composes an ARingRRR mRRR of the same precision and exposes it through real_ring() for the real-line drop-down. Arithmetic evaluates the standard formulas (a+bi) +/- (c+di), (a+bi)(c+di) = (ac-bd) + (ad+bc)i, 1/(a+bi) = (a-bi)/(a^2+b^2), |a+bi| = sqrt(a^2+b^2) component-wise via mpfr_add / mpfr_sub / mpfr_mul / mpfr_div / mpfr_sqrt under round-to-nearest-ties-even.

The header pulls in interface/gmp-util.h for mpfr_reallocate_limbs (moves the mantissa from MPFR's heap onto the GC heap) and moveTo_gmpCC (bundles two MPFRs into the interpreter's GC-managed complex type), plus interface/random.h for randomMpfr. IM2_Ring_CCC(prec) in interface/ring.cpp is the M2-side factory — it returns ConcreteRing<ARingCC> when prec <= 53 and ConcreteRing<ARingCCC>(prec) otherwise. Engine consumers include the DMat<ARingCCC> (LMatrixCCC) dense matrices used by eigen.hpp, the corresponding paths in mat-linalg.hpp and dmat-lu-inplace.hpp, the SLEvaluatorConcrete<ARingCCC> specialisation in the SLP machinery, and PathTracker's ConcreteRing<ARingCCC>* field at the M2-ring boundary.

See also
aring-RRR.hpp
aring-CC.hpp
aring-CCi.hpp
aring.hpp

Definition in file aring-CCC.hpp.