Macaulay2 Engine
Loading...
Searching...
No Matches
ARingTest.hpp File Reference

Shared gtest harness for the ARing*Test.cpp suite. More...

#include "interface/random.h"

Go to the source code of this file.

Classes

class  ARingElementGenerator< RingType >

Functions

template<typename RingType>
void getElement (const RingType &R, int index, typename RingType::ElementType &result)
template<typename T>
std::istream & fromStream (std::istream &i, const T &R, typename T::ElementType &result)
template<typename T>
void testSomeMore (const T &R)
template<typename T>
void testNegate (const T &R, int ntrials)
template<typename T>
std::string ringName (const T &R)
template<typename T>
void testCoercions (const T &R)
template<typename T>
void testAxioms (const T &R, int ntrials)
template<typename T>
void testAdd (const T &R, int ntrials)
template<typename T>
void testSubtract (const T &R, int ntrials)
template<typename T>
void testMultiply (const T &R, int ntrials)
template<typename T>
void testDivide (const T &R, int ntrials)
template<typename T>
void testReciprocal (const T &R, int ntrials)
template<typename T>
void testPower (const T &R, int ntrials)
template<typename T>
void testFiniteField (const T &R, int ntrials)
template<typename T>
void testARingInterface (const T &R)

Variables

const int ntrials = 1000

Detailed Description

Shared gtest harness for the ARing*Test.cpp suite.

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

Declares the per-ring testing surface: the primary getElement<RingType>(R, index, result) function template (each ARing*Test.cpp provides its ring's specialisation), the ARingElementGenerator<RingType> wrapper handing out one element per nextElement call, the fromStream parser, and a family of templated check drivers parameterised on the ring — testNegate, testCoercions, testAxioms, testAdd, testSubtract, testMultiply, testDivide, testReciprocal, testPower, and more — each running ntrials iterations against the generator's output. testSomeMore<T>(R) is a small smoke test that exercises set_from_long + add + is_equal for a single fixed (27, characteristic - 11, 16) triple, not a full arithmetic battery. ntrials = 1000 fixes the random iteration count; the commented 1000000 line records the prior experiment that swamped the CI box.

Element indices < 50 get a deterministic prefix (set_from_long(result, index - 25) in the typical specialisation) so zero, plus / minus one, and small integers are always exercised before the random fuzz kicks in. Companion to RingTest.hpp for the legacy Ring-hierarchy tests.

See also
RingTest.hpp
interface/random.h
ARingZZTest.cpp
ARingGFTest.cpp

Definition in file ARingTest.hpp.