Givaro
Macros | Functions
test-ringarith.C File Reference
#include <iostream>
#include <givaro/modular.h>
#include <givaro/modular-balanced.h>
#include <givaro/givpoly1.h>
#include <givaro/givinteger.h>
#include <givaro/zring.h>
#include <givaro/gfq.h>
#include <recint/recint.h>
+ Include dependency graph for test-ringarith.C:

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,
 
)
Value:
if (!F.areEqual((a),(b))) { \
F.write( F.write(std::cout,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

◆ 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,
 
)
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:215

◆ JEPOLTESTE

#define JEPOLTESTE (   a,
 
)
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:256

◆ JEONETESTE

#define JEONETESTE (   F,
  x,
 
)
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:62

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

◆ 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:283

Function Documentation

◆ TestOneRing()

int TestOneRing ( const Ring &  F,
const typename Ring::Element x,
const typename Ring::Element y 
)

◆ TestRing()

int TestRing ( const Ring &  F,
const uint64_t  seed 
)

◆ TestPolRing()

int TestPolRing ( const Ring &  F,
const uint64_t  seed 
)

◆ TestInv()

int TestInv ( const Ring &  F,
const uint64_t  seed 
)

◆ main()

int main ( int  argc,
char **  argv 
)