245{
254 mpz_t gmp1;
255 mpz_init(gmp1);
256 for (
int i = 0; i <
ntrials; i++)
257 {
258 gen.nextElement(a);
259
260
263
268 C.
power(d, a, e1 + e2);
271
272
273
274
275 mpz_set_si(gmp1, e1);
277 EXPECT_TRUE(
fabs(d.
re - b.
re) < 1.e-14);
278 EXPECT_TRUE(
fabs(d.
im - b.
im) < 1.e-14);
279 }
280 mpz_clear(gmp1);
285}
bool almostEqual(const M2::ARingCC &C, unsigned long nbits, const M2::ARingCC::ElementType &a, const M2::ARingCC::ElementType &b)
void power(ElementType &result, const ElementType &a, int n) const
void power_mpz(ElementType &result, const ElementType &a, mpz_srcptr n) const
void mult(ElementType &res, const ElementType &a, const RealElementType &b) const
bool is_equal(const ElementType &f, const ElementType &g) const
void init(ElementType &result) const
unsigned long get_precision() const
static void clear(ElementType &result)
aring-style adapter for double-precision complex numbers, stored as (double, double) pairs.
const mpreal fabs(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
int32_t rawRandomInt(int32_t max)