Go to the source code of this file.
|
number | nlRInit (long i) |
|
static char * | send_number (char *s, number n) |
|
static char * | get_number (char *s, number *n) |
|
static long | size_number (number n) |
|
static char * | send_mon (char *s, poly m, const ring r) |
|
static char * | get_mon (char *s, poly *m, const ring r) |
|
static long | size_mon (poly m, const ring r) |
|
static char * | send_poly (char *s, int ind, poly p, const ring r) |
|
static char * | get_poly (char *s, int &ind, poly *p, const ring r) |
|
static long | size_poly (poly p, const ring r) |
|
ideal | id_ChineseRemainder_0 (ideal *xx, number *q, int rl, const ring r) |
|
ideal | id_Farey_0 (ideal x, number N, const ring r) |
|
void | test_n (poly n) |
|
◆ mpz_isNeg
#define mpz_isNeg |
( |
|
A | ) |
((A)->_mp_size<0) |
◆ get_mon()
static char * get_mon |
( |
char * |
s, |
|
|
poly * |
m, |
|
|
const ring |
r |
|
) |
| |
|
static |
Definition at line 130 of file kChinese.cc.
134 memcpy((*m)->exp,
s,r->ExpL_Size*
sizeof(
long));
135 s+=r->ExpL_Size*
sizeof(long);
const CanonicalForm int s
static char * get_number(char *s, number *n)
static poly p_Init(const ring r, omBin bin)
◆ get_number()
static char * get_number |
( |
char * |
s, |
|
|
number * |
n |
|
) |
| |
|
static |
Definition at line 55 of file kChinese.cc.
77 mpz_realloc2((*n)->z,
l*
sizeof(mp_limb_t)*8);
78 mpz_import((*n)->z,
l,-1,
sizeof(mp_limb_t),0,0,
s);
79 if (neg) mpz_neg((*n)->z,(*n)->z);
80 s+=
l*
sizeof(mp_limb_t);
86 mpz_init2((*n)->n,
l*
sizeof(mp_limb_t)*8);
87 mpz_import((*n)->n,
l,-1,
sizeof(mp_limb_t),0,0,
s);
88 s+=
l*
sizeof(mp_limb_t);
◆ get_poly()
static char * get_poly |
( |
char * |
s, |
|
|
int & |
ind, |
|
|
poly * |
p, |
|
|
const ring |
r |
|
) |
| |
|
static |
Definition at line 165 of file kChinese.cc.
173 for(
long i=0;
i<
l;
i++)
static char * get_mon(char *s, poly *m, const ring r)
static poly pReverse(poly p)
◆ id_ChineseRemainder_0()
ideal id_ChineseRemainder_0 |
( |
ideal * |
xx, |
|
|
number * |
q, |
|
|
int |
rl, |
|
|
const ring |
r |
|
) |
| |
Definition at line 195 of file kChinese.cc.
197 int cnt=0;
int rw=0;
int cl=0;
199 for(
int j=rl-1;
j>=0;
j--)
203 if (xx[
j]->
nrows >rw) rw=xx[
j]->nrows;
208 WerrorS(
"format mismatch in CRT");
212 if ((cpus==1) || (2*cpus>=cnt))
218 int parent_pid=getpid();
223 for(
int i=cnt-1;
i>=0;
i--)
227 for(
int i=cpus;
i>=0;
i--)
233 for (
int i=0;
i<cpus;
i++)
238 if (parent_pid!=getpid())
240 number *
x=(number *)
omAlloc(rl*
sizeof(number));
241 poly *
p=(poly *)
omAlloc(rl*
sizeof(poly));
247 int ind=queue->dequeue();
253 for(
int j=rl-1;
j>=0;
j--)
264 char *
s=(
char*)msg->str();
266 rqueue->enqueue(msg);
276 msg=rqueue->dequeue();
277 char *
s=(
char*)msg->str();
void WerrorS(const char *s)
static void * feOptValue(feOptIndex opt)
static char * get_poly(char *s, int &ind, poly *p, const ring r)
static long size_poly(poly p, const ring r)
static char * send_poly(char *s, int ind, poly p, const ring r)
poly p_ChineseRemainder(poly *xx, mpz_ptr *x, mpz_ptr *q, int rl, mpz_ptr *C, const ring R)
static void vmem_deinit()
static Status vmem_init()
static VRef< VString > vstring(const char *s)
ideal idInit(int idsize, int rank)
initialise an ideal / module
ideal id_ChineseRemainder(ideal *xx, number *q, int rl, const ring r)
◆ id_Farey_0()
ideal id_Farey_0 |
( |
ideal |
x, |
|
|
number |
N, |
|
|
const ring |
r |
|
) |
| |
Definition at line 294 of file kChinese.cc.
305 int parent_pid=getpid();
310 for(
int i=cnt-1;
i>=0;
i--)
314 for(
int i=cpus;
i>=0;
i--)
320 for (
int i=0;
i<cpus;
i++)
325 if (parent_pid!=getpid())
329 int ind=queue->dequeue();
338 char *
s=(
char*)msg->str();
340 rqueue->enqueue(msg);
350 msg=rqueue->dequeue();
351 char *
s=(
char*)msg->str();
const CanonicalForm CFMap CFMap & N
ideal id_Farey(ideal x, number N, const ring r)
poly p_Farey(poly p, number N, const ring r)
◆ nlRInit()
◆ send_mon()
static char * send_mon |
( |
char * |
s, |
|
|
poly |
m, |
|
|
const ring |
r |
|
) |
| |
|
static |
Definition at line 121 of file kChinese.cc.
125 memcpy(
s,
m->exp,r->ExpL_Size*
sizeof(
long));
126 s+=r->ExpL_Size*
sizeof(long);
static char * send_number(char *s, number n)
◆ send_number()
static char * send_number |
( |
char * |
s, |
|
|
number |
n |
|
) |
| |
|
static |
Definition at line 24 of file kChinese.cc.
36 if (
mpz_isNeg(n->z)) { *d+=8; mpz_neg(n->z,n->z); }
40 mpz_export(
s,&
l,-1,
sizeof(mp_limb_t),0,0,n->z);
42 s+=
l*
sizeof(mp_limb_t);
47 mpz_export(
s,&
l,-1,
sizeof(mp_limb_t),0,0,n->n);
49 s+=
l*
sizeof(mp_limb_t);
◆ send_poly()
static char * send_poly |
( |
char * |
s, |
|
|
int |
ind, |
|
|
poly |
p, |
|
|
const ring |
r |
|
) |
| |
|
static |
Definition at line 146 of file kChinese.cc.
static char * send_mon(char *s, poly m, const ring r)
static unsigned pLength(poly a)
◆ size_mon()
static long size_mon |
( |
poly |
m, |
|
|
const ring |
r |
|
) |
| |
|
static |
Definition at line 139 of file kChinese.cc.
142 ll+=r->ExpL_Size*
sizeof(long);
static long size_number(number n)
◆ size_number()
static long size_number |
( |
number |
n | ) |
|
|
static |
Definition at line 94 of file kChinese.cc.
107 ll+=
l*
sizeof(mp_limb_t);
113 ll+=
l*
sizeof(mp_limb_t);
115 ll+=
l*
sizeof(mp_limb_t);
◆ size_poly()
static long size_poly |
( |
poly |
p, |
|
|
const ring |
r |
|
) |
| |
|
static |
Definition at line 184 of file kChinese.cc.
186 long l=SIZEOF_LONG*2;
static long size_mon(poly m, const ring r)
◆ test_n()
Definition at line 368 of file kChinese.cc.
373 printf(
"size: %d\n",ll);
375 printf(
"send len: %d\n",(
int)(
s-
buf));
377 for(
int i=0;
i<=ll/SIZEOF_LONG;
i++) printf(
"%ld ",d[
i]);
381 printf(
"read len: %d\n",(
int)(
s-
buf));
382 Print(
":index: %d\n",ll);
void p_Write(poly p, ring lmRing, ring tailRing)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...