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

M2::ARingRRi — certified real intervals [a, b] with MPFR endpoints, MPFI arithmetic. More...

#include <iostream>
#include <mpfi.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::ARingRRi
 aring-style adapter for arbitrary-precision real intervals, backed by MPFI. More...

Namespaces

namespace  M2

Detailed Description

M2::ARingRRi — certified real intervals [a, b] with MPFR endpoints, MPFI arithmetic.

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

ARingRRi represents a real value as a closed interval [a, b] whose endpoints are MPFR floats and whose enclosure is guaranteed to contain the mathematical result. The class is a SimpleARing<ARingRRi> whose element type is __mpfi_struct; the only stored state on the class is mPrecision, the per-endpoint mantissa bit width. Arithmetic routes through MPFI (mpfi_add, mpfi_sub, mpfi_mul, mpfi_div, mpfi_abs, mpfi_mul_si, ...), so outward rounding is handled automatically: [a,b] + [c,d] -> [a+c, b+d] widened to the next representable bounds, and analogous sign-cased formulas for multiplication and division.

Distinct precisions form distinct rings. The class pulls in aring-RRR.hpp so its interop helpers can exchange data with MPFR-precision reals: is_member, midpoint, diameter, left, and right accept or produce ARingRRR::ElementType values. The M2-side factory IM2_Ring_RRi(prec) in interface/ring.cpp always returns ConcreteRing<ARingRRi>(prec) — there is no hardware-precision shortcut for the interval variant. The complex counterpart is ARingCCi.

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

Definition in file aring-RRi.hpp.