Functions
number2.h File Reference
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <coeffs/coeffs.h>
#include <kernel/structs.h>

Go to the source code of this file.

Functions

char * crString (coeffs c)
 
void crPrint (coeffs cf)
 
BOOLEAN jjCRING_Zp (leftv res, leftv a, leftv b)
 
BOOLEAN jjCRING_Zm (leftv res, leftv a, leftv b)
 
BOOLEAN jjEQUAL_CR (leftv res, leftv a, leftv b)
 

Function Documentation

§ crPrint()

void crPrint ( coeffs  cf)

Definition at line 26 of file number2.cc.

27 {
28  char *s=crString(c);
29  PrintS(s);
30  omFree(s);
31 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
char * crString(coeffs c)
Definition: number2.cc:18
#define omFree(addr)
Definition: omAllocDecl.h:261
void PrintS(const char *s)
Definition: reporter.cc:284

§ crString()

char* crString ( coeffs  c)

Definition at line 18 of file number2.cc.

19 {
20  if (c==NULL)
21  {
22  return omStrDup("oo");
23  }
24  return omStrDup(nCoeffName(c));
25 }
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:977
#define NULL
Definition: omList.c:10
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ jjCRING_Zm()

BOOLEAN jjCRING_Zm ( leftv  res,
leftv  a,
leftv  b 
)

Definition at line 59 of file number2.cc.

60 {
61  coeffs c1=(coeffs)a->Data();
62  number i2=(number)b->Data();
63  if (c1->type==n_Z)
64  {
65  ZnmInfo info;
66  number modBase= (number) omAlloc(sizeof(mpz_t));
67  nlGMP(i2,modBase,coeffs_BIGINT); // FIXME? TODO? // extern void nlGMP(number &i, number n, const coeffs r); // to be replaced with n_MPZ(modBase,i2,coeffs_BIGINT); // ?
68  info.base= (mpz_ptr)modBase;
69  info.exp= 1;
70  res->data=(void *)nInitChar(n_Zn,&info);
71  return FALSE;
72  }
73  return TRUE;
74 }
mpz_ptr base
Definition: rmodulon.h:19
only used if HAVE_RINGS is defined
Definition: coeffs.h:44
#define FALSE
Definition: auxiliary.h:95
#define TRUE
Definition: auxiliary.h:99
void nlGMP(number &i, number n, const coeffs r)
Definition: longrat.cc:1467
coeffs coeffs_BIGINT
Definition: ipid.cc:54
#define omAlloc(size)
Definition: omAllocDecl.h:210
void * data
Definition: subexpr.h:89
The main handler for Singular numbers which are suitable for Singular polynomials.
const ExtensionInfo & info
< [in] sqrfree poly
only used if HAVE_RINGS is defined
Definition: coeffs.h:43
unsigned long exp
Definition: rmodulon.h:19
void * Data()
Definition: subexpr.cc:1146
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:334

§ jjCRING_Zp()

BOOLEAN jjCRING_Zp ( leftv  res,
leftv  a,
leftv  b 
)

Definition at line 36 of file number2.cc.

37 {
38  coeffs c1=(coeffs)a->Data();
39  int i2=(int)(long)b->Data();
40  if (c1->type==n_Z)
41  {
42  if (i2==IsPrime(i2))
43  {
44  res->data=(void *)nInitChar(n_Zp,(void*)(long)i2);
45  }
46  else
47  {
48  ZnmInfo info;
49  mpz_ptr modBase= (mpz_ptr) omAlloc(sizeof(mpz_t));
50  mpz_init_set_ui(modBase,i2);
51  info.base= modBase;
52  info.exp= 1;
53  res->data=(void *)nInitChar(n_Zn,&info);
54  }
55  return FALSE;
56  }
57  return TRUE;
58 }
mpz_ptr base
Definition: rmodulon.h:19
only used if HAVE_RINGS is defined
Definition: coeffs.h:44
#define FALSE
Definition: auxiliary.h:95
{p < 2^31}
Definition: coeffs.h:30
#define TRUE
Definition: auxiliary.h:99
#define omAlloc(size)
Definition: omAllocDecl.h:210
void * data
Definition: subexpr.h:89
The main handler for Singular numbers which are suitable for Singular polynomials.
const ExtensionInfo & info
< [in] sqrfree poly
only used if HAVE_RINGS is defined
Definition: coeffs.h:43
unsigned long exp
Definition: rmodulon.h:19
int IsPrime(int p)
Definition: prime.cc:61
void * Data()
Definition: subexpr.cc:1146
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:334

§ jjEQUAL_CR()

BOOLEAN jjEQUAL_CR ( leftv  res,
leftv  a,
leftv  b 
)

Definition at line 76 of file number2.cc.

77 {
78  coeffs a2=(coeffs)a->Data();
79  coeffs b2=(coeffs)b->Data();
80  res->data=(void*)(long)(a2==b2);
81  return FALSE;
82 }
#define FALSE
Definition: auxiliary.h:95
void * data
Definition: subexpr.h:89
The main handler for Singular numbers which are suitable for Singular polynomials.
void * Data()
Definition: subexpr.cc:1146