Givaro 4.2.1
test-fieldarith.h File Reference
#include <iostream>
#include <givaro/givinteger.h>
#include <givaro/givintprime.h>

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,
b )
Value:
if (!F.areEqual((a),(b))) { \
F.write(F.write(std::cerr,a) << "!=",b) \
<< " failed (at line " << __LINE__ << ")" << std::endl; \
return -1 ; \
}

◆ 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 ; \
}
void TestField()
Definition all_field.C:42

◆ TEST_ONE_FIELD_SEEDED

#define TEST_ONE_FIELD_SEEDED ( F,
a )
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);
GFqDom< int64_t > Field
Definition domain_to_operatorstyle.C:24
Ints previousprime(const Ints &a)
Definition test-fieldarith.h:263

◆ 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()

template<class Field>
bool invertible ( const Field & F,
const typename Field::Element & a )

◆ TestOneField()

template<class Field>
int TestOneField ( const Field & F,
const typename Field::Element & first )

◆ TestField()

template<class Field>
int TestField ( const Field & F,
const uint64_t seed )

◆ previousprime()

template<class Ints>
Ints previousprime ( const Ints & a)