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 754 of file mpr_complex.cc.
755{
757
758 if (
digits < 1 )
return true;
759
761
764
765
766
769 else
771}
Rational pow(const Rational &a, int e)
◆ complexToStr()
Definition at line 693 of file mpr_complex.cc.
694{
697
699 {
702 }
703
705
707
710 {
711
714
716 {
722 else
723 {
728 else
730 }
731 }
732 else
733 {
739 else
741 }
744 }
745 else
746 {
748 }
749
751}
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 330 of file mpr_complex.cc.
331{
334}
gmp_float cos(const gmp_float &a)
◆ exp()
Definition at line 349 of file mpr_complex.cc.
350{
353}
gmp_float exp(const gmp_float &a)
◆ floatToStr()
Definition at line 567 of file mpr_complex.cc.
568{
569#if 1
573
576
578
579
580
581
582
583
584
585
586
587
588
594
596#else
597
601#endif
602}
char * nicifyFloatStr(char *in, mp_exp_t exponent, size_t oprec, int *size, int thesign)
◆ hypot()
Definition at line 340 of file mpr_complex.cc.
341{
342#if 1
343 return (
sqrt( (a*a) + (
b*
b) ) );
344#else
347#endif
348}
gmp_float sqrt(const gmp_float &a)
gmp_float hypot(const gmp_float &a, const gmp_float &b)
◆ log()
Definition at line 335 of file mpr_complex.cc.
336{
339}
gmp_float log(const gmp_float &a)
◆ max()
◆ nicifyFloatStr()
Definition at line 477 of file mpr_complex.cc.
478{
480
481 int sign= (
in[0] ==
'-') ? 1 : 0;
483
485 {
488 break;
491 break;
493 default:
495 break;
496 }
497
499 {
502 }
503
505 )
506 {
508 {
514
517
522 else
523 {
526 }
528 }
530 {
535 }
536 else
537 {
541 }
542 }
543 else
544 {
545
546
547 int c=1,d=10;
549 {
550 d*=10;
551 c++;
552 }
556
557
558
559
560
561
562
563 }
565}
◆ numberFieldToFloat()
Definition at line 430 of file mpr_complex.cc.
431{
433
435 {
438 {
440 {
442 }
443 else
444 {
446 {
449 }
450 else
451 {
453 }
454 }
455 }
456 else
457 {
458 r= 0.0;
459 }
460 break;
463 break;
465 WerrorS(
"Can not map from field C to field R!");
466 break;
468 default:
469 WerrorS(
"Ground field not implemented!");
470 }
471
472 return r;
473}
void WerrorS(const char *s)
◆ numberToFloat()
Definition at line 364 of file mpr_complex.cc.
365{
367
369 {
371 {
373 {
374
378 else
380
381
382
383 }
384 else
385 {
387 {
389 }
391 {
393 }
394 else
395 {
397 {
400 }
401 else
402 {
404 }
405 }
406 }
407 }
408 else
409 {
410 r= 0.0;
411 }
412 }
414 {
416 }
418 {
419
420 WerrorS(
"Ground field not implemented!");
421 }
422 else
423 {
424 WerrorS(
"Ground field not implemented!");
425 }
426
427 return r;
428}
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 616 of file mpr_complex.cc.
617{
619 a.
r *
b.i + a.
i *
b.r);
620}
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 325 of file mpr_complex.cc.
326{
329}
gmp_float sin(const gmp_float &a)
◆ sqrt() [1/2]
Definition at line 665 of file mpr_complex.cc.
666{
670 {
672 }
674 {
677 }
678 else
679 {
682 {
684 }
686 }
689}
◆ sqrt() [2/2]
◆ diff
◆ gmp_output_digits
◆ gmpRel