Loading...
Searching...
No Matches
CoeffsTestSuite Class Reference

`#include <coeffs_test.h>`

## Public Member Functions

void | test_Z2m4 ()
void | test_Zp101 ()
void | test_Z2m8 ()
void | simple (const n_coeffType _type)
void | test_Q ()
void | test_R ()
void | test_Z ()
void | test_GF_toobig ()
void | test_GF ()
void | test_Zn3 ()
void | test_Z2m2 ()
void | test_LR ()
void | test_LC ()
void | test_Q_special ()
Public Member Functions inherited from CxxTest::TestSuite
virtual | ~TestSuite ()
virtual void | setUp ()
virtual void | tearDown ()

## Detailed Description

Definition at line 353 of file coeffs_test.h.

## Member Function Documentation

## simple()

void CoeffsTestSuite::simple | ( | const n_coeffType | _type | ) |

inline

Definition at line 380 of file coeffs_test.h.

{
n_coeffType type = _type;
TS_ASSERT( type == _type ); // ?
TS_ASSERT( Test(type) );
}
TS_ASSERT
#define TS_ASSERT(e)
Definition TestSuite.h:239
n_coeffType
n_coeffType
Definition coeffs.h:27
Test
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition coeffs_test.h:209

## test_GF()

void CoeffsTestSuite::test_GF | ( |  | ) |

inline

Definition at line 422 of file coeffs_test.h.

{
// TODO: what if it was already registered?
// Q: no way to deRegister a type?
n_coeffType type = n_GF;
GFInfo param;
param.GFChar= 5;
param.GFDegree= 2;
param.GFPar_name= (const char*)"Q";
TS_ASSERT( Test(type, (void*) &param) );
// it should not be used by numbers... right?
// TODO: what is our policy wrt param-pointer-ownership?
}
GFInfo::GFDegree
int GFDegree
Definition coeffs.h:102
n_GF
@ n_GF
\GF{p^n < 2^16}
Definition coeffs.h:32
GFInfo::GFPar_name
const char * GFPar_name
Definition coeffs.h:103
GFInfo::GFChar
int GFChar
Definition coeffs.h:101

## test_GF_toobig()

void CoeffsTestSuite::test_GF_toobig | ( |  | ) |

inline

Definition at line 406 of file coeffs_test.h.

{
n_coeffType type = n_GF;
GFInfo param;
param.GFChar= 5;
param.GFDegree= 12;
param.GFPar_name= (const char*)"q";
TS_ASSERT( !Test(type, (void*) &param) );
// it should not be used by numbers... right?
// TODO: what is our policy wrt param-pointer-ownership?
}

## test_LC()

void CoeffsTestSuite::test_LC | ( |  | ) |

inline

Definition at line 469 of file coeffs_test.h.

{
simple(n_long_C);
}
CoeffsTestSuite::simple
void simple(const n_coeffType _type)
Definition coeffs_test.h:380
n_long_C
@ n_long_C
complex floating point (GMP) numbers
Definition coeffs.h:41

## test_LR()

void CoeffsTestSuite::test_LR | ( |  | ) |

inline

Definition at line 464 of file coeffs_test.h.

{
simple(n_long_R);
}
n_long_R
@ n_long_R
real floating point (GMP) numbers
Definition coeffs.h:33

## test_Q()

void CoeffsTestSuite::test_Q | ( |  | ) |

inline

Definition at line 387 of file coeffs_test.h.

{
simple(n_Q);
}
n_Q
@ n_Q
rational (GMP) numbers
Definition coeffs.h:30

## test_Q_special()

void CoeffsTestSuite::test_Q_special | ( |  | ) |

inline

Definition at line 474 of file coeffs_test.h.

{
const coeffs cf = nInitChar(n_Q, NULLp);
if (cf == NULLp)
clog << ( "Test: could not get this coeff. domain" );
TS_ASSERT_DIFFERS(cf->cfCoeffWrite, NULLp);
if (cf->cfCoeffWrite != NULL )
{
clog << "Coeff-domain: " << endl;
n_CoeffWrite(cf); PrintLn();
}
number q1 = n_Init(21, cf);
number q2 = n_Init(2, cf);
number q3 = n_Div(q1, q2, cf);
number q4 = n_Init(30, cf);
number q5 = n_Mult(q3, q4, cf);
TS_ASSERT(n_Test(q5, cf));
Print("21/2 * 30 = %ld\n", n_Int(q5, cf));
TS_ASSERT(n_Test(q5, cf));
n_Delete(&q1, cf);
n_Delete(&q2, cf);
n_Delete(&q3, cf);
n_Delete(&q4, cf);
n_Delete(&q5, cf);
}
TS_ASSERT_DIFFERS
#define TS_ASSERT_DIFFERS(x, y)
Definition TestSuite.h:287
NULLp
#define NULLp
Definition auxiliary.h:109
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
n_Mult
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
Definition coeffs.h:639
n_Int
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition coeffs.h:550
n_CoeffWrite
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
Definition coeffs.h:722
n_Test
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r).
Definition coeffs.h:715
n_Div
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition coeffs.h:618
nInitChar
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition numbers.cc:412
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:541
Print
#define Print
Definition emacs.cc:80
NULL
#define NULL
Definition omList.c:12
PrintLn
void PrintLn()
Definition reporter.cc:314

## test_R()

void CoeffsTestSuite::test_R | ( |  | ) |

inline

Definition at line 392 of file coeffs_test.h.

{
simple(n_R);
}
n_R
@ n_R
single prescision (6,6) real numbers
Definition coeffs.h:31

## test_Z()

void CoeffsTestSuite::test_Z | ( |  | ) |

inline

Definition at line 398 of file coeffs_test.h.

{
#ifdef HAVE_RINGS
simple(n_Z); // No need in GMP?
#endif
}
n_Z
@ n_Z
only used if HAVE_RINGS is defined
Definition coeffs.h:43

## test_Z2m2()

void CoeffsTestSuite::test_Z2m2 | ( |  | ) |

inline

Definition at line 455 of file coeffs_test.h.

{
#ifdef HAVE_RINGS
n_coeffType type = n_Z2m;
TS_ASSERT( Test(type, (void*) 2) );
#endif
}
n_Z2m
@ n_Z2m
only used if HAVE_RINGS is defined
Definition coeffs.h:46

## test_Z2m4()

void CoeffsTestSuite::test_Z2m4 | ( |  | ) |

inline

Definition at line 358 of file coeffs_test.h.

{
#ifdef HAVE_RINGS
n_coeffType type = n_Z2m;
TS_ASSERT( Test(type, (void*) 4) );
#endif
}

## test_Z2m8()

void CoeffsTestSuite::test_Z2m8 | ( |  | ) |

inline

Definition at line 372 of file coeffs_test.h.

{
#ifdef HAVE_RINGS
n_coeffType type = n_Z2m;
TS_ASSERT( Test(type, (void*) 8) );
#endif
}

## test_Zn3()

void CoeffsTestSuite::test_Zn3 | ( |  | ) |

inline

Definition at line 441 of file coeffs_test.h.

{
#ifdef HAVE_RINGS
n_coeffType type = n_Zn;
ZnmInfo Znmparam;
Znmparam.base= (mpz_ptr) omAlloc (sizeof (mpz_t));
mpz_init_set_ui (Znmparam.base, 3);
Znmparam.exp= 1;
TS_ASSERT( Test(type, (void*) &Znmparam) );
#endif
}
n_Zn
@ n_Zn
only used if HAVE_RINGS is defined
Definition coeffs.h:44
omAlloc
#define omAlloc(size)
Definition omAllocDecl.h:210
ZnmInfo::base
mpz_ptr base
Definition rmodulon.h:17
ZnmInfo::exp
unsigned long exp
Definition rmodulon.h:17

## test_Zp101()

void CoeffsTestSuite::test_Zp101 | ( |  | ) |

inline

Definition at line 366 of file coeffs_test.h.

{
n_coeffType type = n_Zp;
TS_ASSERT( Test(type, (void*) 101) );
}
n_Zp
@ n_Zp
\F{p < 2^31}
Definition coeffs.h:29

The documentation for this class was generated from the following file:

- libpolys/tests/coeffs_test.h