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. More...
|
|
char * | floatToStr (const gmp_float &r, const unsigned int oprec) |
|
gmp_float | abs (const gmp_float &) |
|
gmp_float | sqrt (const gmp_float &) |
|
gmp_float | hypot (const gmp_float &, const gmp_float &) |
|
gmp_float | sin (const gmp_float &) |
|
gmp_float | cos (const gmp_float &) |
|
gmp_float | log (const gmp_float &) |
|
gmp_float | exp (const gmp_float &) |
|
gmp_float | max (const gmp_float &, const gmp_float &) |
|
gmp_float | numberToFloat (number num, const coeffs src) |
|
gmp_float | numberFieldToFloat (number num, int src) |
|
gmp_complex | operator+ (const gmp_complex &a, const gmp_float b_d) |
|
gmp_complex | operator- (const gmp_complex &a, const gmp_float b_d) |
|
gmp_complex | operator* (const gmp_complex &a, const gmp_float b_d) |
|
gmp_complex | operator/ (const gmp_complex &a, const gmp_float b_d) |
|
bool | operator== (const gmp_complex &a, const gmp_complex &b) |
|
bool | operator> (const gmp_complex &a, const gmp_complex &b) |
|
bool | operator< (const gmp_complex &a, const gmp_complex &b) |
|
bool | operator>= (const gmp_complex &a, const gmp_complex &b) |
|
bool | operator<= (const gmp_complex &a, const gmp_complex &b) |
|
gmp_float | abs (const gmp_complex &c) |
|
gmp_complex | sqrt (const gmp_complex &x) |
|
gmp_complex | numberToComplex (number num, const coeffs r) |
|
char * | complexToStr (gmp_complex &c, const unsigned int oprec, const coeffs src) |
|
bool | complexNearZero (gmp_complex *c, int digits) |
|
§ CTOF
§ QTOF
§ RTOF
§ ZTOF
§ abs() [1/2]
§ abs() [2/2]
Definition at line 305 of file mpr_complex.h.
gmp_float hypot(const gmp_float &, const gmp_float &)
§ complexNearZero()
Definition at line 767 of file mpr_complex.cc.
771 if ( digits < 1 )
return true;
773 eps=
pow(10.0,(
int)digits);
781 return (c->
real() < eps && (c->
imag() < eps && c->
imag() > epsm));
783 return (c->
real() > epsm && (c->
imag() < eps && c->
imag() > epsm));
Rational pow(const Rational &a, int e)
§ complexToStr()
Definition at line 706 of file mpr_complex.cc.
708 const char * complex_parameter =
"I";
714 N = strlen(complex_parameter);
719 char *out,*in_imag,*in_real;
730 int len=(strlen(in_real)+strlen(in_imag)+7+
N)*
sizeof(
char);
734 sprintf(out,
"(%s%s%s*%s)",in_real,c.
imag().
sign()>=0?
"+":
"-",complex_parameter,in_imag);
738 sprintf(out,
"%s", complex_parameter);
740 sprintf(out,
"-%s", complex_parameter);
742 sprintf(out,
"(%s%s*%s)",c.
imag().
sign()>=0?
"":
"-", complex_parameter,in_imag);
747 int len=(strlen(in_real)+strlen(in_imag)+9) *
sizeof(
char);
751 sprintf(out,
"(%s%s%s)",in_real,c.
imag().
sign()>=0?
"+I*":
"-I*",in_imag);
753 sprintf(out,
"(%s%s)",c.
imag().
sign()>=0?
"I*":
"-I*",in_imag);
755 omFree( (
void *) in_real );
756 omFree( (
void *) in_imag );
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)
const CanonicalForm CFMap CFMap & N
gmp_float abs(const gmp_float &a)
char * floatToStr(const gmp_float &r, const unsigned int oprec)
§ cos()
§ exp()
§ floatToStr()
Definition at line 580 of file mpr_complex.cc.
587 insize= (oprec+2) *
sizeof(
char) + 10;
590 mpf_get_str(in,&exponent,10,oprec,*(r.
mpfp()));
604 out= (
char*)
omAlloc( (strlen(nout)+1) *
sizeof(char) );
611 char *out= (
char*)
omAlloc( (1024) *
sizeof(char) );
612 sprintf(out,
"% .10f",(
double)r);
char * nicifyFloatStr(char *in, mp_exp_t exponent, size_t oprec, int *size, int thesign)
const mpf_t * mpfp() const
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, int q )
§ hypot()
Definition at line 350 of file mpr_complex.cc.
gmp_float hypot(const gmp_float &a, const gmp_float &b)
gmp_float sqrt(const gmp_float &a)
§ log()
§ max()
§ numberFieldToFloat()
gmp_float numberFieldToFloat |
( |
number |
num, |
|
|
int |
src |
|
) |
| |
Definition at line 440 of file mpr_complex.cc.
475 WerrorS(
"Can not map from field C to field R!");
479 WerrorS(
"Ground field not implemented!");
void WerrorS(const char *s)
§ numberToComplex()
Definition at line 312 of file mpr_complex.h.
gmp_float numberToFloat(number num, const coeffs src)
gmp_complex numbers based on
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
§ numberToFloat()
Definition at line 374 of file mpr_complex.cc.
430 WerrorS(
"Ground field not implemented!");
434 WerrorS(
"Ground field not implemented!");
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
void WerrorS(const char *s)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
void nlNormalize(number &x, const coeffs r)
§ operator*()
§ operator+()
§ operator-()
§ operator/()
§ operator<()
§ operator<=()
§ operator==()
§ operator>()
§ operator>=()
§ setGMPFloatDigits()
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.
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 62 of file mpr_complex.cc.
64 size_t bits = 1 + (size_t) ((
float)digits * 3.5);
65 size_t rb = 1 + (size_t) ((
float)rest * 3.5);
68 mpf_set_default_prec( db );
static gmp_float * gmpRel
§ sin()
§ sqrt() [1/2]
§ sqrt() [2/2]
Definition at line 678 of file mpr_complex.cc.
gmp_complex numbers based on
gmp_float sqrt(const gmp_float &a)
gmp_float abs(const gmp_float &a)