Public Member Functions
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 356 of file coeffs_test.h.

Member Function Documentation

◆ simple()

void CoeffsTestSuite::simple ( const n_coeffType  _type)
inline

Definition at line 383 of file coeffs_test.h.

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

◆ test_GF()

void CoeffsTestSuite::test_GF ( )
inline

Definition at line 425 of file coeffs_test.h.

426  {
427  // TODO: what if it was already registered?
428  // Q: no way to deRegister a type?
429  n_coeffType type = n_GF;
430 
431  GFInfo param;
432 
433  param.GFChar= 5;
434  param.GFDegree= 2;
435  param.GFPar_name= (const char*)"Q";
436 
437  TS_ASSERT( Test(type, (void*) &param) );
438 
439  // it should not be used by numbers... right?
440  // TODO: what is our policy wrt param-pointer-ownership?
441  }
const char * GFPar_name
Definition: coeffs.h:96
#define TS_ASSERT(e)
Definition: TestSuite.h:239
Creation data needed for finite fields.
Definition: coeffs.h:92
int GFDegree
Definition: coeffs.h:95
int GFChar
Definition: coeffs.h:94
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition: coeffs_test.h:212
n_coeffType
Definition: coeffs.h:27
{p^n < 2^16}
Definition: coeffs.h:33

◆ test_GF_toobig()

void CoeffsTestSuite::test_GF_toobig ( )
inline

Definition at line 409 of file coeffs_test.h.

410  {
411  n_coeffType type = n_GF;
412 
413  GFInfo param;
414 
415  param.GFChar= 5;
416  param.GFDegree= 12;
417  param.GFPar_name= (const char*)"q";
418 
419  TS_ASSERT( !Test(type, (void*) &param) );
420 
421  // it should not be used by numbers... right?
422  // TODO: what is our policy wrt param-pointer-ownership?
423  }
const char * GFPar_name
Definition: coeffs.h:96
#define TS_ASSERT(e)
Definition: TestSuite.h:239
Creation data needed for finite fields.
Definition: coeffs.h:92
int GFDegree
Definition: coeffs.h:95
int GFChar
Definition: coeffs.h:94
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition: coeffs_test.h:212
n_coeffType
Definition: coeffs.h:27
{p^n < 2^16}
Definition: coeffs.h:33

◆ test_LC()

void CoeffsTestSuite::test_LC ( )
inline

Definition at line 472 of file coeffs_test.h.

473  {
474  simple(n_long_C);
475  }
complex floating point (GMP) numbers
Definition: coeffs.h:42
void simple(const n_coeffType _type)
Definition: coeffs_test.h:383

◆ test_LR()

void CoeffsTestSuite::test_LR ( )
inline

Definition at line 467 of file coeffs_test.h.

468  {
469  simple(n_long_R);
470  }
real floating point (GMP) numbers
Definition: coeffs.h:34
void simple(const n_coeffType _type)
Definition: coeffs_test.h:383

◆ test_Q()

void CoeffsTestSuite::test_Q ( )
inline

Definition at line 390 of file coeffs_test.h.

391  {
392  simple(n_Q);
393  }
rational (GMP) numbers
Definition: coeffs.h:31
void simple(const n_coeffType _type)
Definition: coeffs_test.h:383

◆ test_Q_special()

void CoeffsTestSuite::test_Q_special ( )
inline

Definition at line 477 of file coeffs_test.h.

478  {
479  const coeffs cf = nInitChar(n_Q, NULLp);
480 
481  if (cf == NULLp)
482  clog << ( "Test: could not get this coeff. domain" );
483 
484  TS_ASSERT_DIFFERS(cf->cfCoeffWrite, NULLp);
485 
486  if (cf->cfCoeffWrite != NULL )
487  {
488  clog << "Coeff-domain: " << endl;
489  n_CoeffWrite(cf); PrintLn();
490  }
491 
492  number q1 = n_Init(21, cf);
493  number q2 = n_Init(2, cf);
494  number q3 = n_Div(q1, q2, cf);
495  number q4 = n_Init(30, cf);
496  number q5 = n_Mult(q3, q4, cf);
497  TS_ASSERT(n_Test(q5, cf));
498  Print("21/2 * 30 = %ld\n", n_Int(q5, cf));
499  TS_ASSERT(n_Test(q5, cf));
500  n_Delete(&q1, cf);
501  n_Delete(&q2, cf);
502  n_Delete(&q3, cf);
503  n_Delete(&q4, cf);
504  n_Delete(&q5, cf);
505  }
#define NULLp
Definition: auxiliary.h:106
void PrintLn()
Definition: reporter.cc:310
#define Print
Definition: emacs.cc:83
rational (GMP) numbers
Definition: coeffs.h:31
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:542
#define TS_ASSERT(e)
Definition: TestSuite.h:239
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of &#39;a&#39; and &#39;b&#39;, i.e., a*b
Definition: coeffs.h:640
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:551
The main handler for Singular numbers which are suitable for Singular polynomials.
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:742
CanonicalForm cf
Definition: cfModGcd.cc:4024
static FORCE_INLINE void n_CoeffWrite(const coeffs r, BOOLEAN details=TRUE)
output the coeff description
Definition: coeffs.h:745
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of &#39;a&#39; and &#39;b&#39;, i.e., a/b; raises an error if &#39;b&#39; is not invertible in r exceptio...
Definition: coeffs.h:619
#define TS_ASSERT_DIFFERS(x, y)
Definition: TestSuite.h:287
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:341

◆ test_R()

void CoeffsTestSuite::test_R ( )
inline

Definition at line 395 of file coeffs_test.h.

396  {
397  simple(n_R);
398  }
single prescision (6,6) real numbers
Definition: coeffs.h:32
void simple(const n_coeffType _type)
Definition: coeffs_test.h:383

◆ test_Z()

void CoeffsTestSuite::test_Z ( )
inline

Definition at line 401 of file coeffs_test.h.

402  {
403 #ifdef HAVE_RINGS
404  simple(n_Z); // No need in GMP?
405 #endif
406  }
only used if HAVE_RINGS is defined
Definition: coeffs.h:43
void simple(const n_coeffType _type)
Definition: coeffs_test.h:383

◆ test_Z2m2()

void CoeffsTestSuite::test_Z2m2 ( )
inline

Definition at line 458 of file coeffs_test.h.

459  {
460 #ifdef HAVE_RINGS
461  n_coeffType type = n_Z2m;
462 
463  TS_ASSERT( Test(type, (void*) 2) );
464 #endif
465  }
only used if HAVE_RINGS is defined
Definition: coeffs.h:46
#define TS_ASSERT(e)
Definition: TestSuite.h:239
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition: coeffs_test.h:212
n_coeffType
Definition: coeffs.h:27

◆ test_Z2m4()

void CoeffsTestSuite::test_Z2m4 ( )
inline

Definition at line 361 of file coeffs_test.h.

362  {
363 #ifdef HAVE_RINGS
364  n_coeffType type = n_Z2m;
365  TS_ASSERT( Test(type, (void*) 4) );
366 #endif
367  }
only used if HAVE_RINGS is defined
Definition: coeffs.h:46
#define TS_ASSERT(e)
Definition: TestSuite.h:239
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition: coeffs_test.h:212
n_coeffType
Definition: coeffs.h:27

◆ test_Z2m8()

void CoeffsTestSuite::test_Z2m8 ( )
inline

Definition at line 375 of file coeffs_test.h.

376  {
377 #ifdef HAVE_RINGS
378  n_coeffType type = n_Z2m;
379  TS_ASSERT( Test(type, (void*) 8) );
380 #endif
381  }
only used if HAVE_RINGS is defined
Definition: coeffs.h:46
#define TS_ASSERT(e)
Definition: TestSuite.h:239
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition: coeffs_test.h:212
n_coeffType
Definition: coeffs.h:27

◆ test_Zn3()

void CoeffsTestSuite::test_Zn3 ( )
inline

Definition at line 444 of file coeffs_test.h.

445  {
446 #ifdef HAVE_RINGS
447  n_coeffType type = n_Zn;
448 
449  ZnmInfo Znmparam;
450  Znmparam.base= (mpz_ptr) omAlloc (sizeof (mpz_t));
451  mpz_init_set_ui (Znmparam.base, 3);
452  Znmparam.exp= 1;
453 
454  TS_ASSERT( Test(type, (void*) &Znmparam) );
455 #endif
456  }
mpz_ptr base
Definition: rmodulon.h:19
only used if HAVE_RINGS is defined
Definition: coeffs.h:44
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define TS_ASSERT(e)
Definition: TestSuite.h:239
unsigned long exp
Definition: rmodulon.h:19
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition: coeffs_test.h:212
n_coeffType
Definition: coeffs.h:27

◆ test_Zp101()

void CoeffsTestSuite::test_Zp101 ( )
inline

Definition at line 369 of file coeffs_test.h.

370  {
371  n_coeffType type = n_Zp;
372  TS_ASSERT( Test(type, (void*) 101) );
373  }
{p < 2^31}
Definition: coeffs.h:30
#define TS_ASSERT(e)
Definition: TestSuite.h:239
BOOLEAN Test(const n_coeffType type, void *p=NULLp)
Definition: coeffs_test.h:212
n_coeffType
Definition: coeffs.h:27

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