#include "misc/auxiliary.h"
#include "misc/intvec.h"
#include "misc/options.h"
#include "polys/monomials/p_polys.h"
#include "polys/matpol.h"
#include "polys/simpleideals.h"
#include "coeffs/longrat.h"
#include "Singular/feOpt.h"
#include "kernel/polys.h"
#include "kernel/mod2.h"
#include "kernel/oswrapper/vspace.h"
#include "kernel/ideals.h"
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
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 131 of file kChinese.cc.
135 memcpy((*m)->exp,
s,r->ExpL_Size*
sizeof(
long));
136 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 56 of file kChinese.cc.
78 mpz_realloc2((*n)->z,
l*
sizeof(mp_limb_t)*8);
79 mpz_import((*n)->z,
l,-1,
sizeof(mp_limb_t),0,0,
s);
80 if (neg) mpz_neg((*n)->z,(*n)->z);
81 s+=
l*
sizeof(mp_limb_t);
87 mpz_init2((*n)->n,
l*
sizeof(mp_limb_t)*8);
88 mpz_import((*n)->n,
l,-1,
sizeof(mp_limb_t),0,0,
s);
89 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 166 of file kChinese.cc.
174 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 196 of file kChinese.cc.
198 int cnt=0;
int rw=0;
int cl=0;
200 for(
int j=rl-1;
j>=0;
j--)
204 if (xx[
j]->
nrows >rw) rw=xx[
j]->nrows;
209 WerrorS(
"format mismatch in CRT");
216 if ((cpus==1) || (2*cpus>=cnt))
222 int parent_pid=getpid();
227 for(
int i=cnt-1;
i>=0;
i--)
231 for(
int i=cpus;
i>=0;
i--)
237 for (
int i=0;
i<cpus;
i++)
242 if (parent_pid!=getpid())
244 number *
x=(number *)
omAlloc(rl*
sizeof(number));
245 poly *
p=(poly *)
omAlloc(rl*
sizeof(poly));
251 int ind=queue->dequeue();
257 for(
int j=rl-1;
j>=0;
j--)
268 char *
s=(
char*)msg->str();
270 rqueue->enqueue(msg);
280 msg=rqueue->dequeue();
281 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 const int MAX_PROCESS
static void vmem_deinit()
static VRef< VString > vstring(const char *s)
static Status vmem_init()
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 298 of file kChinese.cc.
312 int parent_pid=getpid();
317 for(
int i=cnt-1;
i>=0;
i--)
321 for(
int i=cpus;
i>=0;
i--)
327 for (
int i=0;
i<cpus;
i++)
332 if (parent_pid!=getpid())
336 int ind=queue->dequeue();
345 char *
s=(
char*)msg->str();
347 rqueue->enqueue(msg);
357 msg=rqueue->dequeue();
358 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 122 of file kChinese.cc.
126 memcpy(
s,
m->exp,r->ExpL_Size*
sizeof(
long));
127 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 25 of file kChinese.cc.
37 if (
mpz_isNeg(n->z)) { *d+=8; mpz_neg(n->z,n->z); }
41 mpz_export(
s,&
l,-1,
sizeof(mp_limb_t),0,0,n->z);
43 s+=
l*
sizeof(mp_limb_t);
48 mpz_export(
s,&
l,-1,
sizeof(mp_limb_t),0,0,n->n);
50 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 147 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 140 of file kChinese.cc.
143 ll+=r->ExpL_Size*
sizeof(long);
static long size_number(number n)
◆ size_number()
static long size_number |
( |
number |
n | ) |
|
|
static |
Definition at line 95 of file kChinese.cc.
108 ll+=
l*
sizeof(mp_limb_t);
114 ll+=
l*
sizeof(mp_limb_t);
116 ll+=
l*
sizeof(mp_limb_t);
◆ size_poly()
static long size_poly |
( |
poly |
p, |
|
|
const ring |
r |
|
) |
| |
|
static |
Definition at line 185 of file kChinese.cc.
187 long l=SIZEOF_LONG*2;
static long size_mon(poly m, const ring r)
◆ test_n()
Definition at line 377 of file kChinese.cc.
382 printf(
"size: %d\n",ll);
384 printf(
"send len: %d\n",(
int)(
s-
buf));
386 for(
int i=0;
i<=ll/SIZEOF_LONG;
i++) printf(
"%ld ",d[
i]);
390 printf(
"read len: %d\n",(
int)(
s-
buf));
391 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 ...
int status int void * buf