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

◆ TEST() [1/7]

TEST ( ARingRRi ,
add  )

Definition at line 122 of file ARingRRiTest.cpp.

123{
124 M2::ARingRRi R(100);
126 M2::ARingRRi::ElementType a, b, c, d, e;
127 R.init(a);
128 R.init(b);
129 R.init(c);
130 R.init(d);
131 R.init(e);
132 for (int i = 0; i < ntrials; i++)
133 {
134 // test: (a+b) + (-b) == a
135 gen.nextElement(a);
136 gen.nextElement(b);
137 R.add(c, a, b);
138 R.negate(d, b);
139 R.add(e, c, d); // should be a
140 EXPECT_TRUE(R.is_subset(a,e));
141 }
142 R.clear(e);
143 R.clear(d);
144 R.clear(c);
145 R.clear(b);
146 R.clear(a);
147}
const int ntrials
Definition ARingTest.hpp:42
aring-style adapter for arbitrary-precision real intervals, backed by MPFI.
Definition aring-RRi.hpp:69

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