Givaro
Macros | Functions
test-fieldarith.h File Reference
#include <iostream>
#include <givaro/givinteger.h>
#include <givaro/givintprime.h>
+ Include dependency graph for test-fieldarith.h:
+ This graph shows which files directly or indirectly include this file:

Macros

#define TEST_EQUALITY(a, b)
 
#define TEST_FIELD_SEVERAL_TIMES_SEEDED(a, seed)
 
#define TEST_ONE_FIELD_SEEDED(F, a)
 
#define TEST_LAST_PRIME(Field, Name)
 
#define TEST_SPECIFIC(Field, Name, Modulus...)
 
#define NBITER   50
 

Functions

template<class Field >
bool invertible (const Field &F, const typename Field::Element &a)
 
template<class Field >
int TestOneField (const Field &F, const typename Field::Element &first)
 
template<class Field >
int TestField (const Field &F, const uint64_t seed)
 
template<class Ints >
Ints previousprime (const Ints &a)
 

Macro Definition Documentation

◆ TEST_EQUALITY

#define TEST_EQUALITY (   a,
 
)
Value:
if (!F.areEqual((a),(b))) { \
F.write(F.write(std::cerr,a) << "!=",b) \
<< " failed (at line " << __LINE__ << ")" << std::endl; \
return -1 ; \
}
MG & a
Definition: rmadd.h:143
MG const rmint< K, MG > & b
Definition: rmadd.h:143

◆ TEST_FIELD_SEVERAL_TIMES_SEEDED

#define TEST_FIELD_SEVERAL_TIMES_SEEDED (   a,
  seed 
)
Value:
if (TestField( (a), int(seed)) ) { \
std::cerr << #a << " failed !" << std::endl; \
return -1 ; \
}
int TestField(const Field &F, const uint64_t seed)
Definition: test-fieldarith.h:233

◆ TEST_ONE_FIELD_SEEDED

#define TEST_ONE_FIELD_SEEDED (   F,
 
)
Value:
if (TestOneField(F, (a))) { \
std::cerr << #a << " failed !" << std::endl; \
return -1 ; \
} else std::clog << "PASSED." << std::endl;
int TestOneField(const Field &F, const typename Field::Element &first)
Definition: test-fieldarith.h:54

◆ TEST_LAST_PRIME

#define TEST_LAST_PRIME (   Field,
  Name 
)
Value:
Field Name(previousprime(Field::maxCardinality())); \
TEST_FIELD_SEVERAL_TIMES_SEEDED(Name, seed);
Ints previousprime(const Ints &a)
Definition: test-fieldarith.h:250

◆ TEST_SPECIFIC

#define TEST_SPECIFIC (   Field,
  Name,
  Modulus... 
)
Value:
Field Name(Modulus); \
TEST_FIELD_SEVERAL_TIMES_SEEDED(Name, seed);

◆ NBITER

#define NBITER   50

Function Documentation

◆ invertible()

bool invertible ( const Field F,
const typename Field::Element a 
)

◆ TestOneField()

int TestOneField ( const Field F,
const typename Field::Element first 
)

◆ TestField()

int TestField ( const Field F,
const uint64_t  seed 
)

◆ previousprime()

Ints previousprime ( const Ints &  a)