16 #ifndef __APXX_SCALAR_HH 17 #define __APXX_SCALAR_HH 22 #include "ap_scalar.h" 49 frac(
long num,
unsigned long den=1) : num(num), den(den) {}
70 void*
operator new (
size_t sz);
71 void*
operator new[] (
size_t sz);
72 void operator delete (
void* p);
73 void operator delete[](
void* p);
129 scalar(
const mpq_class& x);
158 scalar& operator= (
int x);
164 scalar& operator= (
double x);
173 scalar& operator= (
const mpq_class& x);
203 double& get_double();
209 const double& get_double()
const;
215 mpq_class& get_mpq();
221 const mpq_class& get_mpq()
const;
239 mpq_class to_mpq(mp_rnd_t round,
order& conv)
const;
247 double to_double(mp_rnd_t round,
order& conv)
const;
255 void to_mpfr(mpfr_t x, mp_rnd_t round,
order& conv)
const;
258 operator mpq_class()
const;
261 operator double()
const;
276 void print(FILE* stream=stdout)
const;
288 order is_infty()
const;
311 friend order
cmp(
int a,
const scalar& b);
338 scalar operator~ ()
const;
353 const ap_scalar_t* get_ap_scalar_t()
const;
356 ap_scalar_t* get_ap_scalar_t();
Definition: apxx_abstract0.hh:27
unsigned long den
Denominator.
Definition: apxx_scalar.hh:44
Exception raised when an operation is incompatible with a discriminant.
Definition: apxx_scalar.hh:55
std::ostream & operator<<(std::ostream &os, const abstract0 &s)
Definition: apxx_abstract0.hh:293
void swap(coeff &a, coeff &b)
Definition: apxx_coeff.hh:382
texpr0::builder neg(const texpr0::builder &a, ap_texpr_rtype_t rtype=AP_RTYPE_REAL, ap_texpr_rdir_t rdir=AP_RDIR_NEAREST)
Definition: apxx_texpr0.hh:814
int cmp(const coeff &a, const coeff &b)
Definition: apxx_coeff.hh:415
Either +oo or -oo, to simplify initialisations and assignments.
Definition: apxx_scalar.hh:30
texpr0::builder operator-(const texpr0::builder &a)
Definition: apxx_texpr0.hh:854
~scalar()
Definition: apxx_scalar.hh:114
bool operator==(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0.hh:410
bool operator>(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0.hh:434
frac(long num, unsigned long den=1)
Definition: apxx_scalar.hh:49
order
Returned by ordering functions.
Definition: apxx_scalar.hh:97
bad_discriminant(const std::string &arg)
Definition: apxx_scalar.hh:59
bool operator>=(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0.hh:429
bool operator!=(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0.hh:417
Inherited by most wrappers to map new and delete to malloc and free.
Definition: apxx_scalar.hh:69
infty(int sgn=1)
Definition: apxx_scalar.hh:35
A fraction with native int coefficients, to simplify initialisations and assignments.
Definition: apxx_scalar.hh:41
long num
Numerator.
Definition: apxx_scalar.hh:43
int sgn
Sign: >0 for +oo, <0 for -oo.
Definition: apxx_scalar.hh:32
ap_scalar_discr_t get_discr() const
Whether the object wraps a double or a MPQ.
Definition: apxx_scalar.hh:185
bool operator<=(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0.hh:422
bool operator<(const abstract0 &x, const abstract0 &y)
Definition: apxx_abstract0.hh:439
Scalar (ap_scalar_t wrapper).
Definition: apxx_scalar.hh:89