Macaulay2 Engine
Loading...
Searching...
No Matches
ARingCCCTest.cpp File Reference

gtest coverage for the MPC-backed M2::ARingCCC arbitrary-precision complex aring. More...

#include <cstdio>
#include <string>
#include <iostream>
#include <sstream>
#include <memory>
#include <gtest/gtest.h>
#include <mpfr.h>
#include "aring-RRR.hpp"
#include "aring-CCC.hpp"
#include "ARingTest.hpp"

Go to the source code of this file.

Functions

bool almostEqual (const M2::ARingCCC &C, int nbits, const M2::ARingCCC::ElementType &a, const M2::ARingCCC::ElementType &b)
template<>
void getElement< M2::ARingCCC > (const M2::ARingCCC &C, int index, M2::ARingCCC::ElementType &result)
 TEST (ARingCCC, create)
void testRingNegateCCC (const M2::ARingCCC &C, int ntrials)
 TEST (ARingCCC, negate)
 TEST (ARingCCC, add)
 TEST (ARingCCC, subtract)
 TEST (ARingCCC, multDivide)
 TEST (ARingCCC, axioms)
 TEST (ARingCCC, power_and_invert)

Detailed Description

gtest coverage for the MPC-backed M2::ARingCCC arbitrary-precision complex aring.

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

Plugs M2::ARingCCC into the ARingTest.hpp harness with a precision-aware almostEqual that scales 2^-nbits to the ring's get_precision() and checks the real and imaginary components of a - b against it independently — so the tolerance tracks the configured MPFR / MPC precision rather than being pinned to 53 bits. getElement<M2::ARingCCC> supplies the standard mix of deterministic edge-case prefix elements (zero, one, i, near-overflow exponents) and random complex draws; testSomeMore runs the full arithmetic / equality / inverse / negation battery on top.

Counterpart of ARingCCTest.cpp (the 53-bit complex<double> companion); together with ARingRRTest.cpp / ARingRRRTest.cpp / ARingRRiTest.cpp they form the file-aring-real-complex-tests family. The cross-backend agreement guard is the standard MPC vs. complex<double> convergence check at 53 bits.

See also
ARingTest.hpp
aring-CCC.hpp
aring-RRR.hpp
ARingCCTest.cpp

Definition in file ARingCCCTest.cpp.