38#include <gtest/gtest.h>
83 for (
int i = 0; i <
ntrials; i++)
113 for (
int i = 0; i <
ntrials; i++)
140 for (
int i = 0; i <
ntrials; i++)
168 for (
int i = 0; i <
ntrials; i++)
199 for (
int i = 0; i <
ntrials; i++)
256 for (
int i = 0; i <
ntrials; i++)
268 C.
power(d, a, e1 + e2);
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);
bool almostEqual(const M2::ARingCC &C, unsigned long nbits, const M2::ARingCC::ElementType &a, const M2::ARingCC::ElementType &b)
void testRingNegateCCC(const M2::ARingCC &C, int ntrials)
void getElement< M2::ARingCC >(const M2::ARingCC &C, int index, M2::ARingCC::ElementType &result)
std::string ringName(const T &R)
Shared gtest harness for the ARing*Test.cpp suite.
M2::ARingCC — machine-precision complex numbers (pair of doubles).
M2::ARingRR — machine-precision real numbers (IEEE 754 double).
void nextElement(typename RingType::ElementType &result)
void set_from_long(ElementType &result, long a) const
void subtract_multiple(ElementType &result, const ElementType &a, const ElementType &b) const
void negate(ElementType &result, const ElementType &a) const
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
void add(ElementType &res, const ElementType &a, const ElementType &b) const
bool is_zero(const ElementType &f) const
bool is_equal(const ElementType &f, const ElementType &g) const
void abs(ARingRR::ElementType &result, const ElementType &a) const
void init(ElementType &result) const
const RealRingType & real_ring() const
void random(ElementType &result) const
void subtract(ElementType &res, const ElementType &a, const ElementType &b) const
unsigned long get_precision() const
void divide(ElementType &res, const ElementType &a, const RealElementType &b) const
size_t characteristic() const
static void clear(ElementType &result)
aring-style adapter for double-precision complex numbers, stored as (double, double) pairs.
int compare_elems(const ElementType &f, const ElementType &g) const
void subtract(int &result, int a, int b)
VALGRIND_MAKE_MEM_DEFINED & result(result)
int32_t rawRandomInt(int32_t max)