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... | |
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... | |
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... | |
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... | |
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 44 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 364 of file rational.cpp.
References Rational::dpointer, Rational::Private::Private(), Rational::Private::privatevalue, and soplex::spx_alloc().
Rational | ( | ) |
default constructor
Definition at line 377 of file rational.cpp.
References Rational::dpointer, Rational::Private::Private(), soplex::spx_alloc(), and Rational::unusedPrivateList.
Referenced by soplex::dmaxSizeRational(), Rational::isNextTo(), soplex::operator!=(), soplex::operator<(), soplex::operator<=(), soplex::operator==(), soplex::operator>(), and soplex::operator>=().
copy constructor
Definition at line 409 of file rational.cpp.
References Rational::dpointer, Rational::Private::Private(), soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const long double & | r | ) |
constructor from long double
Definition at line 442 of file rational.cpp.
References Rational::dpointer, Rational::Private::Private(), soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const double & | r | ) |
constructor from double
Definition at line 475 of file rational.cpp.
References Rational::dpointer, Rational::Private::Private(), soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const int & | i | ) |
constructor from int
Definition at line 508 of file rational.cpp.
References Rational::dpointer, Rational::Private::Private(), soplex::spx_alloc(), and Rational::unusedPrivateList.
Rational | ( | const mpq_t & | q | ) |
constructor from mpq_t (GMP only)
constructor from mpq_t
Definition at line 541 of file rational.cpp.
References Rational::dpointer, Rational::Private::Private(), soplex::spx_alloc(), and Rational::unusedPrivateList.
~Rational | ( | ) |
destructor
Definition at line 574 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 1637 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by SoPlex::_computeInfeasBox(), soplex::dmaxSizeRational(), and VectorBase< Real >::operator*().
add quotient of two rationals, r divided by s
Definition at line 1741 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by soplex::dmaxSizeRational().
|
static |
disables list memory
Definition at line 620 of file rational.cpp.
References Rational::freeListMem().
Referenced by soplex::dmaxSizeRational(), and main().
|
static |
enables list memory
Definition at line 597 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 611 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 720 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 736 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 728 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 744 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & invert | ( | ) |
inversion
Definition at line 1815 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by SoPlex::_performOptIRStable(), 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 1886 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 1857 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 674 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 697 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
multiplication operator
Definition at line 1116 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 1195 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 1282 of file rational.cpp.
References Rational::dpointer, Rational::Private::privatevalue, and Rational::ZERO.
multiplication assignment operator operator
multiplication assignment operator
Definition at line 1153 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 1237 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & operator*= | ( | const int & | r | ) |
multiplication assignment operator for ints
Definition at line 1324 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
addition operator
Definition at line 752 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 807 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational operator+ | ( | const int & | r | ) | const |
addition operator for ints
Definition at line 868 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
addition assignment operator
Definition at line 780 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 836 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & operator+= | ( | const int & | r | ) |
addition assignment operator for ints
Definition at line 897 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
subtraction operator
Definition at line 929 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 992 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational operator- | ( | const int & | r | ) | const |
subtraction operator for ints
Definition at line 1054 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
subtraction assignment operator
Definition at line 957 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 1021 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Rational & operator-= | ( | const int & | r | ) |
subtraction assignment operator for ints
Definition at line 1083 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
division operator
Definition at line 1369 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 1453 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 1545 of file rational.cpp.
References Rational::dpointer, Rational::invert(), Rational::Private::privatevalue, and Rational::ZERO.
division assignment operator
Definition at line 1411 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 1498 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 1590 of file rational.cpp.
References Rational::dpointer, Rational::invert(), and Rational::Private::privatevalue.
assignment operator
Definition at line 629 of file rational.cpp.
References Rational::dpointer.
Referenced by soplex::dmaxSizeRational().
Rational & operator= | ( | const long double & | r | ) |
assignment operator from long double
Definition at line 638 of file rational.cpp.
References Rational::dpointer.
Rational & operator= | ( | const double & | r | ) |
assignment operator from double
Definition at line 647 of file rational.cpp.
References Rational::dpointer.
Rational & operator= | ( | const int & | i | ) |
assignment operator from int
Definition at line 656 of file rational.cpp.
References Rational::dpointer.
Rational & operator= | ( | const mpq_t & | q | ) |
assignment operator from mpq_t
Definition at line 665 of file rational.cpp.
References Rational::dpointer.
Rational & powRound | ( | ) |
round up to next power of two
Definition at line 1824 of file rational.cpp.
References Rational::dpointer, MSG_DEBUG, Rational::Private::privatevalue, and Rational::rationalToString.
Referenced by SoPlex::_performOptIRStable(), and 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 1930 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
bool readString | ( | const char * | s | ) |
read Rational from string
Definition at line 1939 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 1921 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 1688 of file rational.cpp.
References Rational::dpointer, and Rational::Private::privatevalue.
Referenced by SoPlex::_computeInfeasBox(), and soplex::dmaxSizeRational().
subtract quotient of two rationals, r divided by s
Definition at line 1778 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 2326 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
inequality operator
Definition at line 2342 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
inequality operator for Rational and double
Definition at line 2402 of file rational.cpp.
|
friend |
inequality operator double and Rational
inequality operator for double and Rational
Definition at line 2510 of file rational.cpp.
|
friend |
inequality operator for Rational and long double
Definition at line 2570 of file rational.cpp.
|
friend |
inequality operator for long double and Rational
Definition at line 2678 of file rational.cpp.
|
friend |
inequality operator for Rational and int
Definition at line 2804 of file rational.cpp.
|
friend |
inequality operator int and Rational
inequality operator for int and Rational
Definition at line 2912 of file rational.cpp.
multiplication operator for double and Rational
Definition at line 2737 of file rational.cpp.
multiplication operator for int and Rational
Definition at line 2971 of file rational.cpp.
addition operator for double and Rational
Definition at line 2718 of file rational.cpp.
addition operator for int and Rational
Definition at line 2952 of file rational.cpp.
subtraction operator for double and Rational
Definition at line 2726 of file rational.cpp.
subtraction operator for int and Rational
Definition at line 2960 of file rational.cpp.
Negation.
Definition at line 3036 of file rational.cpp.
division operator for double and Rational
Definition at line 2756 of file rational.cpp.
division operator for int and Rational
Definition at line 2990 of file rational.cpp.
less than operator
Definition at line 2350 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
less than operator for Rational and double
Definition at line 2422 of file rational.cpp.
|
friend |
less than operator double and Rational
less than operator for double and Rational
Definition at line 2518 of file rational.cpp.
|
friend |
less than operator for Rational and long double
Definition at line 2590 of file rational.cpp.
|
friend |
less than operator for long double and Rational
Definition at line 2686 of file rational.cpp.
|
friend |
less than operator for Rational and int
Definition at line 2824 of file rational.cpp.
|
friend |
less than operator int and Rational
less than operator for int and Rational
Definition at line 2920 of file rational.cpp.
|
friend |
print Rational
Definition at line 2313 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
less than or equal to operator
Definition at line 2358 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
less than or equal to operator for Rational and double
Definition at line 2442 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 2526 of file rational.cpp.
|
friend |
less than or equal to operator for Rational and long double
Definition at line 2610 of file rational.cpp.
|
friend |
less than or equal to operator for long double and Rational
Definition at line 2694 of file rational.cpp.
|
friend |
less than or equal to operator for Rational and int
Definition at line 2844 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 2928 of file rational.cpp.
equality operator
Definition at line 2334 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
equality operator for Rational and double
Definition at line 2382 of file rational.cpp.
|
friend |
equality operator for double and Rational
Definition at line 2502 of file rational.cpp.
|
friend |
equality operator for Rational and long double
Definition at line 2550 of file rational.cpp.
|
friend |
equality operator for long double and Rational
Definition at line 2670 of file rational.cpp.
|
friend |
equality operator for Rational and int
Definition at line 2784 of file rational.cpp.
|
friend |
equality operator for int and Rational
Definition at line 2904 of file rational.cpp.
greater than operator
Definition at line 2366 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
greater than operator for Rational and double
Definition at line 2462 of file rational.cpp.
|
friend |
greater than operator double and Rational
greater than operator for double and Rational
Definition at line 2534 of file rational.cpp.
|
friend |
greater than operator for Rational and long double
Definition at line 2630 of file rational.cpp.
|
friend |
greater than operator for long double and Rational
Definition at line 2702 of file rational.cpp.
|
friend |
greater than operator for Rational and int
Definition at line 2864 of file rational.cpp.
|
friend |
greater than operator int and Rational
greater than operator for int and Rational
Definition at line 2936 of file rational.cpp.
greater than or equal to operator
Definition at line 2374 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
|
friend |
greater than or equal to operator for Rational and double
Definition at line 2482 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 2542 of file rational.cpp.
|
friend |
greater than or equal to operator for Rational and long double
Definition at line 2650 of file rational.cpp.
|
friend |
greater than or equal to operator for long double and Rational
Definition at line 2710 of file rational.cpp.
|
friend |
greater than or equal to operator for Rational and int
Definition at line 2884 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 2944 of file rational.cpp.
|
friend |
convert rational number to string
Definition at line 2108 of file rational.cpp.
Referenced by soplex::dmaxSizeRational(), and Rational::powRound().
|
friend |
read Rational from string
Definition at line 2147 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 3028 of file rational.cpp.
Referenced by soplex::dmaxSizeRational().
Absolute.
absolute function
Definition at line 3018 of file rational.cpp.
Referenced by soplex::dmaxSizeRational(), and Rational::isNextTo().
|
private |
Definition at line 47 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::operator double(), 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 64 of file rational.h.
|
staticprivate |
rational plus one (GMP only)
Definition at line 63 of file rational.h.
|
staticprivate |
list of unused Private objects
Definition at line 51 of file rational.h.
Referenced by Rational::enableListMem(), Rational::freeListMem(), 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 52 of file rational.h.
|
staticprivate |
rational zero (GMP only)
Definition at line 62 of file rational.h.
Referenced by Rational::operator*(), soplex::operator*(), Rational::operator/(), and soplex::operator/().