gnumpfl.cc
Go to the documentation of this file.
1 /****************************************
2 * Computer Algebra System SINGULAR *
3 ****************************************/
4 /*
5 * ABSTRACT: computations with GMP floating-point numbers
6 *
7 * ngf == number gnu floats
8 */
9 
10 #include <misc/auxiliary.h>
11 #include <omalloc/omalloc.h>
12 
13 #include <reporter/reporter.h>
14 
15 #include "coeffs.h"
16 #include "numbers.h"
17 #include "mpr_complex.h"
18 
19 #include "longrat.h"
20 #include "shortfl.h"
21 #include "gnumpfl.h"
22 #include "modulop.h"
23 
24 //ring ngfMapRing; // to be used also in gnumpc.cc
25 
26 /// Get a mapping function from src into the domain of this type:
27 nMapFunc ngfSetMap(const coeffs src, const coeffs dst);
28 
29 const char * ngfRead (const char *s, number *a, const coeffs r);
30 
31  // Private interface should be hidden!!!
32 /// Note: MAY NOT WORK AS EXPECTED!
33 BOOLEAN ngfGreaterZero(number za, const coeffs r);
34 BOOLEAN ngfGreater(number a, number b, const coeffs r);
35 BOOLEAN ngfEqual(number a, number b, const coeffs r);
36 BOOLEAN ngfIsOne(number a, const coeffs r);
37 BOOLEAN ngfIsMOne(number a, const coeffs r);
38 BOOLEAN ngfIsZero(number za, const coeffs r);
39 number ngfInit(long i, const coeffs r);
40 long ngfInt(number &n, const coeffs r);
41 number ngfNeg(number za, const coeffs r);
42 number ngfInvers(number a, const coeffs r);
43 number ngfAdd(number la, number li, const coeffs r);
44 number ngfSub(number la, number li, const coeffs r);
45 number ngfMult(number a, number b, const coeffs r);
46 number ngfDiv(number a, number b, const coeffs r);
47 void ngfPower(number x, int exp, number *lu, const coeffs r);
48 number ngfCopy(number a, const coeffs r);
49 number ngf_Copy(number a, coeffs r);
50 void ngfWrite(number a, const coeffs r);
51 void ngfCoeffWrite(const coeffs r, BOOLEAN details);
52 
53 void ngfDelete(number *a, const coeffs r);
54 
55 number ngfMapQ(number from, const coeffs src, const coeffs r);
56 
57 union nf
58 {
59  float _f;
60  number _n;
61  nf(float f) {_f = f;}
62  nf(number n) {_n = n;}
63  float F() const {return _f;}
64  number N() const {return _n;}
65 };
66 
67 /*2
68 * n := i
69 */
70 number ngfInit (long i, const coeffs r)
71 {
72  assume( getCoeffType(r) == n_long_R );
73 
74  gmp_float* n= new gmp_float( (double)i );
75  return (number)n;
76 }
77 
78 /*2
79 * convert number to int
80 */
81 long ngfInt(number &i, const coeffs r)
82 {
83  assume( getCoeffType(r) == n_long_R );
84 
85  double d=(double)*(gmp_float*)i;
86  if (d<0.0)
87  return (long)(d-0.5);
88  else
89  return (long)(d+0.5);
90 }
91 
92 int ngfSize(number n, const coeffs r)
93 {
94  long i = ngfInt(n, r);
95  /* basically return the largest integer in n;
96  only if this happens to be zero although n != 0,
97  return 1;
98  (this code ensures that zero has the size zero) */
99  if ((i == 0) && (ngfIsZero(n,r) == FALSE)) i = 1;
100  return i;
101 }
102 
103 /*2
104 * delete a
105 */
106 void ngfDelete (number * a, const coeffs r)
107 {
108  assume( getCoeffType(r) == n_long_R );
109 
110  if ( *a != NULL )
111  {
112  delete *(gmp_float**)a;
113  *a=NULL;
114  }
115 }
116 
117 /*2
118 * copy a to b
119 */
120 number ngfCopy(number a, const coeffs r)
121 {
122  assume( getCoeffType(r) == n_long_R );
123 
124  gmp_float* b= new gmp_float( *(gmp_float*)a );
125  return (number)b;
126 }
127 
128 #if 0
129 static number ngfCopyMap(number a, const coeffs r1, const coeffs r2)
130 {
131  assume( getCoeffType(r1) == n_long_R );
132  assume( getCoeffType(r2) == n_long_R );
133 
134  gmp_float* b= NULL;
135  if ( a != NULL )
136  {
137  b= new gmp_float( *(gmp_float*)a );
138  }
139  return (number)b;
140 }
141 #endif
142 
143 /*2
144 * za:= - za
145 */
146 number ngfNeg (number a, const coeffs r)
147 {
148  assume( getCoeffType(r) == n_long_R );
149 
150  *(gmp_float*)a= -(*(gmp_float*)a);
151  return (number)a;
152 }
153 
154 /*
155 * 1/a
156 */
157 number ngfInvers(number a, const coeffs r)
158 {
159  assume( getCoeffType(r) == n_long_R );
160 
161  gmp_float* f= NULL;
162  if (((gmp_float*)a)->isZero() )
163  {
164  WerrorS(nDivBy0);
165  }
166  else
167  {
168  f= new gmp_float( gmp_float(1) / (*(gmp_float*)a) );
169  }
170  return (number)f;
171 }
172 
173 /*2
174 * u:= a + b
175 */
176 number ngfAdd (number a, number b, const coeffs R)
177 {
178  assume( getCoeffType(R) == n_long_R );
179 
180  gmp_float* r= new gmp_float( (*(gmp_float*)a) + (*(gmp_float*)b) );
181  return (number)r;
182 }
183 
184 /*2
185 * u:= a - b
186 */
187 number ngfSub (number a, number b, const coeffs R)
188 {
189  assume( getCoeffType(R) == n_long_R );
190 
191  gmp_float* r= new gmp_float( (*(gmp_float*)a) - (*(gmp_float*)b) );
192  return (number)r;
193 }
194 
195 /*2
196 * u := a * b
197 */
198 number ngfMult (number a, number b, const coeffs R)
199 {
200  assume( getCoeffType(R) == n_long_R );
201 
202  gmp_float* r= new gmp_float( (*(gmp_float*)a) * (*(gmp_float*)b) );
203  return (number)r;
204 }
205 
206 /*2
207 * u := a / b
208 */
209 number ngfDiv (number a, number b, const coeffs r)
210 {
211  assume( getCoeffType(r) == n_long_R );
212 
213  if ( ((gmp_float*)b)->isZero() )
214  {
215  // a/0 = error
216  WerrorS(nDivBy0);
217  return NULL;
218  }
219  gmp_float* f= new gmp_float( (*(gmp_float*)a) / (*(gmp_float*)b) );
220  return (number)f;
221 }
222 
223 /*2
224 * u:= x ^ exp
225 */
226 number ngfPower (number x, int exp, const coeffs r)
227 {
228  assume( getCoeffType(r) == n_long_R );
229 
230  if ( exp == 0 )
231  {
232  gmp_float* n = new gmp_float(1);
233  return (number)n;
234  }
235  else if ( ngfIsZero(x, r) ) // 0^e, e>0
236  {
237  return ngfInit(0, r);
238  }
239  else if ( exp == 1 )
240  {
241  return ngfCopy(x,r);
242  }
243  return (number) ( new gmp_float( (*(gmp_float*)x)^exp ) );
244 }
245 
246 /* kept for compatibility reasons, to be deleted */
247 void ngfPower ( number x, int exp, number * u, const coeffs r )
248 {
249  *u = ngfPower(x, exp, r);
250 }
251 
252 BOOLEAN ngfIsZero (number a, const coeffs r)
253 {
254  assume( getCoeffType(r) == n_long_R );
255 
256  return ( ((gmp_float*)a)->isZero() );
257 }
258 
259 /*2
260 * za > 0 ?
261 */
262 BOOLEAN ngfGreaterZero (number a, const coeffs r)
263 {
264  assume( getCoeffType(r) == n_long_R );
265 
266  return (((gmp_float*)a)->sign() > 0);
267 }
268 
269 /*2
270 * a > b ?
271 */
272 BOOLEAN ngfGreater (number a, number b, const coeffs r)
273 {
274  assume( getCoeffType(r) == n_long_R );
275 
276  return ( (*(gmp_float*)a) > (*(gmp_float*)b) );
277 }
278 
279 /*2
280 * a = b ?
281 */
282 BOOLEAN ngfEqual (number a, number b, const coeffs r)
283 {
284  assume( getCoeffType(r) == n_long_R );
285 
286  return ( (*(gmp_float*)a) == (*(gmp_float*)b) );
287 }
288 
289 /*2
290 * a == 1 ?
291 */
292 BOOLEAN ngfIsOne (number a, const coeffs r)
293 {
294  assume( getCoeffType(r) == n_long_R );
295 
296  return ((gmp_float*)a)->isOne();
297 }
298 
299 /*2
300 * a == -1 ?
301 */
302 BOOLEAN ngfIsMOne (number a, const coeffs r)
303 {
304  assume( getCoeffType(r) == n_long_R );
305 
306  return ((gmp_float*)a)->isMOne();
307 }
308 
309 static char * ngfEatFloatNExp(char * s )
310 {
311  char *start= s;
312 
313  // eat floats (mantissa) like:
314  // 0.394394993, 102.203003008, .300303032, pssibly starting with -
315  if (*s == '-') s++;
316  while ((*s >= '0' && *s <= '9')||(*s == '.')) s++;
317 
318  // eat the exponent, starts with 'e' followed by '+', '-'
319  // and digits, like:
320  // e-202, e+393, accept also E7
321  if ( (s != start) && ((*s == 'e')||(*s=='E')))
322  {
323  if (*s=='E') *s='e';
324  s++; // skip 'e'/'E'
325  if ((*s == '+') || (*s == '-')) s++;
326  while ((*s >= '0' && *s <= '9')) s++;
327  }
328 
329  return s;
330 }
331 
332 /*2
333 * extracts the number a from s, returns the rest
334 *
335 * This is also called to print components of complex coefficients.
336 * Handle with care!
337 */
338 const char * ngfRead (const char * start, number * a, const coeffs r)
339 {
341 
342  char *s= (char *)start;
343 
344  //Print("%s\n",s);
345 
346  s= ngfEatFloatNExp( s );
347 
348  if (*s=='\0') // 0
349  {
350  if ( *(gmp_float**)a == NULL ) (*(gmp_float**)a)= new gmp_float();
351  (*(gmp_float**)a)->setFromStr(start);
352  }
353  else if (s==start) // 1
354  {
355  if ( *(gmp_float**)a != NULL ) delete (*(gmp_float**)a);
356  (*(gmp_float**)a)= new gmp_float(1);
357  }
358  else
359  {
360  gmp_float divisor(1.0);
361  char *start2=s;
362  if ( *s == '/' )
363  {
364  s++;
365  s= ngfEatFloatNExp( (char *)s );
366  if (s!= start2+1)
367  {
368  char tmp_c=*s;
369  *s='\0';
370  divisor.setFromStr(start2+1);
371  *s=tmp_c;
372  }
373  else
374  {
375  Werror("wrong long real format: %s",start2);
376  }
377  }
378  char c=*start2;
379  *start2='\0';
380  if ( *(gmp_float**)a == NULL ) (*(gmp_float**)a)= new gmp_float();
381  (*(gmp_float**)a)->setFromStr(start);
382  *start2=c;
383  if (divisor.isZero())
384  {
385  WerrorS(nDivBy0);
386  }
387  else
388  (**(gmp_float**)a) /= divisor;
389  }
390 
391  return s;
392 }
393 
394 /*2
395 * write a floating point number
396 */
397 void ngfWrite (number a, const coeffs r)
398 {
399  assume( getCoeffType(r) == n_long_R );
400 
401  char *out;
402  if ( a != NULL )
403  {
404  out= floatToStr(*(gmp_float*)a, r->float_len);
405  StringAppendS(out);
406  //omFreeSize((void *)out, (strlen(out)+1)* sizeof(char) );
407  omFree( (void *)out );
408  }
409  else
410  {
411  StringAppendS("0");
412  }
413 }
414 
415 BOOLEAN ngfCoeffIsEqual (const coeffs r, n_coeffType n, void * parameter)
416 {
417  if (n==n_long_R)
418  {
419  LongComplexInfo* p = (LongComplexInfo *)(parameter);
420  if ((p!=NULL)
421  && (p->float_len == r->float_len)
422  && (p->float_len2 == r->float_len2))
423  return TRUE;
424  }
425  return FALSE;
426 }
427 
428 void ngfSetChar(const coeffs r)
429 {
430  setGMPFloatDigits(r->float_len, r->float_len2);
431 }
432 
433 static char* ngfCoeffString(const coeffs r)
434 {
435  char *s=(char*)omAlloc(27);
436  snprintf(s,27,"real,%d,%d",r->float_len,r->float_len2);
437  return s;
438 }
439 
440 BOOLEAN ngfInitChar(coeffs n, void *parameter)
441 {
442  assume( getCoeffType(n) == n_long_R );
443 
444  n->is_field=TRUE;
445  n->is_domain=TRUE;
446  n->rep=n_rep_gmp_float;
447 
448  //n->cfKillChar = ndKillChar; /* dummy */
449 
450  n->cfSetChar = ngfSetChar;
451  n->ch = 0;
452  n->cfCoeffString=ngfCoeffString;
453 
454  n->cfDelete = ngfDelete;
455  //n->cfNormalize=ndNormalize;
456  n->cfInit = ngfInit;
457  n->cfInt = ngfInt;
458  n->cfAdd = ngfAdd;
459  n->cfSub = ngfSub;
460  n->cfMult = ngfMult;
461  n->cfDiv = ngfDiv;
462  n->cfExactDiv= ngfDiv;
463  n->cfInpNeg = ngfNeg;
464  n->cfInvers = ngfInvers;
465  n->cfCopy = ngfCopy;
466  n->cfGreater = ngfGreater;
467  n->cfEqual = ngfEqual;
468  n->cfIsZero = ngfIsZero;
469  n->cfIsOne = ngfIsOne;
470  n->cfIsMOne = ngfIsMOne;
471  n->cfGreaterZero = ngfGreaterZero;
472  n->cfWriteLong = ngfWrite;
473  n->cfRead = ngfRead;
474  n->cfPower = ngfPower;
475  n->cfSetMap = ngfSetMap;
476  n->cfCoeffWrite = ngfCoeffWrite;
477 #ifdef LDEBUG
478  //n->cfDBTest = ndDBTest; // not yet implemented: ngfDBTest
479 #endif
480 
481  n->nCoeffIsEqual = ngfCoeffIsEqual;
482 
483  if( parameter != NULL)
484  {
485  LongComplexInfo* p = (LongComplexInfo*)parameter;
486 
487  n->float_len = p->float_len;
488  n->float_len2 = p->float_len2;
489  } else // default values, just for testing!
490  {
491  n->float_len = SHORT_REAL_LENGTH;
492  n->float_len2 = SHORT_REAL_LENGTH;
493  }
494 
495  assume( n->float_len2 >= SHORT_REAL_LENGTH );
496 
497  assume( n_NumberOfParameters(n) == 0 );
498  assume( n_ParameterNames(n) == NULL );
499 
500  return FALSE;
501 }
502 
503 number ngfMapQ(number from, const coeffs src, const coeffs dst)
504 {
505  assume( getCoeffType(dst) == n_long_R );
506  assume( src->rep == n_rep_gap_rat );
507 
509  return (number)res;
510 }
511 number ngfMapZ(number from, const coeffs aRing, const coeffs r)
512 {
513  assume( getCoeffType(r) == n_long_R );
514  assume( aRing->rep == n_rep_gap_gmp);
515 
516  if ( from != NULL )
517  {
518  if (SR_HDL(from) & SR_INT)
519  {
520  gmp_float f_i= gmp_float(SR_TO_INT(from));
521  gmp_float *res=new gmp_float(f_i);
522  return (number)res;
523  }
524  gmp_float f_i=(mpz_ptr)from;
525  gmp_float *res=new gmp_float(f_i);
526  return (number)res;
527  }
528  else
529  return NULL;
530 }
531 
532 
533 static number ngfMapR(number from, const coeffs src, const coeffs dst)
534 {
535  assume( getCoeffType(dst) == n_long_R );
536  assume( getCoeffType(src) == n_R );
537 
538  gmp_float *res=new gmp_float((double)nf(from).F());
539  return (number)res;
540 }
541 
542 static number ngfMapP(number from, const coeffs src, const coeffs dst)
543 {
544  assume( getCoeffType(dst) == n_long_R );
545  assume( getCoeffType(src) == n_Zp );
546 
547  return ngfInit(npInt(from,src), dst); // FIXME? TODO? // extern int npInt (number &n, const coeffs r);
548 }
549 
550 static number ngfMapC(number from, const coeffs src, const coeffs dst)
551 {
552  assume( getCoeffType(dst) == n_long_R );
553  assume( getCoeffType(src) == n_long_C );
554 
555  gmp_float *res=new gmp_float(((gmp_complex*)from)->real());
556  return (number)res;
557 }
558 
559 nMapFunc ngfSetMap(const coeffs src, const coeffs dst)
560 {
561  assume( getCoeffType(dst) == n_long_R );
562 
563  if (src->rep==n_rep_gap_rat) /*Q, Z*/
564  {
565  return ngfMapQ;
566  }
567  if (src->rep==n_rep_gap_gmp) /*Q, Z*/
568  {
569  return ngfMapZ;
570  }
571  if ((src->rep==n_rep_gmp_float) && nCoeff_is_long_R(src))
572  {
573  return ndCopyMap; //ngfCopyMap;
574  }
575  if ((src->rep==n_rep_float) && nCoeff_is_R(src))
576  {
577  return ngfMapR;
578  }
579  if ((src->rep==n_rep_gmp_complex) && nCoeff_is_long_C(src))
580  {
581  return ngfMapC;
582  }
583  if ((src->rep==n_rep_int) && nCoeff_is_Zp(src))
584  {
585  return ngfMapP;
586  }
587  return NULL;
588 }
589 
590 void ngfCoeffWrite (const coeffs r, BOOLEAN /*details*/)
591 {
592  Print("// characteristic : 0 (real:%d digits, additional %d digits)\n",
593  r->float_len,r->float_len2); /* long R */
594 }
BOOLEAN ngfCoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
Definition: gnumpfl.cc:415
static char * ngfCoeffString(const coeffs r)
Definition: gnumpfl.cc:433
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:812
const CanonicalForm int s
Definition: facAbsFact.cc:55
number ngfAdd(number la, number li, const coeffs r)
Definition: gnumpfl.cc:176
const poly a
Definition: syzextra.cc:212
#define Print
Definition: emacs.cc:83
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
Definition: coeffs.h:834
#define SHORT_REAL_LENGTH
Definition: numbers.h:54
BOOLEAN ngfEqual(number a, number b, const coeffs r)
Definition: gnumpfl.cc:282
long npInt(number &n, const coeffs r)
Definition: modulop.cc:140
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
number ngfMapZ(number from, const coeffs aRing, const coeffs r)
Definition: gnumpfl.cc:511
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:239
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
Definition: coeffs.h:905
void ngfCoeffWrite(const coeffs r, BOOLEAN details)
Definition: gnumpfl.cc:590
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
Definition: coeffs.h:850
{p < 2^31}
Definition: coeffs.h:30
(), see rinteger.h, new impl.
Definition: coeffs.h:112
void setFromStr(const char *in)
Definition: mpr_complex.cc:80
nf(float f)
Definition: gnumpfl.cc:61
#define TRUE
Definition: auxiliary.h:101
number ngfMapQ(number from, const coeffs src, const coeffs r)
Definition: gnumpfl.cc:503
void WerrorS(const char *s)
Definition: feFopen.cc:24
gmp_complex numbers based on
Definition: mpr_complex.h:178
nf(number n)
Definition: gnumpfl.cc:62
number ngfInvers(number a, const coeffs r)
Definition: gnumpfl.cc:157
number ngfDiv(number a, number b, const coeffs r)
Definition: gnumpfl.cc:209
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
Definition: coeffs.h:908
static number ngfMapC(number from, const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:550
#define omAlloc(size)
Definition: omAllocDecl.h:210
void ngfDelete(number *a, const coeffs r)
Definition: gnumpfl.cc:106
bool isZero() const
Definition: mpr_complex.cc:254
real floating point (GMP) numbers
Definition: coeffs.h:34
short float_len2
additional char-flags, rInit
Definition: coeffs.h:102
number _n
Definition: gnumpfl.cc:60
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:808
Definition: gnumpfl.cc:57
poly res
Definition: myNF.cc:322
single prescision (6,6) real numbers
Definition: coeffs.h:32
short float_len
additional char-flags, rInit
Definition: coeffs.h:101
const ring r
Definition: syzextra.cc:208
Coefficient rings, fields and other domains suitable for Singular polynomials.
BOOLEAN ngfIsMOne(number a, const coeffs r)
Definition: gnumpfl.cc:302
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:403
The main handler for Singular numbers which are suitable for Singular polynomials.
void StringAppendS(const char *st)
Definition: reporter.cc:107
nMapFunc ngfSetMap(const coeffs src, const coeffs dst)
Get a mapping function from src into the domain of this type:
Definition: gnumpfl.cc:559
const char * ngfRead(const char *s, number *a, const coeffs r)
Definition: gnumpfl.cc:338
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
const ring R
Definition: DebugPrint.cc:36
complex floating point (GMP) numbers
Definition: coeffs.h:42
(gmp_complex), see gnumpc.h
Definition: coeffs.h:118
static char * ngfEatFloatNExp(char *s)
Definition: gnumpfl.cc:309
void ngfWrite(number a, const coeffs r)
Definition: gnumpfl.cc:397
static number ngfMapR(number from, const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:533
BOOLEAN ngfGreater(number a, number b, const coeffs r)
Definition: gnumpfl.cc:272
All the auxiliary stuff.
BOOLEAN ngfGreaterZero(number za, const coeffs r)
Note: MAY NOT WORK AS EXPECTED!
Definition: gnumpfl.cc:262
BOOLEAN ngfIsOne(number a, const coeffs r)
Definition: gnumpfl.cc:292
const char *const nDivBy0
Definition: numbers.h:83
FILE * f
Definition: checklibs.c:7
int i
Definition: cfEzgcd.cc:123
#define QTOF
Definition: mpr_complex.h:19
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:425
static number ngfMapP(number from, const coeffs src, const coeffs dst)
Definition: gnumpfl.cc:542
number ngfCopy(number a, const coeffs r)
Definition: gnumpfl.cc:120
number ngfInit(long i, const coeffs r)
Definition: gnumpfl.cc:70
#define SR_TO_INT(SR)
Definition: longrat.h:70
(number), see longrat.h
Definition: coeffs.h:111
n_coeffType
Definition: coeffs.h:27
#define NULL
Definition: omList.c:10
char * floatToStr(const gmp_float &r, const unsigned int oprec)
Definition: mpr_complex.cc:591
float F() const
Definition: gnumpfl.cc:63
BOOLEAN ngfInitChar(coeffs n, void *parameter)
Initialize r.
Definition: gnumpfl.cc:440
(gmp_float), see
Definition: coeffs.h:117
gmp_float numberFieldToFloat(number num, int k, const coeffs src)
Definition: mpr_complex.cc:440
void ngfSetChar(const coeffs r)
Definition: gnumpfl.cc:428
#define SR_INT
Definition: longrat.h:68
number ngfMult(number a, number b, const coeffs r)
Definition: gnumpfl.cc:198
number ngfSub(number la, number li, const coeffs r)
Definition: gnumpfl.cc:187
Variable x
Definition: cfModGcd.cc:4023
bool isZero(const CFArray &A)
checks if entries of A are zero
void ngfPower(number x, int exp, number *lu, const coeffs r)
Definition: gnumpfl.cc:247
p exp[i]
Definition: DebugPrint.cc:39
(int), see modulop.h
Definition: coeffs.h:110
#define SR_HDL(A)
Definition: tgb.cc:35
void setGMPFloatDigits(size_t digits, size_t rest)
Set size of mantissa digits - the number of output digits (basis 10) the size of mantissa consists of...
Definition: mpr_complex.cc:62
BOOLEAN ngfIsZero(number za, const coeffs r)
Definition: gnumpfl.cc:252
number ngf_Copy(number a, coeffs r)
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213
number N() const
Definition: gnumpfl.cc:64
long ngfInt(number &n, const coeffs r)
Definition: gnumpfl.cc:81
static int sign(int x)
Definition: ring.cc:3412
void Werror(const char *fmt,...)
Definition: reporter.cc:189
int ngfSize(number n, const coeffs r)
Definition: gnumpfl.cc:92
(float), see shortfl.h
Definition: coeffs.h:116
float _f
Definition: gnumpfl.cc:59
number ngfNeg(number za, const coeffs r)
Definition: gnumpfl.cc:146