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