|
Macaulay2 Engine
|
M2::ARingCC — machine-precision complex numbers (pair of doubles). More...
#include "interface/gmp-util.h"#include "interface/random.h"#include "aring.hpp"#include "buffer.hpp"#include "ringelem.hpp"#include "ringmap.hpp"#include "aring-RR.hpp"Go to the source code of this file.
Classes | |
| class | M2::ARingCC |
| aring-style adapter for double-precision complex numbers, stored as (double, double) pairs. More... | |
Namespaces | |
| namespace | M2 |
M2::ARingCC — machine-precision complex numbers (pair of doubles).
ARingCC is the complex sibling of ARingRR in the aring family: a SimpleARing<ARingCC> specialisation whose element type is cc_doubles_struct (a (re, im) pair of doubles). Hot-path arithmetic — add, subtract, mult, divide, invert — runs as hardware floating-point on the real and imaginary parts; the only MPFR appearance is the mpfr_get_d down-conversion in the set_from_BigReal / set_from_BigComplex bridges. random applies randomDouble() from interface/random.h componentwise. The class also carries an ARingRR mRR and exposes it through real_ring() so callers can drop down to a real ring of matching precision.
On top of the real-ring API it adds abs and the cheaper abs_squared (both produce an ARingRR::ElementType result) plus the set_from_doubles(result, re, im) element-builder. There is no conjugate, real, or imag method on ARingCC itself — those operations are handled by direct access to the .re / .im fields of cc_doubles_struct. The arbitrary-precision siblings live in aring-CCC.hpp (MPFR-backed) and aring-CCi.hpp (MPFI Cartesian-rectangle intervals); 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.
Definition in file aring-CC.hpp.