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

gtest coverage for the GMP-backed M2::ARingQQGMP rational aring. More...

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

Go to the source code of this file.

Functions

gmp_ZZ getRandomInteger ()
template<>
void getElement< M2::ARingQQGMP > (const M2::ARingQQGMP &R, int index, M2::ARingQQGMP::ElementType &result)
 TEST (ARingQQGMP, create)
 TEST (ARingQQGMP, display)
 TEST (ARingQQGMP, arithmetic)

Detailed Description

gtest coverage for the GMP-backed M2::ARingQQGMP rational aring.

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

Plugs M2::ARingQQGMP into the shared ARingTest.hpp harness via the getElement<M2::ARingQQGMP> specialisation, which uses the deterministic [-25, 24] integer prefix for the first 50 trials and delegates to R.random(result) for the rest — so the random source is the ring's own mpq_t draw rather than a separately-seeded RNG. testSomeMore then runs arithmetic, equality, inverse, and stream round-trips against the GMP-canonicalised representation.

Paired with ARingQQFlintTest.cpp (same operations over FLINT fmpq_t); cross-backend agreement between the two is the regression guard the file-aring-zz-tests family depends on. A historic catch on the GMP side was a rounding subtlety in invert(0) that only the cross-check surfaced.

See also
ARingTest.hpp
aring-qq-gmp.hpp
ARingQQFlintTest.cpp
ARingZZTest.cpp

Definition in file ARingQQGmpTest.cpp.