 |
My Project
UNKNOWN_GIT_VERSION
|
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]
◆ complexNearZero()
Definition at line 765 of file mpr_complex.cc.
770 if ( digits < 1 )
return true;
772 eps=
pow(10.0,(
int)digits);
780 return (c->
real() < eps && (c->
imag() < eps && c->
imag() > epsm));
782 return (c->
real() > epsm && (c->
imag() < eps && c->
imag() > epsm));
◆ complexToStr()
Definition at line 704 of file mpr_complex.cc.
707 const char * complex_parameter =
"I";
713 N = strlen(complex_parameter);
718 char *out,*in_imag,*in_real;
729 int len=(strlen(in_real)+strlen(in_imag)+7+
N)*
sizeof(
char);
733 sprintf(out,
"(%s%s%s*%s)",in_real,c.
imag().
sign()>=0?
"+":
"-",complex_parameter,in_imag);
737 sprintf(out,
"%s", complex_parameter);
739 sprintf(out,
"-%s", complex_parameter);
741 sprintf(out,
"(%s%s*%s)",c.
imag().
sign()>=0?
"":
"-", complex_parameter,in_imag);
746 int len=(strlen(in_real)+strlen(in_imag)+9) *
sizeof(
char);
750 sprintf(out,
"(%s%s%s)",in_real,c.
imag().
sign()>=0?
"+I*":
"-I*",in_imag);
752 sprintf(out,
"(%s%s)",c.
imag().
sign()>=0?
"I*":
"-I*",in_imag);
754 omFree( (
void *) in_real );
755 omFree( (
void *) in_imag );
◆ cos()
◆ exp()
◆ floatToStr()
Definition at line 578 of file mpr_complex.cc.
586 insize= (oprec+2) *
sizeof(
char) + 10;
603 out= (
char*)
omAlloc( (strlen(nout)+1) *
sizeof(char) );
610 char *out= (
char*)
omAlloc( (1024) *
sizeof(char) );
611 sprintf(out,
"% .10f",(
double)r);
◆ hypot()
◆ log()
◆ max()
◆ numberFieldToFloat()
gmp_float numberFieldToFloat |
( |
number |
num, |
|
|
int |
src |
|
) |
| |
◆ numberToComplex()
◆ numberToFloat()
◆ 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 60 of file mpr_complex.cc.
63 size_t bits = 1 + (size_t) ((
float)digits * 3.5);
64 size_t rb = 1 + (size_t) ((
float)rest * 3.5);
67 mpf_set_default_prec( db );
◆ sin()
◆ sqrt() [1/2]
◆ sqrt() [2/2]
char * floatToStr(const gmp_float &r, const unsigned int oprec)
int exponent(const CanonicalForm &f, int q)
int exponent ( const CanonicalForm & f, int q )
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
gmp_float sqrt(const gmp_float &a)
const CanonicalForm CFMap CFMap & N
gmp_float sin(const gmp_float &a)
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
gmp_float hypot(const gmp_float &, const gmp_float &)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
gmp_float hypot(const gmp_float &a, const gmp_float &b)
void nlNormalize(number &x, const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
char * nicifyFloatStr(char *in, mp_exp_t exponent, size_t oprec, int *size, int thesign)
gmp_float abs(const gmp_float &a)
static gmp_float * gmpRel
static FORCE_INLINE const char ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
gmp_float exp(const gmp_float &a)
gmp_float numberToFloat(number num, const coeffs src)
gmp_float log(const gmp_float &a)
Rational pow(const Rational &a, int e)
void WerrorS(const char *s)
const mpf_t * mpfp() const
gmp_float cos(const gmp_float &a)
gmp_complex numbers based on