Macaulay2 Engine
Loading...
Searching...
No Matches

◆ testRingNegateCCC()

void testRingNegateCCC ( const M2::ARingCCC & C,
int ntrials )

Definition at line 83 of file ARingCCCTest.cpp.

84{
87 C.init(a);
88 C.init(b);
89 C.init(c);
90 for (int i = 0; i < ntrials; i++)
91 {
92 // test: (-a) + (a) == 0
93 gen.nextElement(a);
94 C.negate(b, a);
95 C.add(c, a, b);
96 EXPECT_TRUE(C.is_zero(c));
97 }
98 C.clear(c);
99 C.clear(b);
100 C.clear(a);
101}
const int ntrials
Definition ARingTest.hpp:42
bool is_zero(const ElementType &f) const
void add(ElementType &result, const ElementType &a, const ElementType &b) const
void init(ElementType &result) const
void negate(ElementType &result, const ElementType &a) const
static void clear(ElementType &result)

References M2::ARingCCC::add(), M2::ARingCCC::clear(), M2::ARingCCC::init(), M2::ARingCCC::is_zero(), M2::ARingCCC::negate(), ARingElementGenerator< RingType >::nextElement(), and ntrials.

Referenced by TEST().