30 #ifdef SOPLEX_WITH_GMP 50 #ifdef SOPLEX_WITH_GMP 57 Rational(
const int& i,
const bool& dummy);
89 #ifdef SOPLEX_WITH_GMP 123 #ifdef SOPLEX_WITH_GMP 150 operator double()
const;
151 operator long double()
const;
565 #endif // _RATIONAL_H_ Rational & addProduct(const Rational &r, const Rational &s)
add product of two rationals
bool isAdjacentTo(const double &d) const
checks if d is exactly equal to the Rational and if not, if it is one of the two adjacent doubles ...
bool isNextTo(const double &d)
checks if d is the closest number that can be represented by double
Generic Real linked list.
friend Rational spxAbs(const Rational &r)
Absolute.
friend std::string rationalToString(const Rational &r, const int precision)
convert rational number to string
int dlcmSizeRational(const Rational *vector, const int length, const int base)
Size of least common multiple of denominators in rational vector.
static const Rational ZERO
rational zero (GMP only)
Generic Real linked list.Class IdList implements an intrusive Real linked list as a template class...
friend bool operator<(const Rational &r, const Rational &s)
less than operator
static THREADLOCAL bool useListMem
list of unused Private objects; note that this cannot be used if SOPLEX_WITH_GMP is not defined...
Rational operator*(const Rational &r) const
multiplication operator
int sizeInBase(const int base=2) const
Size in specified base (bit size for base 2)
friend bool operator<=(const Rational &r, const Rational &s)
less than or equal to operator
Rational operator-(const Rational &r) const
subtraction operator
friend bool operator!=(const Rational &r, const Rational &s)
inequality operator
Rational & subProduct(const Rational &r, const Rational &s)
subtract product of two rationals
Rational & invert()
inversion
friend bool operator>=(const Rational &r, const Rational &s)
greater than or equal to operator
int totalSizeRational(const Rational *vector, const int length, const int base)
Total size of rational vector.
Wrapper for GMP type mpq_class.We wrap mpq_class so that we can replace it by a double type if GMP is...
static void disableListMem()
disables list memory
static const Rational NEGONE
rational minus one (GMP only)
Rational & operator/=(const Rational &r)
division assignment operator
Rational & operator-=(const Rational &r)
subtraction assignment operator
static void freeListMem()
frees the unused rational elements in the memory list
int dmaxSizeRational(const Rational *vector, const int length, const int base)
Size of largest denominator in rational vector.
Rational & operator*=(const Rational &r)
multiplication assignment operator operator
bool readString(const char *s)
read Rational from string
static int precision()
returns precision of Rational implementation, i.e., number of bits used to store Rational numbers (IN...
friend int sign(const Rational &r)
Sign function; returns 1 if r > 0, 0 if r = 0, and -1 if r < 0.
Defines the "Pimpl"-class Private.
friend std::ostream & operator<<(std::ostream &os, const Rational &q)
print Rational
static void enableListMem()
enables list memory
const mpq_t & getMpqRef() const
provides read-only access to underlying mpq_t
static const Rational POSONE
rational plus one (GMP only)
Debugging, floating point type and parameter definitions.
friend bool operator==(const Rational &r, const Rational &s)
equality operator
friend int compareRational(const Rational &r, const Rational &s)
comparison operator returning a positive value if r > s, zero if r = s, and a negative value if r < s...
Rational operator+(const Rational &r) const
addition operator
Everything should be within this namespace.
const mpq_t * getMpqPtr() const
provides read-only access to underlying mpq_t
Rational operator/(const Rational &r) const
division operator
friend bool readStringRational(const char *s, Rational &value)
read Rational from string
Rational & operator=(const Rational &)
assignment operator
static THREADLOCAL IdList< Private > unusedPrivateList
list of unused Private objects
Rational & subQuotient(const Rational &r, const Rational &s)
subtract quotient of two rationals, r divided by s
friend bool operator>(const Rational &r, const Rational &s)
greater than operator
mpq_t * getMpqPtr_w() const
provides write access to underlying mpq_t; use with care
Rational()
default constructor
mpq_t & getMpqRef_w() const
provides write access to underlying mpq_t; use with care
#define THREADLOCAL
SOPLEX_DEBUG.
Rational & addQuotient(const Rational &r, const Rational &s)
add quotient of two rationals, r divided by s
Rational & operator+=(const Rational &r)
addition assignment operator
Rational & powRound()
round up to next power of two