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 25 of file number2.cc.

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

§ crString()

char* crString ( coeffs  c)

Definition at line 17 of file number2.cc.

18 {
19  if (c==NULL)
20  {
21  return omStrDup("oo");
22  }
23  return omStrDup(nCoeffName(c));
24 }
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:980
#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 58 of file number2.cc.

59 {
60  coeffs c1=(coeffs)a->Data();
61  number i2=(number)b->Data();
62  if (c1->type==n_Z)
63  {
64  ZnmInfo info;
65  number modBase= (number) omAlloc(sizeof(mpz_t));
66  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); // ?
67  info.base= (mpz_ptr)modBase;
68  info.exp= 1;
69  res->data=(void *)nInitChar(n_Zn,&info);
70  return FALSE;
71  }
72  return TRUE;
73 }
mpz_ptr base
Definition: rmodulon.h:19
only used if HAVE_RINGS is defined
Definition: coeffs.h:44
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
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:1138
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 35 of file number2.cc.

36 {
37  coeffs c1=(coeffs)a->Data();
38  int i2=(int)(long)b->Data();
39  if (c1->type==n_Z)
40  {
41  if (i2==IsPrime(i2))
42  {
43  res->data=(void *)nInitChar(n_Zp,(void*)(long)i2);
44  }
45  else
46  {
47  ZnmInfo info;
48  mpz_ptr modBase= (mpz_ptr) omAlloc(sizeof(mpz_t));
49  mpz_init_set_ui(modBase,i2);
50  info.base= modBase;
51  info.exp= 1;
52  res->data=(void *)nInitChar(n_Zn,&info);
53  }
54  return FALSE;
55  }
56  return TRUE;
57 }
mpz_ptr base
Definition: rmodulon.h:19
only used if HAVE_RINGS is defined
Definition: coeffs.h:44
#define FALSE
Definition: auxiliary.h:94
{p < 2^31}
Definition: coeffs.h:30
#define TRUE
Definition: auxiliary.h:98
#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:1138
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 75 of file number2.cc.

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