rational.h
Go to the documentation of this file.
54 /// special constructor only for initializing static rational variables; this is necessary since we need a 100 /** this can be useful when you want to save memory or needed when working with a GMP memory manager like the one 101 * in EGlib that frees GMP memory before the destructor of the static memory list is called; in most cases this 102 * method is optional; note that this does not free the Rational elements that are currently in use 263 /// checks if \p d is exactly equal to the Rational and if not, if it is one of the two adjacent doubles 281 /// returns precision of Rational implementation, i.e., number of bits used to store Rational numbers (INT_MAX if exact) 389 /// comparison operator returning a positive value if r > s, zero if r = s, and a negative value if r < s Rational & addProduct(const Rational &r, const Rational &s) add product of two rationals Definition: rational.cpp:3372 bool isNextTo(const double &d) checks if d is the closest number that can be represented by double Definition: rational.cpp:3426 Generic Real linked list. friend std::string rationalToString(const Rational &r, const int precision) convert rational number to string Definition: rational.cpp:3468 int dlcmSizeRational(const Rational *vector, const int length, const int base) Size of least common multiple of denominators in rational vector. Definition: rational.cpp:3973 Generic Real linked list.Class IdList implements an intrusive Real linked list as a template class... Definition: idlist.h:123 friend bool operator<(const Rational &r, const Rational &s) less than operator Definition: rational.cpp:3524 friend bool operator<=(const Rational &r, const Rational &s) less than or equal to operator Definition: rational.cpp:3532 friend bool operator!=(const Rational &r, const Rational &s) inequality operator Definition: rational.cpp:3516 Rational & subProduct(const Rational &r, const Rational &s) subtract product of two rationals Definition: rational.cpp:3381 friend bool operator>=(const Rational &r, const Rational &s) greater than or equal to operator Definition: rational.cpp:3548 int totalSizeRational(const Rational *vector, const int length, const int base) Total size of rational vector. Definition: rational.cpp:3956 Wrapper for GMP type mpq_class.We wrap mpq_class so that we can replace it by a double type if GMP is... Definition: rational.h:45 Rational & operator-=(const Rational &r) subtraction assignment operator Definition: rational.cpp:3211 static void freeListMem() frees the unused rational elements in the memory list Definition: rational.cpp:3075 int dmaxSizeRational(const Rational *vector, const int length, const int base) Size of largest denominator in rational vector. Definition: rational.cpp:3985 Rational & operator*=(const Rational &r) multiplication assignment operator operator Definition: rational.cpp:3268 static int precision() returns precision of Rational implementation, i.e., number of bits used to store Rational numbers (IN... Definition: rational.cpp:3451 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 ... Definition: rational.cpp:3434 friend int sign(const Rational &r) Sign function; returns 1 if r > 0, 0 if r = 0, and -1 if r < 0. Definition: rational.cpp:3938 friend std::ostream & operator<<(std::ostream &os, const Rational &q) print Rational Definition: rational.cpp:3486 Debugging, floating point type and parameter definitions. friend bool operator==(const Rational &r, const Rational &s) equality operator Definition: rational.cpp:3508 static IdList< Private > unusedPrivateList Definition: rational.h:51 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... Definition: rational.cpp:3495 Everything should be within this namespace. friend bool readStringRational(const char *s, Rational &value) read Rational from string Definition: rational.cpp:3478 Rational & subQuotient(const Rational &r, const Rational &s) subtract quotient of two rationals, r divided by s Definition: rational.cpp:3399 friend bool operator>(const Rational &r, const Rational &s) greater than operator Definition: rational.cpp:3540 int sizeInBase(const int base=2) const Size in specified base (bit size for base 2) Definition: rational.cpp:3442 Rational & addQuotient(const Rational &r, const Rational &s) add quotient of two rationals, r divided by s Definition: rational.cpp:3390 |