Givaro 4.2.1
test-ringarith.C File Reference
#include <iostream>
#include <givaro/modular.h>
#include <givaro/modular-balanced.h>
#include <givaro/modular-extended.h>
#include <givaro/givpoly1.h>
#include <givaro/givinteger.h>
#include <givaro/zring.h>
#include <givaro/gfq.h>
#include <recint/recint.h>

Macros

#define TESTE_EG(a, b)
 
#define TESTE_T(b)
 
#define JETESTE(a, s)
 
#define JEPOLTESTE(a, s)
 
#define JEONETESTE(F, x, y)
 
#define NBITER   50
 
#define DEGMAX   75
 
#define NBITERD   10
 
#define TEST_SPECIFIC(Ring, Name, Modulus...)
 
#define TEST_POLYNOMIAL(BaseRing, Name, BaseRingName)
 
#define TEST_LAST(Field, Name)
 
#define TEST_INV(Field, Name, Prime)
 

Functions

template<class Ring>
int TestOneRing (const Ring &F, const typename Ring::Element &x, const typename Ring::Element &y)
 
template<class Ring>
int TestRing (const Ring &F, const uint64_t seed)
 
template<class Ring>
int TestPolRing (const Ring &F, const uint64_t seed)
 
template<class Ring>
int TestInv (const Ring &F, const uint64_t seed)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ TESTE_EG

#define TESTE_EG ( a,
b )
Value:
if (!F.areEqual((a),(b))) { \
F.write( F.write(std::cout,a) << "!=",b) \
<< " failed (at line " << __LINE__ << ")" << std::endl; \
return -1; \
}

◆ TESTE_T

#define TESTE_T ( b)
Value:
if (!b) { \
F.write(std::cout) \
<< " failed (at line " << __LINE__ << ")" << std::endl; \
return -1; \
}

◆ JETESTE

#define JETESTE ( a,
s )
Value:
if (TestRing( (a), (s)) ) { \
std::cout << #a << " failed !" << std::endl; \
return -1; \
}
int TestRing(const Ring &F, const uint64_t seed)
Definition test-ringarith.C:216

◆ JEPOLTESTE

#define JEPOLTESTE ( a,
s )
Value:
if (TestPolRing( (a), (s) ) ) { \
std::cout << #a << " failed !" << std::endl; \
return -1; \
}
int TestPolRing(const Ring &F, const uint64_t seed)
Definition test-ringarith.C:257

◆ JEONETESTE

#define JEONETESTE ( F,
x,
y )
Value:
if (TestOneRing(F,x,y)) { \
std::cout << #x << " " << #y << " failed !" << std::endl; \
return -1; \
}
int TestOneRing(const Ring &F, const typename Ring::Element &x, const typename Ring::Element &y)
Definition test-ringarith.C:63

◆ NBITER

#define NBITER   50

◆ DEGMAX

#define DEGMAX   75

◆ NBITERD

#define NBITERD   10

◆ TEST_SPECIFIC

#define TEST_SPECIFIC ( Ring,
Name,
Modulus... )
Value:
std::cout << "TEST_SPECIFIC: " << #Name << std::endl; \
Ring Name(Modulus); \
JETESTE(Name, seed);

◆ TEST_POLYNOMIAL

#define TEST_POLYNOMIAL ( BaseRing,
Name,
BaseRingName )
Value:
Poly1Dom<BaseRing, Dense> Name(BaseRingName, "X"); \
JEPOLTESTE(Name, seed);
Definition givpoly1.h:31

◆ TEST_LAST

#define TEST_LAST ( Field,
Name )
Value:
std::cout << "TEST_LAST: " << #Name; \
Field Name(Field::maxCardinality()); \
Name.write(std::cout << " (", Field::maxCardinality()) << ")"<< std::endl; \
JETESTE(Name, seed);
GFqDom< int64_t > Field
Definition domain_to_operatorstyle.C:24

◆ TEST_INV

#define TEST_INV ( Field,
Name,
Prime )
Value:
std::cout << "TEST_INV: " << #Name; \
Field Name(Prime); \
std::cout << " (" << (Integer)Name.cardinality() << ',' << (Integer)Name.maxCardinality() << ')'<< std::endl; \
if (TestInv( (Name), (seed))) { \
std::cout << #Name << " failed !" << std::endl; \
return -1; \
}
This is the Integer class.
Definition gmp++_int.h:160
int TestInv(const Ring &F, const uint64_t seed)
Definition test-ringarith.C:284

Function Documentation

◆ TestOneRing()

template<class Ring>
int TestOneRing ( const Ring & F,
const typename Ring::Element & x,
const typename Ring::Element & y )

◆ TestRing()

template<class Ring>
int TestRing ( const Ring & F,
const uint64_t seed )

◆ TestPolRing()

template<class Ring>
int TestPolRing ( const Ring & F,
const uint64_t seed )

◆ TestInv()

template<class Ring>
int TestInv ( const Ring & F,
const uint64_t seed )

◆ main()

int main ( int argc,
char ** argv )