Wrapper for GMP type mpq_class.We wrap mpq_class so that we can replace it by a double type if GMP is not available. More...
#include <rational.h>
Classes | |
class | Private |
Defines the "Pimpl"-class Private. More... | |
Public Member Functions | |
GMP Only methods | |
Rational & | operator= (const mpq_t &q) |
assignment operator from mpq_t More... | |
Typecasts | |
operator double () const | |
typecasts Rational to double (allows only explicit typecast) More... | |
operator long double () const | |
typecasts Rational to long double (allows only explicit typecast) More... | |
operator float () const | |
typecasts Rational to float (allows only explicit typecast) More... | |
const mpq_t * | getMpqPtr () const |
provides read-only access to underlying mpq_t More... | |
const mpq_t & | getMpqRef () const |
provides read-only access to underlying mpq_t More... | |
mpq_t * | getMpqPtr_w () const |
provides write access to underlying mpq_t; use with care More... | |
mpq_t & | getMpqRef_w () const |
provides write access to underlying mpq_t; use with care More... | |
Arithmetic operators | |
Rational | operator+ (const Rational &r) const |
addition operator More... | |
Rational & | operator+= (const Rational &r) |
addition assignment operator More... | |
Rational | operator+ (const double &r) const |
addition operator for doubles More... | |
Rational & | operator+= (const double &r) |
addition assignment operator for doubles More... | |
Rational | operator+ (const int &r) const |
addition operator for ints More... | |
Rational & | operator+= (const int &r) |
addition assignment operator for ints More... | |
Rational | operator- (const Rational &r) const |
subtraction operator More... | |
Rational & | operator-= (const Rational &r) |
subtraction assignment operator More... | |
Rational | operator- (const double &r) const |
subtraction operator for doubles More... | |
Rational & | operator-= (const double &r) |
subtraction assignment operator for doubles More... | |
Rational | operator- (const int &r) const |
subtraction operator for ints More... | |
Rational & | operator-= (const int &r) |
subtraction assignment operator for ints More... | |
Rational | operator* (const Rational &r) const |
multiplication operator More... | |
Rational & | operator*= (const Rational &r) |
multiplication assignment operator operator More... | |
Rational | operator* (const double &r) const |
multiplication operator for doubles More... | |
Rational & | operator*= (const double &r) |
multiplication assignment operator for doubles More... | |
Rational | operator* (const int &r) const |
multiplication operator for ints More... | |
Rational & | operator*= (const int &r) |
multiplication assignment operator for ints More... | |
Rational | operator/ (const Rational &r) const |
division operator More... | |
Rational & | operator/= (const Rational &r) |
division assignment operator More... | |
Rational | operator/ (const double &r) const |
division operator for doubles More... | |
Rational & | operator/= (const double &r) |
division assignment operator for doubles More... | |
Rational | operator/ (const int &r) const |
division operator for ints More... | |
Rational & | operator/= (const int &r) |
division assignment operator for ints More... | |
Rational & | addProduct (const Rational &r, const Rational &s) |
add product of two rationals More... | |
Rational & | subProduct (const Rational &r, const Rational &s) |
subtract product of two rationals More... | |
Rational & | addQuotient (const Rational &r, const Rational &s) |
add quotient of two rationals, r divided by s More... | |
Rational & | subQuotient (const Rational &r, const Rational &s) |
subtract quotient of two rationals, r divided by s More... | |
Rational & | invert () |
inversion More... | |
Rational & | powRound () |
round up to next power of two More... | |
Methods for checking exactness of doubles | |
bool | isNextTo (const double &d) |
checks if d is the closest number that can be represented by double More... | |
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 More... | |
Methods for querying size | |
int | sizeInBase (const int base=2) const |
Size in specified base (bit size for base 2) More... | |
Static Public Member Functions | |
Static methods | |
static int | precision () |
returns precision of Rational implementation, i.e., number of bits used to store Rational numbers (INT_MAX if exact) More... | |
Private Member Functions | |
Rational (const int &i, const bool &dummy) | |
special constructor only for initializing static rational variables; this is necessary since we need a constructor for Rational::{ZERO, POSONE, NEGONE} that does not use these numbers More... | |
Private Attributes | |
Private * | dpointer |
Static Private Attributes | |
static THREADLOCAL IdList< Private > | unusedPrivateList |
list of unused Private objects More... | |
static THREADLOCAL bool | useListMem = true |
list of unused Private objects; note that this cannot be used if SOPLEX_WITH_GMP is not defined, since then the Private class has no member next() and prev() should list memory be used? More... | |
Static variables for special rational values | |
static const Rational | ZERO |
rational zero (GMP only) More... | |
static const Rational | POSONE |
rational plus one (GMP only) More... | |
static const Rational | NEGONE |
rational minus one (GMP only) More... | |
Friends | |
Friends | |
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 More... | |
bool | operator!= (const Rational &r, const Rational &s) |
inequality operator More... | |
bool | operator== (const Rational &r, const Rational &s) |
equality operator More... | |
bool | operator< (const Rational &r, const Rational &s) |
less than operator More... | |
bool | operator<= (const Rational &r, const Rational &s) |
less than or equal to operator More... | |
bool | operator> (const Rational &r, const Rational &s) |
greater than operator More... | |
bool | operator>= (const Rational &r, const Rational &s) |
greater than or equal to operator More... | |
bool | operator!= (const Rational &r, const double &s) |
inequality operator for Rational and double More... | |
bool | operator== (const Rational &r, const double &s) |
equality operator for Rational and double More... | |
bool | operator< (const Rational &r, const double &s) |
less than operator for Rational and double More... | |
bool | operator<= (const Rational &r, const double &s) |
less than or equal to operator for Rational and double More... | |
bool | operator> (const Rational &r, const double &s) |
greater than operator for Rational and double More... | |
bool | operator>= (const Rational &r, const double &s) |
greater than or equal to operator for Rational and double More... | |
bool | operator!= (const double &r, const Rational &s) |
inequality operator double and Rational More... | |
bool | operator== (const double &r, const Rational &s) |
equality operator for double and Rational More... | |
bool | operator< (const double &r, const Rational &s) |
less than operator double and Rational More... | |
bool | operator<= (const double &r, const Rational &s) |
less than or equal to operator double and Rational More... | |
bool | operator> (const double &r, const Rational &s) |
greater than operator double and Rational More... | |
bool | operator>= (const double &r, const Rational &s) |
greater than or equal to operator double and Rational More... | |
bool | operator!= (const Rational &r, const long double &s) |
inequality operator for Rational and long double More... | |
bool | operator== (const Rational &r, const long double &s) |
equality operator for Rational and long double More... | |
bool | operator< (const Rational &r, const long double &s) |
less than operator for Rational and long double More... | |
bool | operator<= (const Rational &r, const long double &s) |
less than or equal to operator for Rational and long double More... | |
bool | operator> (const Rational &r, const long double &s) |
greater than operator for Rational and long double More... | |
bool | operator>= (const Rational &r, const long double &s) |
greater than or equal to operator for Rational and long double More... | |
bool | operator!= (const long double &r, const Rational &s) |
inequality operator for long double and Rational More... | |
bool | operator== (const long double &r, const Rational &s) |
equality operator for long double and Rational More... | |
bool | operator< (const long double &r, const Rational &s) |
less than operator for long double and Rational More... | |
bool | operator<= (const long double &r, const Rational &s) |
less than or equal to operator for long double and Rational More... | |
bool | operator> (const long double &r, const Rational &s) |
greater than operator for long double and Rational More... | |
bool | operator>= (const long double &r, const Rational &s) |
greater than or equal to operator for long double and Rational More... | |
bool | operator!= (const Rational &r, const float &s) |
inequality operator for Rational and float More... | |
bool | operator== (const Rational &r, const float &s) |
equality operator for Rational and float More... | |
bool | operator< (const Rational &r, const float &s) |
less than operator for Rational and float More... | |
bool | operator<= (const Rational &r, const float &s) |
less than or equal to operator for Rational and float More... | |
bool | operator> (const Rational &r, const float &s) |
greater than operator for Rational and float More... | |
bool | operator>= (const Rational &r, const float &s) |
greater than or equal to operator for Rational and float More... | |
bool | operator!= (const float &r, const Rational &s) |
inequality operator for float and Rational More... | |
bool | operator== (const float &r, const Rational &s) |
equality operator for float and Rational More... | |
bool | operator< (const float &r, const Rational &s) |
less than operator for float and Rational More... | |
bool | operator<= (const float &r, const Rational &s) |
less than or equal to operator for float and Rational More... | |
bool | operator> (const float &r, const Rational &s) |
greater than operator for float and Rational More... | |
bool | operator>= (const float &r, const Rational &s) |
greater than or equal to operator for float and Rational More... | |
Rational | operator+ (const double &d, const Rational &r) |
addition operator for double and Rational More... | |
Rational | operator- (const double &d, const Rational &r) |
subtraction operator for double and Rational More... | |
Rational | operator* (const double &d, const Rational &r) |
multiplication operator for double and Rational More... | |
Rational | operator/ (const double &d, const Rational &r) |
division operator for double and Rational More... | |
bool | operator!= (const Rational &r, const int &s) |
inequality operator for Rational and int More... | |
bool | operator== (const Rational &r, const int &s) |
equality operator for Rational and int More... | |
bool | operator< (const Rational &r, const int &s) |
less than operator for Rational and int More... | |
bool | operator<= (const Rational &r, const int &s) |
less than or equal to operator for Rational and int More... | |
bool | operator> (const Rational &r, const int &s) |
greater than operator for Rational and int More... | |
bool | operator>= (const Rational &r, const int &s) |
greater than or equal to operator for Rational and int More... | |
bool | operator!= (const int &r, const Rational &s) |
inequality operator int and Rational More... | |
bool | operator== (const int &r, const Rational &s) |
equality operator for int and Rational More... | |
bool | operator< (const int &r, const Rational &s) |
less than operator int and Rational More... | |
bool | operator<= (const int &r, const Rational &s) |
less than or equal to operator int and Rational More... | |
bool | operator> (const int &r, const Rational &s) |
greater than operator int and Rational More... | |
bool | operator>= (const int &r, const Rational &s) |
greater than or equal to operator int and Rational More... | |
Rational | operator+ (const int &d, const Rational &r) |
addition operator for int and Rational More... | |
Rational | operator- (const int &d, const Rational &r) |
subtraction operator for int and Rational More... | |
Rational | operator* (const int &d, const Rational &r) |
multiplication operator for int and Rational More... | |
Rational | operator/ (const int &d, const Rational &r) |
division operator for int and Rational More... | |
Rational | spxAbs (const Rational &r) |
Absolute. More... | |
int | sign (const Rational &r) |
Sign function; returns 1 if r > 0, 0 if r = 0, and -1 if r < 0. More... | |
Rational | operator- (const Rational &q) |
Negation. More... | |
Construction and destruction | |
Rational () | |
default constructor More... | |
Rational (const Rational &r) | |
copy constructor More... | |
Rational (const long double &r) | |
constructor from long double More... | |
Rational (const double &r) | |
constructor from double More... | |
Rational (const int &i) | |
constructor from int More... | |
Rational (const mpq_t &q) | |
constructor from mpq_t (GMP only) More... | |
~Rational () | |
destructor More... | |
Rational & | operator= (const Rational &) |
assignment operator More... | |
Rational & | operator= (const long double &r) |
assignment operator from long double More... | |
Rational & | operator= (const double &r) |
assignment operator from double More... | |
Rational & | operator= (const int &i) |
assignment operator from int More... | |
static void | enableListMem () |
enables list memory More... | |
static void | freeListMem () |
frees the unused rational elements in the memory list More... | |
static void | disableListMem () |
disables list memory More... | |
Conversion from and to String | |
bool | readString (const char *s) |
read Rational from string More... | |
std::string | rationalToString (const Rational &r, const int precision) |
convert rational number to string More... | |
bool | readStringRational (const char *s, Rational &value) |
read Rational from string More... | |
std::ostream & | operator<< (std::ostream &os, const Rational &q) |
print Rational More... | |
Wrapper for GMP type mpq_class.
We wrap mpq_class so that we can replace it by a double type if GMP is not available.
If compiled with GMP support, Rational is defined as mpq_class.
Definition at line 62 of file rational.h.
|
private |
special constructor only for initializing static rational variables; this is necessary since we need a constructor for Rational::{ZERO, POSONE, NEGONE} that does not use these numbers
Definition at line 95 of file rational.cpp.
References Rational::dpointer, Rational::Private::privatevalue, and soplex::spx_alloc().
Rational | ( | ) |
default constructor
Definition at line 108 of file rational.cpp.
References Rational::dpointer, soplex::spx_alloc(), and Rational::unusedPrivateList.
Referenced by soplex::dmaxSizeRational(), Rational::isNextTo(), Rational::Private::next(), soplex::operator!=(), soplex::operator<(), soplex::operator<=(), soplex::operator==(), soplex::operator>(), soplex::operator>=(), and soplex::spxFrexp().
copy constructor
Definition at line 140 of file rational.cpp.
References Rational::dpointer, soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const long double & | r | ) |
constructor from long double
Definition at line 173 of file rational.cpp.
References Rational::dpointer, soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const double & | r | ) |
constructor from double
Definition at line 206 of file rational.cpp.
References Rational::dpointer, soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const int & | i | ) |
constructor from int
Definition at line 239 of file rational.cpp.
References Rational::dpointer, soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const mpq_t & | q | ) |
constructor from mpq_t (GMP only)
constructor from mpq_t
Definition at line 272 of file rational.cpp.
References Rational::dpointer, soplex::spx_alloc(), and Rational::unusedPrivateList.
~Rational | ( | ) |
destructor
Definition at line 305 of file rational.cpp.
References Rational::dpointer, soplex::spx_free(), Rational::unusedPrivateList, and Rational::Private::~Private().
Referenced by soplex::dmaxSizeRational().
add product of two rationals
Definition at line 1389 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational(), and VectorBase< Rational >::operator*().
add quotient of two rationals, r divided by s
Definition at line 1493 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
|
static |
disables list memory
Definition at line 351 of file rational.cpp.
References Rational::freeListMem().
Referenced by soplex::dmaxSizeRational(), and main().
|
static |
enables list memory
Definition at line 328 of file rational.cpp.
References Rational::unusedPrivateList.
Referenced by soplex::dmaxSizeRational().
|
static |
frees the unused rational elements in the memory list
frees the unused rational elements in the memory list frees the unused rational elements in the memory list
this can be useful when you want to save memory or needed when working with a GMP memory manager like the one in EGlib that frees GMP memory before the destructor of the static memory list is called; in most cases this method is optional; note that this does not free the Rational elements that are currently in use
Definition at line 342 of file rational.cpp.
References Rational::unusedPrivateList.
Referenced by Rational::disableListMem(), and soplex::dmaxSizeRational().
const mpq_t * getMpqPtr | ( | ) | const |
provides read-only access to underlying mpq_t
Definition at line 472 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
mpq_t * getMpqPtr_w | ( | ) | const |
provides write access to underlying mpq_t; use with care
Definition at line 488 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
const mpq_t & getMpqRef | ( | ) | const |
provides read-only access to underlying mpq_t
Definition at line 480 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dlcmSizeRational(), soplex::dmaxSizeRational(), and soplex::Reconstruct().
mpq_t & getMpqRef_w | ( | ) | const |
provides write access to underlying mpq_t; use with care
Definition at line 496 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & invert | ( | ) |
inversion
Definition at line 1567 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational(), Rational::operator/(), soplex::operator/(), and Rational::operator/=().
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
checks if d is exactly equal to the Rational and if not, if it is one of the two adjacent doubles
Definition at line 1636 of file rational.cpp.
References Rational::dpointer, soplex::infinity, Rational::Private::privatevalue, and soplex::spxNextafter().
Referenced by soplex::dmaxSizeRational().
bool isNextTo | ( | const double & | d | ) |
checks if d
is the closest number that can be represented by double
checks if d is the closest possible double
Definition at line 1609 of file rational.cpp.
References Rational::dpointer, soplex::infinity, Rational::Private::privatevalue, Rational::Rational(), Rational::spxAbs, and soplex::spxNextafter().
Referenced by soplex::dmaxSizeRational().
operator double | ( | ) | const |
typecasts Rational to double (allows only explicit typecast)
Definition at line 407 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
operator float | ( | ) | const |
typecasts Rational to float (allows only explicit typecast)
Definition at line 451 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
operator long double | ( | ) | const |
typecasts Rational to long double (allows only explicit typecast)
Definition at line 430 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
multiplication operator
Definition at line 868 of file rational.cpp.
References Rational::dpointer, Rational::Private::privatevalue, and Rational::ZERO.
Referenced by soplex::dmaxSizeRational().
Rational operator* | ( | const double & | r | ) | const |
multiplication operator for doubles
Definition at line 947 of file rational.cpp.
References Rational::dpointer, Rational::Private::privatevalue, and Rational::ZERO.
Rational operator* | ( | const int & | r | ) | const |
multiplication operator for ints
Definition at line 1034 of file rational.cpp.
References Rational::dpointer, Rational::Private::privatevalue, and Rational::ZERO.
multiplication assignment operator operator
multiplication assignment operator
Definition at line 905 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
Rational & operator*= | ( | const double & | r | ) |
multiplication assignment operator for doubles
Definition at line 989 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & operator*= | ( | const int & | r | ) |
multiplication assignment operator for ints
Definition at line 1076 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
addition operator
Definition at line 504 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
Rational operator+ | ( | const double & | r | ) | const |
addition operator for doubles
Definition at line 559 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational operator+ | ( | const int & | r | ) | const |
addition operator for ints
Definition at line 620 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
addition assignment operator
Definition at line 532 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
Rational & operator+= | ( | const double & | r | ) |
addition assignment operator for doubles
Definition at line 588 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & operator+= | ( | const int & | r | ) |
addition assignment operator for ints
Definition at line 649 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
subtraction operator
Definition at line 681 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
Rational operator- | ( | const double & | r | ) | const |
subtraction operator for doubles
Definition at line 744 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational operator- | ( | const int & | r | ) | const |
subtraction operator for ints
Definition at line 806 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
subtraction assignment operator
Definition at line 709 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
Rational & operator-= | ( | const double & | r | ) |
subtraction assignment operator for doubles
Definition at line 773 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & operator-= | ( | const int & | r | ) |
subtraction assignment operator for ints
Definition at line 835 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
division operator
Definition at line 1121 of file rational.cpp.
References Rational::dpointer, Rational::invert(), Rational::Private::privatevalue, and Rational::ZERO.
Referenced by soplex::dmaxSizeRational().
Rational operator/ | ( | const double & | r | ) | const |
division operator for doubles
Definition at line 1205 of file rational.cpp.
References Rational::dpointer, Rational::invert(), Rational::Private::privatevalue, and Rational::ZERO.
Rational operator/ | ( | const int & | r | ) | const |
division operator for ints
Definition at line 1297 of file rational.cpp.
References Rational::dpointer, Rational::invert(), Rational::Private::privatevalue, and Rational::ZERO.
division assignment operator
Definition at line 1163 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
Rational & operator/= | ( | const double & | r | ) |
division assignment operator for doubles
Definition at line 1250 of file rational.cpp.
References Rational::dpointer, Rational::invert(), and Rational::Private::privatevalue.
Rational & operator/= | ( | const int & | r | ) |
division assignment operator for ints
Definition at line 1342 of file rational.cpp.
References Rational::dpointer, Rational::invert(), and Rational::Private::privatevalue.
assignment operator
Definition at line 360 of file rational.cpp.
References Rational::dpointer.
Referenced by soplex::dmaxSizeRational(), Rational::Private::next(), and Rational::Private::operator=().
Rational & operator= | ( | const long double & | r | ) |
assignment operator from long double
Definition at line 369 of file rational.cpp.
References Rational::dpointer.
Rational & operator= | ( | const double & | r | ) |
assignment operator from double
Definition at line 378 of file rational.cpp.
References Rational::dpointer.
Rational & operator= | ( | const int & | i | ) |
assignment operator from int
Definition at line 389 of file rational.cpp.
References Rational::dpointer.
Rational & operator= | ( | const mpq_t & | q | ) |
assignment operator from mpq_t
Definition at line 398 of file rational.cpp.
References Rational::dpointer.
Rational & powRound | ( | ) |
round up to next power of two
Definition at line 1576 of file rational.cpp.
References Rational::dpointer, MSG_DEBUG, Rational::Private::privatevalue, and Rational::rationalToString.
Referenced by soplex::dmaxSizeRational().
|
static |
returns precision of Rational implementation, i.e., number of bits used to store Rational numbers (INT_MAX if exact)
Definition at line 1680 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
bool readString | ( | const char * | s | ) |
read Rational from string
Definition at line 1689 of file rational.cpp.
References Rational::dpointer, MAX_STR_LEN, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational(), soplex::LPFreadValue(), soplex::MPSreadBounds(), soplex::MPSreadCols(), soplex::MPSreadRanges(), and soplex::MPSreadRhs().
int sizeInBase | ( | const int | base = 2 | ) | const |
Size in specified base (bit size for base 2)
Definition at line 1671 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational(), and soplex::totalSizeRational().
subtract product of two rationals
Definition at line 1440 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
subtract quotient of two rationals, r divided by s
Definition at line 1530 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
comparison operator returning a positive value if r > s, zero if r = s, and a negative value if r < s
Definition at line 2076 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
inequality operator
Definition at line 2092 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
inequality operator for Rational and double
Definition at line 2152 of file rational.cpp.
|
friend |
inequality operator double and Rational
inequality operator for double and Rational
Definition at line 2260 of file rational.cpp.
|
friend |
inequality operator for Rational and long double
Definition at line 2320 of file rational.cpp.
|
friend |
inequality operator for long double and Rational
Definition at line 2428 of file rational.cpp.
|
friend |
inequality operator for Rational and float
Definition at line 2487 of file rational.cpp.
|
friend |
inequality operator for float and Rational
Definition at line 2595 of file rational.cpp.
|
friend |
inequality operator for Rational and int
Definition at line 2720 of file rational.cpp.
|
friend |
inequality operator int and Rational
inequality operator for int and Rational
Definition at line 2828 of file rational.cpp.
multiplication operator for double and Rational
Definition at line 2653 of file rational.cpp.
multiplication operator for int and Rational
Definition at line 2887 of file rational.cpp.
addition operator for double and Rational
Definition at line 2635 of file rational.cpp.
addition operator for int and Rational
Definition at line 2868 of file rational.cpp.
subtraction operator for double and Rational
Definition at line 2642 of file rational.cpp.
subtraction operator for int and Rational
Definition at line 2876 of file rational.cpp.
Negation.
Definition at line 2952 of file rational.cpp.
division operator for double and Rational
Definition at line 2672 of file rational.cpp.
division operator for int and Rational
Definition at line 2906 of file rational.cpp.
less than operator
Definition at line 2100 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
less than operator for Rational and double
Definition at line 2172 of file rational.cpp.
|
friend |
less than operator double and Rational
less than operator for double and Rational
Definition at line 2268 of file rational.cpp.
|
friend |
less than operator for Rational and long double
Definition at line 2340 of file rational.cpp.
|
friend |
less than operator for long double and Rational
Definition at line 2436 of file rational.cpp.
|
friend |
less than operator for Rational and float
Definition at line 2507 of file rational.cpp.
|
friend |
less than operator for float and Rational
Definition at line 2603 of file rational.cpp.
|
friend |
less than operator for Rational and int
Definition at line 2740 of file rational.cpp.
|
friend |
less than operator int and Rational
less than operator for int and Rational
Definition at line 2836 of file rational.cpp.
|
friend |
print Rational
Definition at line 2063 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
less than or equal to operator
Definition at line 2108 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
less than or equal to operator for Rational and double
Definition at line 2192 of file rational.cpp.
|
friend |
less than or equal to operator double and Rational
less than or equal to operator for double and Rational
Definition at line 2276 of file rational.cpp.
|
friend |
less than or equal to operator for Rational and long double
Definition at line 2360 of file rational.cpp.
|
friend |
less than or equal to operator for long double and Rational
Definition at line 2444 of file rational.cpp.
|
friend |
less than or equal to operator for Rational and float
Definition at line 2527 of file rational.cpp.
|
friend |
less than or equal to operator for float and Rational
Definition at line 2611 of file rational.cpp.
|
friend |
less than or equal to operator for Rational and int
Definition at line 2760 of file rational.cpp.
|
friend |
less than or equal to operator int and Rational
less than or equal to operator for int and Rational
Definition at line 2844 of file rational.cpp.
equality operator
Definition at line 2084 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
equality operator for Rational and double
Definition at line 2132 of file rational.cpp.
|
friend |
equality operator for double and Rational
Definition at line 2252 of file rational.cpp.
|
friend |
equality operator for Rational and long double
Definition at line 2300 of file rational.cpp.
|
friend |
equality operator for long double and Rational
Definition at line 2420 of file rational.cpp.
|
friend |
equality operator for Rational and float
Definition at line 2467 of file rational.cpp.
|
friend |
equality operator for float and Rational
Definition at line 2587 of file rational.cpp.
|
friend |
equality operator for Rational and int
Definition at line 2700 of file rational.cpp.
|
friend |
equality operator for int and Rational
Definition at line 2820 of file rational.cpp.
greater than operator
Definition at line 2116 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
greater than operator for Rational and double
Definition at line 2212 of file rational.cpp.
|
friend |
greater than operator double and Rational
greater than operator for double and Rational
Definition at line 2284 of file rational.cpp.
|
friend |
greater than operator for Rational and long double
Definition at line 2380 of file rational.cpp.
|
friend |
greater than operator for long double and Rational
Definition at line 2452 of file rational.cpp.
|
friend |
greater than operator for Rational and float
Definition at line 2547 of file rational.cpp.
|
friend |
greater than operator for float and Rational
Definition at line 2619 of file rational.cpp.
|
friend |
greater than operator for Rational and int
Definition at line 2780 of file rational.cpp.
|
friend |
greater than operator int and Rational
greater than operator for int and Rational
Definition at line 2852 of file rational.cpp.
greater than or equal to operator
Definition at line 2124 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
greater than or equal to operator for Rational and double
Definition at line 2232 of file rational.cpp.
|
friend |
greater than or equal to operator double and Rational
greater than or equal to operator for double and Rational
Definition at line 2292 of file rational.cpp.
|
friend |
greater than or equal to operator for Rational and long double
Definition at line 2400 of file rational.cpp.
|
friend |
greater than or equal to operator for long double and Rational
Definition at line 2460 of file rational.cpp.
|
friend |
greater than or equal to operator for Rational and float
Definition at line 2567 of file rational.cpp.
|
friend |
greater than or equal to operator for float and Rational
Definition at line 2627 of file rational.cpp.
|
friend |
greater than or equal to operator for Rational and int
Definition at line 2800 of file rational.cpp.
|
friend |
greater than or equal to operator int and Rational
greater than or equal to operator for int and Rational
Definition at line 2860 of file rational.cpp.
|
friend |
convert rational number to string
Definition at line 1858 of file rational.cpp.
Referenced by soplex::dmaxSizeRational(), and Rational::powRound().
|
friend |
read Rational from string
Definition at line 1897 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
Sign function; returns 1 if r > 0, 0 if r = 0, and -1 if r < 0.
Definition at line 2944 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
Absolute.
absolute function
Definition at line 2934 of file rational.cpp.
Referenced by soplex::dmaxSizeRational(), and Rational::isNextTo().
|
private |
Definition at line 65 of file rational.h.
Referenced by Rational::addProduct(), Rational::addQuotient(), soplex::compareRational(), soplex::dmaxSizeRational(), Rational::getMpqPtr(), Rational::getMpqPtr_w(), Rational::getMpqRef(), Rational::getMpqRef_w(), Rational::invert(), Rational::isAdjacentTo(), Rational::isNextTo(), Rational::Private::next(), Rational::operator double(), Rational::operator float(), Rational::operator long double(), soplex::operator!=(), Rational::operator*(), soplex::operator*(), Rational::operator*=(), Rational::operator+(), Rational::operator+=(), Rational::operator-(), soplex::operator-(), Rational::operator-=(), Rational::operator/(), soplex::operator/(), Rational::operator/=(), soplex::operator<(), soplex::operator<<(), soplex::operator<=(), Rational::operator=(), Rational::Private::operator=(), soplex::operator==(), soplex::operator>(), soplex::operator>=(), Rational::powRound(), Rational::Private::Private(), Rational::Rational(), Rational::readString(), soplex::readStringRational(), soplex::sign(), Rational::sizeInBase(), soplex::spxAbs(), Rational::subProduct(), Rational::subQuotient(), and Rational::~Rational().
|
staticprivate |
rational minus one (GMP only)
Definition at line 82 of file rational.h.
Referenced by Rational::Private::operator=(), and Rational::Private::Private().
|
staticprivate |
rational plus one (GMP only)
Definition at line 81 of file rational.h.
Referenced by Rational::Private::operator=(), and Rational::Private::Private().
|
staticprivate |
list of unused Private objects
Definition at line 69 of file rational.h.
Referenced by Rational::enableListMem(), Rational::freeListMem(), Rational::Private::next(), Rational::Rational(), and Rational::~Rational().
|
staticprivate |
list of unused Private objects; note that this cannot be used if SOPLEX_WITH_GMP is not defined, since then the Private class has no member next() and prev() should list memory be used?
Definition at line 70 of file rational.h.
Referenced by Rational::Private::next().
|
staticprivate |
rational zero (GMP only)
Definition at line 80 of file rational.h.
Referenced by Rational::operator*(), soplex::operator*(), Rational::operator/(), soplex::operator/(), Rational::Private::operator=(), and Rational::Private::Private().