Go to the source code of this file.
|
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 two parts: the "output" part a and the "rest" part b.
|
|
gmp_float | operator+ (const gmp_float &a, const gmp_float &b) |
|
gmp_float | operator- (const gmp_float &a, const gmp_float &b) |
|
gmp_float | operator* (const gmp_float &a, const gmp_float &b) |
|
gmp_float | operator/ (const gmp_float &a, const gmp_float &b) |
|
bool | operator== (const gmp_float &a, const gmp_float &b) |
|
bool | operator> (const gmp_float &a, const gmp_float &b) |
|
bool | operator< (const gmp_float &a, const gmp_float &b) |
|
bool | operator>= (const gmp_float &a, const gmp_float &b) |
|
bool | operator<= (const gmp_float &a, const gmp_float &b) |
|
gmp_float | operator- (const gmp_float &a) |
|
gmp_float | abs (const gmp_float &a) |
|
gmp_float | sqrt (const gmp_float &a) |
|
gmp_float | sin (const gmp_float &a) |
|
gmp_float | cos (const gmp_float &a) |
|
gmp_float | log (const gmp_float &a) |
|
gmp_float | hypot (const gmp_float &a, const gmp_float &b) |
|
gmp_float | exp (const gmp_float &a) |
|
gmp_float | max (const gmp_float &a, const gmp_float &b) |
|
gmp_float | numberToFloat (number num, const coeffs src) |
|
gmp_float | numberFieldToFloat (number num, int cf) |
|
char * | nicifyFloatStr (char *in, mp_exp_t exponent, size_t oprec, int *size, int thesign) |
|
char * | floatToStr (const gmp_float &r, const unsigned int oprec) |
|
gmp_complex | operator+ (const gmp_complex &a, const gmp_complex &b) |
|
gmp_complex | operator- (const gmp_complex &a, const gmp_complex &b) |
|
gmp_complex | operator* (const gmp_complex &a, const gmp_complex &b) |
|
gmp_complex | operator/ (const gmp_complex &a, const gmp_complex &b) |
|
gmp_complex | sqrt (const gmp_complex &x) |
|
char * | complexToStr (gmp_complex &c, const unsigned int oprec, const coeffs src) |
|
bool | complexNearZero (gmp_complex *c, int digits) |
|
◆ DEFPREC
◆ EXTRABYTES
◆ SIGN_EMPTY
◆ SIGN_PLUS
◆ SIGN_SPACE
◆ SR_HDL
◆ SR_TO_INT
◆ abs()
◆ complexNearZero()
Definition at line 765 of file mpr_complex.cc.
766{
768
769 if (
digits < 1 )
return true;
770
772
775
776
777
780 else
782}
Rational pow(const Rational &a, int e)
◆ complexToStr()
Definition at line 704 of file mpr_complex.cc.
705{
708
710 {
713 }
714
716
718
721 {
722
725
727 {
733 else
734 {
739 else
741 }
742 }
743 else
744 {
750 else
752 }
755 }
756 else
757 {
759 }
760
762}
const CanonicalForm CFMap CFMap & N
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
gmp_float abs(const gmp_float &a)
char * floatToStr(const gmp_float &r, const unsigned int oprec)
◆ cos()
Definition at line 338 of file mpr_complex.cc.
339{
342}
gmp_float cos(const gmp_float &a)
◆ exp()
Definition at line 357 of file mpr_complex.cc.
358{
361}
gmp_float exp(const gmp_float &a)
◆ floatToStr()
Definition at line 578 of file mpr_complex.cc.
579{
580#if 1
584
587
589
590
591
592
593
594
595
596
597
598
599
605
607#else
608
612#endif
613}
char * nicifyFloatStr(char *in, mp_exp_t exponent, size_t oprec, int *size, int thesign)
◆ hypot()
Definition at line 348 of file mpr_complex.cc.
349{
350#if 1
351 return (
sqrt( (a*a) + (
b*
b) ) );
352#else
355#endif
356}
gmp_float sqrt(const gmp_float &a)
gmp_float hypot(const gmp_float &a, const gmp_float &b)
◆ log()
Definition at line 343 of file mpr_complex.cc.
344{
347}
gmp_float log(const gmp_float &a)
◆ max()
◆ nicifyFloatStr()
Definition at line 485 of file mpr_complex.cc.
486{
488
489 int sign= (
in[0] ==
'-') ? 1 : 0;
491
493 {
496 break;
499 break;
501 default:
503 break;
504 }
505
507 {
510 }
511
513 )
514 {
516 {
522
525
530 else
531 {
534 }
536 }
538 {
544 }
545 else
546 {
551 }
552 }
553 else
554 {
555
556
557 int c=1,d=10;
559 {
560 d*=10;
561 c++;
562 }
567
568
569
570
571
572
573
574 }
576}
◆ numberFieldToFloat()
Definition at line 438 of file mpr_complex.cc.
439{
441
443 {
446 {
448 {
450 }
451 else
452 {
454 {
457 }
458 else
459 {
461 }
462 }
463 }
464 else
465 {
466 r= 0.0;
467 }
468 break;
471 break;
473 WerrorS(
"Can not map from field C to field R!");
474 break;
476 default:
477 WerrorS(
"Ground field not implemented!");
478 }
479
480 return r;
481}
void WerrorS(const char *s)
◆ numberToFloat()
Definition at line 372 of file mpr_complex.cc.
373{
375
377 {
379 {
381 {
382
386 else
388
389
390
391 }
392 else
393 {
395 {
397 }
399 {
401 }
402 else
403 {
405 {
408 }
409 else
410 {
412 }
413 }
414 }
415 }
416 else
417 {
418 r= 0.0;
419 }
420 }
422 {
424 }
426 {
427
428 WerrorS(
"Ground field not implemented!");
429 }
430 else
431 {
432 WerrorS(
"Ground field not implemented!");
433 }
434
435 return r;
436}
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
void nlNormalize(number &x, const coeffs r)
◆ operator*() [1/2]
Definition at line 627 of file mpr_complex.cc.
628{
630 a.
r *
b.i + a.
i *
b.r);
631}
gmp_complex numbers based on
◆ operator*() [2/2]
◆ operator+() [1/2]
◆ operator+() [2/2]
◆ operator-() [1/3]
◆ operator-() [2/3]
◆ operator-() [3/3]
◆ operator/() [1/2]
◆ operator/() [2/2]
◆ operator<()
◆ operator<=()
◆ operator==()
Definition at line 237 of file mpr_complex.cc.
238{
240 return false;
242 return true;
247 return true;
248 else
249 return false;
250}
STATIC_VAR gmp_float * gmpRel
STATIC_VAR gmp_float * diff
◆ operator>()
◆ operator>=()
◆ setGMPFloatDigits()
Set size of mantissa digits - the number of output digits (basis 10) the size of mantissa consists of two parts: the "output" part a and the "rest" part b.
According to the GMP-precision digits is recomputed to bits (basis 2). Two numbers a, b are equal if | a - b | < | a | * 0.1^digits . In this case we have a - b = 0 . The epsilon e is e=0.1^(digits+rest) with 1+e != 1, but 1+0.1*e = 1.
Definition at line 60 of file mpr_complex.cc.
61{
75}
VAR size_t gmp_output_digits
◆ sin()
Definition at line 333 of file mpr_complex.cc.
334{
337}
gmp_float sin(const gmp_float &a)
◆ sqrt() [1/2]
Definition at line 676 of file mpr_complex.cc.
677{
681 {
683 }
685 {
688 }
689 else
690 {
693 {
695 }
697 }
700}
◆ sqrt() [2/2]
◆ diff
◆ gmp_output_digits
◆ gmpRel