My Project
Loading...
Searching...
No Matches
Macros | Typedefs | Functions | Variables
ntupel.cc File Reference
#include "misc/auxiliary.h"
#include "misc/mylimits.h"
#include "reporter/reporter.h"
#include "coeffs/numbers.h"
#include "coeffs/coeffs.h"
#include "coeffs/mpr_complex.h"
#include "coeffs/ntupel.h"
#include "coeffs/modulop.h"
#include "coeffs/longrat.h"

Go to the source code of this file.

Macros

#define SI_BUF_SIZE   1024
 

Typedefs

typedef coeffscoeffs_array
 
typedef number * number_array
 
typedef char si_char_SI_BUF_SIZE[SI_BUF_SIZE]
 

Functions

static void nnCoeffWrite (const coeffs r, BOOLEAN b)
 
static BOOLEAN nnGreaterZero (number k, const coeffs r)
 
static number nnMult (number a, number b, const coeffs r)
 
static void nnInpMult (number &a, number b, const coeffs r)
 
static number nnInit (long l, const coeffs r)
 
static long nnInt (number &n, const coeffs r)
 
static int nnSize (number n, const coeffs r)
 
static number nnCopy (number a, const coeffs r)
 
static number nnAdd (number a, number b, const coeffs r)
 
static void nnInpAdd (number &a, number b, const coeffs r)
 
static number nnSub (number a, number b, const coeffs r)
 
static BOOLEAN nnIsZero (number a, const coeffs r)
 
static BOOLEAN nnIsOne (number a, const coeffs r)
 
static BOOLEAN nnIsMOne (number a, const coeffs r)
 
static number nnDiv (number a, number b, const coeffs r)
 
static number nnInvers (number a, const coeffs r)
 
static number nnInpNeg (number a, const coeffs r)
 
static BOOLEAN nnGreater (number a, number b, const coeffs r)
 
static BOOLEAN nnEqual (number a, number b, const coeffs r)
 
static void nnWriteShort (number a, const coeffs r)
 
static void nnWriteLong (number a, const coeffs r)
 
static const char * nnRead (const char *s, number *a, const coeffs r)
 
static BOOLEAN nnDBTest (number a, const char *f, const int l, const coeffs r)
 
static number nnMap (number from, const coeffs aRing, const coeffs r)
 
static nMapFunc nnSetMap (const coeffs, const coeffs)
 
static char * nnCoeffString (const coeffs r)
 
static char * nnCoeffName (const coeffs r)
 
static void nnDelete (number *a, const coeffs r)
 
static number nnChineseRemainder (number *, number *, int, BOOLEAN, CFArray &, const coeffs)
 
BOOLEAN nnInitChar (coeffs n, void *p)
 Initialize r. More...
 

Variables

STATIC_VAR si_char_SI_BUF_SIZE nnCoeffName_buf
 

Macro Definition Documentation

◆ SI_BUF_SIZE

#define SI_BUF_SIZE   1024

Typedef Documentation

◆ coeffs_array

typedef coeffs* coeffs_array

Definition at line 24 of file ntupel.cc.

◆ number_array

typedef number* number_array

Definition at line 25 of file ntupel.cc.

◆ si_char_SI_BUF_SIZE

typedef char si_char_SI_BUF_SIZE[SI_BUF_SIZE]

Definition at line 572 of file ntupel.cc.

Function Documentation

◆ nnAdd()

static number nnAdd ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 165 of file ntupel.cc.

166{
169 coeffs_array d=(coeffs_array)r->data;
170 int i=0;
171 loop
172 {
173 i++;
174 if (d[i]==NULL) break;
175 }
176 number *C=(number*)omAlloc(i*sizeof(number));
177 i=0;
178 loop
179 {
180 C[i]=d[i]->cfAdd(A[i],B[i],d[i]);
181 i++;
182 if (d[i]==NULL) return (number)C;
183 }
184}
int i
Definition: cfEzgcd.cc:132
CanonicalForm b
Definition: cfModGcd.cc:4103
b *CanonicalForm B
Definition: facBivar.cc:52
if(!FE_OPT_NO_SHELL_FLAG)(void) system(sys)
The main handler for Singular numbers which are suitable for Singular polynomials.
coeffs * coeffs_array
Definition: ntupel.cc:24
number * number_array
Definition: ntupel.cc:25
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define NULL
Definition: omList.c:12
#define A
Definition: sirandom.c:24
#define loop
Definition: structs.h:75

◆ nnChineseRemainder()

static number nnChineseRemainder ( number *  ,
number *  ,
int  ,
BOOLEAN  ,
CFArray ,
const  coeffs 
)
static

Definition at line 609 of file ntupel.cc.

610{
611 WerrorS("not yet");
612 return NULL;
613}
void WerrorS(const char *s)
Definition: feFopen.cc:24

◆ nnCoeffName()

static char * nnCoeffName ( const coeffs  r)
static

Definition at line 574 of file ntupel.cc.

575{
576 coeffs_array d=(coeffs_array)r->data;
577 int i=0;
578 nnCoeffName_buf[0]='\0';
579 loop
580 {
581 char *s=d[i]->cfCoeffName(d[i]);
582 strncat(nnCoeffName_buf,s, SI_BUF_SIZE-strlen(nnCoeffName_buf)-strlen(s)-1);
583 i++;
584 if (d[i]==NULL) break;
585 strncat(nnCoeffName_buf," x ", SI_BUF_SIZE-strlen(nnCoeffName_buf)-4);
586 }
587 return nnCoeffName_buf;
588}
const CanonicalForm int s
Definition: facAbsFact.cc:51
STATIC_VAR si_char_SI_BUF_SIZE nnCoeffName_buf
Definition: ntupel.cc:573
#define SI_BUF_SIZE

◆ nnCoeffString()

static char * nnCoeffString ( const coeffs  r)
static

Definition at line 554 of file ntupel.cc.

555{
556 #define SI_BUF_SIZE 1024
557 char buf[SI_BUF_SIZE];
558 coeffs_array d=(coeffs_array)r->data;
559 int i=0;
560 buf[0]='\0';
561 loop
562 {
563 char *s=d[i]->cfCoeffName(d[i]);
564 strncat(buf,s, SI_BUF_SIZE-strlen(buf)-strlen(s)-1);
565 i++;
566 if (d[i]==NULL) break;
567 strncat(buf," x ", SI_BUF_SIZE-strlen(buf)-4);
568 }
569 return omStrDup(buf);
570}
#define omStrDup(s)
Definition: omAllocDecl.h:263
int status int void * buf
Definition: si_signals.h:59

◆ nnCoeffWrite()

static void nnCoeffWrite ( const coeffs  r,
BOOLEAN  b 
)
static

Definition at line 27 of file ntupel.cc.

28{
29 int i=0;
30 coeffs_array d=(coeffs_array)r->data;
31 loop
32 {
33 d[i]->cfCoeffWrite(d[i],b);
34 i++;
35 if (d[i]==NULL) break;
36 PrintS(" x ");
37 }
38}
void PrintS(const char *s)
Definition: reporter.cc:284

◆ nnCopy()

static number nnCopy ( number  a,
const coeffs  r 
)
static

Definition at line 145 of file ntupel.cc.

146{
148 coeffs_array d=(coeffs_array)r->data;
149 int i=0;
150 loop
151 {
152 i++;
153 if (d[i]==NULL) break;
154 }
155 number *C=(number*)omAlloc(i*sizeof(number));
156 i=0;
157 loop
158 {
159 C[i]=d[i]->cfCopy(A[i],d[i]);
160 i++;
161 if (d[i]==NULL) return (number)C;
162 }
163}

◆ nnDBTest()

static BOOLEAN nnDBTest ( number  a,
const char *  f,
const int  l,
const coeffs  r 
)
static

Definition at line 512 of file ntupel.cc.

513{
514 BOOLEAN bo=FALSE;
516 coeffs_array d=(coeffs_array)r->data;
517 int i=0;
518 loop
519 {
520 bo&=d[i]->cfDBTest(A[i],f,l,d[i]);
521 i++;
522 if (d[i]==NULL) return bo;
523 }
524}
int BOOLEAN
Definition: auxiliary.h:87
#define FALSE
Definition: auxiliary.h:96
int l
Definition: cfEzgcd.cc:100
FILE * f
Definition: checklibs.c:9

◆ nnDelete()

static void nnDelete ( number *  a,
const coeffs  r 
)
static

Definition at line 590 of file ntupel.cc.

591{
592 if (*a!=NULL)
593 {
594 coeffs_array d=(coeffs_array)r->data;
596 int i=0;
597 loop
598 {
599 d[i]->cfDelete(&(A[i]),d[i]);
600 i++;
601 if (d[i]==NULL) break;
602 }
603 omFreeSize(d,i*sizeof(number));
604 *a=NULL;
605 }
606}
#define omFreeSize(addr, size)
Definition: omAllocDecl.h:260

◆ nnDiv()

static number nnDiv ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 260 of file ntupel.cc.

261{
262 if (nnIsZero(b,r))
263 {
265 return nnInit(0,r);
266 }
269 coeffs_array d=(coeffs_array)r->data;
270 int i=0;
271 loop
272 {
273 i++;
274 if (d[i]==NULL) break;
275 }
276 number *C=(number*)omAlloc(i*sizeof(number));
277 i=0;
278 loop
279 {
280 C[i]=d[i]->cfDiv(A[i],B[i],d[i]);
281 i++;
282 if (d[i]==NULL) return (number)C;
283 }
284}
static BOOLEAN nnIsZero(number a, const coeffs r)
Definition: ntupel.cc:221
static number nnInit(long l, const coeffs r)
Definition: ntupel.cc:92
const char *const nDivBy0
Definition: numbers.h:89

◆ nnEqual()

static BOOLEAN nnEqual ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 348 of file ntupel.cc.

349{
350 int i=0;
353 coeffs_array d=(coeffs_array)r->data;
354 loop
355 {
356 if (!d[i]->cfEqual(A[i],B[i],d[i])) return FALSE;
357 i++;
358 if (d[i]==NULL) return TRUE;
359 }
360}
#define TRUE
Definition: auxiliary.h:100

◆ nnGreater()

static BOOLEAN nnGreater ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 330 of file ntupel.cc.

331{
334 coeffs_array d=(coeffs_array)r->data;
335 int i=0;
336 loop
337 {
338 if (d[i]->type==n_R) return d[i]->cfGreater(A[i],B[i],d[i]);
339 else if (d[i]->type==n_long_R) return d[i]->cfGreater(A[i],B[i],d[i]);
340 i++;
341 if (d[i]==NULL)
342 {
343 return d[i-1]->cfGreater(A[i],B[i],d[i-1]);
344 }
345 }
346}
@ n_R
single prescision (6,6) real numbers
Definition: coeffs.h:31
@ n_long_R
real floating point (GMP) numbers
Definition: coeffs.h:33

◆ nnGreaterZero()

static BOOLEAN nnGreaterZero ( number  k,
const coeffs  r 
)
static

Definition at line 41 of file ntupel.cc.

42{
43 int i=0;
44 coeffs_array d=(coeffs_array)r->data;
45 loop
46 {
47 if (d[i]->type==n_R) return d[i]->cfGreaterZero(k,d[i]);
48 if (d[i]->type==n_long_R) return d[i]->cfGreaterZero(k,d[i]);
49 i++;
50 if (d[i]==NULL) return d[i-1]->cfGreaterZero(k,d[i-1]);
51 }
52}
int k
Definition: cfEzgcd.cc:99

◆ nnInit()

static number nnInit ( long  l,
const coeffs  r 
)
static

Definition at line 92 of file ntupel.cc.

93{
94 coeffs_array d=(coeffs_array)r->data;
95 int i=0;
96 loop
97 {
98 i++;
99 if (d[i]==NULL) break;
100 }
101 number *C=(number*)omAlloc(i*sizeof(number));
102 i=0;
103 loop
104 {
105 C[i]=d[i]->cfInit(l,d[i]);
106 i++;
107 if (d[i]==NULL) return (number)C;
108 }
109}

◆ nnInitChar()

BOOLEAN nnInitChar ( coeffs  n,
void *  p 
)

Initialize r.

Definition at line 616 of file ntupel.cc.

617{
618 n->data=p;
619 n->type=n_nTupel;
620 n->is_field=TRUE;
621 n->is_domain=TRUE;
622
623 n->ch = 0;
624 n->cfCoeffString = nnCoeffString;
625 n->cfCoeffName = nnCoeffName;
626
627 n->cfInit = nnInit;
628 n->cfDelete = nnDelete;
629 n->cfInt = nnInt;
630 n->cfAdd = nnAdd;
631 n->cfInpAdd = nnInpAdd;
632 n->cfSub = nnSub;
633 n->cfMult = nnMult;
634 n->cfInpMult = nnInpMult;
635 n->cfDiv = nnDiv;
636 n->cfExactDiv= nnDiv;
637 n->cfInpNeg = nnInpNeg;
638 n->cfInvers= nnInvers;
639 n->cfCopy = nnCopy;
640 n->cfGreater = nnGreater;
641 n->cfEqual = nnEqual;
642 n->cfIsZero = nnIsZero;
643 n->cfIsOne = nnIsOne;
644 n->cfIsMOne = nnIsMOne;
645 n->cfGreaterZero = nnGreaterZero;
646 n->cfWriteShort = nnWriteShort;
647 n->cfWriteLong = nnWriteLong;
648 n->cfRead = nnRead;
649 //n->cfPower = nnPower;
650 n->cfSetMap = nnSetMap;
651 n->cfCoeffWrite = nnCoeffWrite;
652
653 n->cfChineseRemainder=nnChineseRemainder;
654 n->cfSize = nnSize;
655#ifdef LDEBUG
656 n->cfDBTest=nnDBTest;
657#endif
658 //n->nCoeffIsEqual = ndCoeffIsEqual;
659 return FALSE;
660}
int p
Definition: cfModGcd.cc:4078
@ n_nTupel
n-tupel of cf: ZZ/p1,... ZZ/pn, R, long_R
Definition: coeffs.h:42
static char * nnCoeffName(const coeffs r)
Definition: ntupel.cc:574
static BOOLEAN nnDBTest(number a, const char *f, const int l, const coeffs r)
Definition: ntupel.cc:512
static BOOLEAN nnIsMOne(number a, const coeffs r)
Definition: ntupel.cc:247
static number nnCopy(number a, const coeffs r)
Definition: ntupel.cc:145
static number nnDiv(number a, number b, const coeffs r)
Definition: ntupel.cc:260
static number nnAdd(number a, number b, const coeffs r)
Definition: ntupel.cc:165
static void nnDelete(number *a, const coeffs r)
Definition: ntupel.cc:590
static number nnInpNeg(number a, const coeffs r)
Definition: ntupel.cc:311
static void nnWriteShort(number a, const coeffs r)
Definition: ntupel.cc:362
static BOOLEAN nnEqual(number a, number b, const coeffs r)
Definition: ntupel.cc:348
static long nnInt(number &n, const coeffs r)
Definition: ntupel.cc:114
static number nnMult(number a, number b, const coeffs r)
Definition: ntupel.cc:54
static BOOLEAN nnGreaterZero(number k, const coeffs r)
Definition: ntupel.cc:41
static const char * nnRead(const char *s, number *a, const coeffs r)
Definition: ntupel.cc:411
static BOOLEAN nnGreater(number a, number b, const coeffs r)
Definition: ntupel.cc:330
static nMapFunc nnSetMap(const coeffs, const coeffs)
Definition: ntupel.cc:549
static number nnInvers(number a, const coeffs r)
Definition: ntupel.cc:286
static number nnSub(number a, number b, const coeffs r)
Definition: ntupel.cc:200
static void nnCoeffWrite(const coeffs r, BOOLEAN b)
Definition: ntupel.cc:27
static BOOLEAN nnIsOne(number a, const coeffs r)
Definition: ntupel.cc:234
static int nnSize(number n, const coeffs r)
Definition: ntupel.cc:127
static number nnChineseRemainder(number *, number *, int, BOOLEAN, CFArray &, const coeffs)
Definition: ntupel.cc:609
static void nnInpAdd(number &a, number b, const coeffs r)
Definition: ntupel.cc:186
static void nnWriteLong(number a, const coeffs r)
Definition: ntupel.cc:376
static void nnInpMult(number &a, number b, const coeffs r)
Definition: ntupel.cc:75
static char * nnCoeffString(const coeffs r)
Definition: ntupel.cc:554

◆ nnInpAdd()

static void nnInpAdd ( number &  a,
number  b,
const coeffs  r 
)
static

Definition at line 186 of file ntupel.cc.

187{
190 coeffs_array d=(coeffs_array)r->data;
191 int i=0;
192 loop
193 {
194 d[i]->cfInpAdd(A[i],B[i],d[i]);
195 i++;
196 if (d[i]==NULL) return;
197 }
198}

◆ nnInpMult()

static void nnInpMult ( number &  a,
number  b,
const coeffs  r 
)
static

Definition at line 75 of file ntupel.cc.

76{
79 coeffs_array d=(coeffs_array)r->data;
80 int i=0;
81 loop
82 {
83 d[i]->cfInpMult(A[i],B[i],d[i]);
84 i++;
85 if (d[i]==NULL) return;
86 }
87}

◆ nnInpNeg()

static number nnInpNeg ( number  a,
const coeffs  r 
)
static

Definition at line 311 of file ntupel.cc.

312{
314 coeffs_array d=(coeffs_array)r->data;
315 int i=0;
316 loop
317 {
318 i++;
319 if (d[i]==NULL) break;
320 }
321 i=0;
322 loop
323 {
324 A[i]=d[i]->cfInpNeg(A[i],d[i]);
325 i++;
326 if (d[i]==NULL) return (number)A;
327 }
328}

◆ nnInt()

static long nnInt ( number &  n,
const coeffs  r 
)
static

Definition at line 114 of file ntupel.cc.

115{
116 int i=0;
117 coeffs_array d=(coeffs_array)r->data;
118 loop
119 {
120 if (d[i]->type==n_R) return d[i]->cfInt(n,d[i]);
121 if (d[i]->type==n_long_R) return d[i]->cfInt(n,d[i]);
122 i++;
123 if (d[i]==NULL) return d[i-1]->cfInt(n,d[i-1]);
124 }
125}

◆ nnInvers()

static number nnInvers ( number  a,
const coeffs  r 
)
static

Definition at line 286 of file ntupel.cc.

287{
288 if (nnIsZero(a,r))
289 {
291 return nnInit(0,r);
292 }
294 coeffs_array d=(coeffs_array)r->data;
295 int i=0;
296 loop
297 {
298 i++;
299 if (d[i]==NULL) break;
300 }
301 number *C=(number*)omAlloc(i*sizeof(number));
302 i=0;
303 loop
304 {
305 C[i]=d[i]->cfInvers(A[i],d[i]);
306 i++;
307 if (d[i]==NULL) return (number)C;
308 }
309}

◆ nnIsMOne()

static BOOLEAN nnIsMOne ( number  a,
const coeffs  r 
)
static

Definition at line 247 of file ntupel.cc.

248{
249 int i=0;
251 coeffs_array d=(coeffs_array)r->data;
252 loop
253 {
254 if (!d[i]->cfIsMOne(A[i],d[i])) return FALSE;
255 i++;
256 if (d[i]==NULL) return TRUE;
257 }
258}

◆ nnIsOne()

static BOOLEAN nnIsOne ( number  a,
const coeffs  r 
)
static

Definition at line 234 of file ntupel.cc.

235{
236 int i=0;
238 coeffs_array d=(coeffs_array)r->data;
239 loop
240 {
241 if (!d[i]->cfIsOne(A[i],d[i])) return FALSE;
242 i++;
243 if (d[i]==NULL) return TRUE;
244 }
245}

◆ nnIsZero()

static BOOLEAN nnIsZero ( number  a,
const coeffs  r 
)
static

Definition at line 221 of file ntupel.cc.

222{
224 coeffs_array d=(coeffs_array)r->data;
225 int i=0;
226 loop
227 {
228 if (!d[i]->cfIsZero(A[i],d[i])) return FALSE;
229 i++;
230 if (d[i]==NULL) return TRUE;
231 }
232}

◆ nnMap()

static number nnMap ( number  from,
const coeffs  aRing,
const coeffs  r 
)
static

Definition at line 527 of file ntupel.cc.

528{
529 coeffs_array d=(coeffs_array)r->data;
530 int i=0;
531 loop
532 {
533 i++;
534 if (d[i]==NULL) break;
535 }
536 number *C=(number*)omAlloc(i*sizeof(number));
537 nMapFunc nMap;
538 i=0;
539 loop
540 {
541 nMap=d[i]->cfSetMap(aRing,d[i]);
542 if (nMap==NULL) Werror("no map for compoment %d",i);
543 else C[i]=nMap(from,aRing,d[i]);
544 i++;
545 if (d[i]==NULL) return (number)C;
546 }
547}
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
void Werror(const char *fmt,...)
Definition: reporter.cc:189

◆ nnMult()

static number nnMult ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 54 of file ntupel.cc.

55{
58 coeffs_array d=(coeffs_array)r->data;
59 int i=0;
60 loop
61 {
62 i++;
63 if (d[i]==NULL) break;
64 }
65 number *C=(number*)omAlloc(i*sizeof(number));
66 i=0;
67 loop
68 {
69 C[i]=d[i]->cfMult(A[i],B[i],d[i]);
70 i++;
71 if (d[i]==NULL) return (number)C;
72 }
73}

◆ nnRead()

static const char * nnRead ( const char *  s,
number *  a,
const coeffs  r 
)
static

Definition at line 411 of file ntupel.cc.

412{
413 // reading R/longR part, setting everything else to random
414 coeffs_array d=(coeffs_array)r->data;
415 int i=0;
416 loop
417 {
418 i++;
419 if (d[i]==NULL) break;
420 }
421 number *C=(number*)omAlloc0(i*sizeof(number));
422 *a=(number)C;
423 int is_zero=2; /*1: read 0, 2: read <> 0 */
424 int reader=-1;
425 i=0;
426 loop
427 {
428 if ((d[i]->type==n_R)
429 || (d[i]->type==n_long_R))
430 {
431 s=d[i]->cfRead(s,&(C[i]),d[i]);
432 is_zero=d[i]->cfIsZero(C[i],d[i]);
433 reader=i;
434 break;
435 }
436 i++;
437 if (d[i]==NULL)
438 {
439 s=d[i-1]->cfRead(s,&(C[i-1]),d[i-1]);
440 is_zero=d[i-1]->cfIsZero(C[i-1],d[i-1]);
441 reader=i-1;
442 break;
443 }
444 }
445 if (is_zero==0)
446 { // seting random values!=0 for Z/p
447 i=0;
448 loop
449 {
450 if (i!=reader)
451 {
452 if (d[i]->type==n_Zp)
453 {
454 int l=0;
455 do
456 {
457 l=siRand();
458 } while(l%(d[i]->ch)==0);
459 C[i]=d[i]->cfInit(l,d[i]);
460 }
461 else if ((d[i]->type==n_R)
462 || (d[i]->type==n_long_R))
463 {
464 nMapFunc nMap=d[i]->cfSetMap(d[reader],d[i]);
465 C[i]=nMap(C[reader],d[reader],d[i]);
466 }
467 else
468 {
469 WerrorS("reading is not suppiorted for such compinations of coeffs");
470 break;
471 }
472 }
473 i++;
474 if (d[i]==NULL) break;
475 }
476 }
477 else if (is_zero==1)
478 { // read a zero
479 i=0;
480 loop
481 {
482 C[i]=d[i]->cfInit(0,d[i]);
483 i++;
484 if (d[i]==NULL) break;
485 }
486 }
487 else if (reader==-1)/* not R or long_R*/
488 {
489 s=d[0]->cfRead(s,&(C[0]),d[0]);
490 i=1;
491 loop
492 {
493 if (d[i]==NULL) break;
494 i++;
495 {
496 nMapFunc nMap=d[i]->cfSetMap(d[0],d[i]);
497 C[i]=nMap(C[0],d[0],d[i]);
498 }
499 }
500 }
501 else
502 {
503 WerrorS("nnRead: should not happen");
504 }
505 return s;
506}
@ n_Zp
\F{p < 2^31}
Definition: coeffs.h:29
#define omAlloc0(size)
Definition: omAllocDecl.h:211
int siRand()
Definition: sirandom.c:42

◆ nnSetMap()

static nMapFunc nnSetMap ( const  coeffs,
const  coeffs 
)
static

Definition at line 549 of file ntupel.cc.

550{
551 return nnMap;
552}
static number nnMap(number from, const coeffs aRing, const coeffs r)
Definition: ntupel.cc:527

◆ nnSize()

static int nnSize ( number  n,
const coeffs  r 
)
static

Definition at line 127 of file ntupel.cc.

128{
129 int s=0;
130 int i=0;
131 coeffs_array d=(coeffs_array)r->data;
132 loop
133 {
134 if (d[i]->type==n_R) s+=d[i]->cfSize(n,d[i]);
135 else if (d[i]->type==n_long_R) s+=d[i]->cfSize(n,d[i]);
136 i++;
137 if (d[i]==NULL)
138 {
139 if (s==0) return d[i-1]->cfSize(n,d[i-1]);
140 else return s;
141 }
142 }
143}

◆ nnSub()

static number nnSub ( number  a,
number  b,
const coeffs  r 
)
static

Definition at line 200 of file ntupel.cc.

201{
204 coeffs_array d=(coeffs_array)r->data;
205 int i=0;
206 loop
207 {
208 i++;
209 if (d[i]==NULL) break;
210 }
211 number *C=(number*)omAlloc(i*sizeof(number));
212 i=0;
213 loop
214 {
215 C[i]=d[i]->cfSub(A[i],B[i],d[i]);
216 i++;
217 if (d[i]==NULL) return (number)C;
218 }
219}

◆ nnWriteLong()

static void nnWriteLong ( number  a,
const coeffs  r 
)
static

Definition at line 376 of file ntupel.cc.

377{
379 coeffs_array d=(coeffs_array)r->data;
380 int i=0;
381 StringSetS("(");
382 loop
383 {
384 d[i]->cfWriteLong(A[i],d[i]);
385 i++;
386 if (d[i]==NULL) {StringAppendS(")"); return; }
387 else StringAppendS(",");
388 }
389}
void StringSetS(const char *st)
Definition: reporter.cc:128
void StringAppendS(const char *st)
Definition: reporter.cc:107

◆ nnWriteShort()

static void nnWriteShort ( number  a,
const coeffs  r 
)
static

Definition at line 362 of file ntupel.cc.

363{
365 coeffs_array d=(coeffs_array)r->data;
366 int i=0;
367 loop
368 {
369 if (d[i]->type==n_R) { d[i]->cfWriteLong(A[i],d[i]); return; }
370 else if (d[i]->type==n_long_R) {d[i]->cfWriteLong(A[i],d[i]); return; }
371 i++;
372 if (d[i]==NULL) { d[i-1]->cfWriteLong(A[i-1],d[i-1]); return; }
373 }
374}

Variable Documentation

◆ nnCoeffName_buf

Definition at line 573 of file ntupel.cc.