Scippy

SoPlex

Sequential object-oriented simPlex

rational.h File Reference

Wrapper for GMP types. More...

#include <math.h>
#include <assert.h>
#include <string.h>
#include <iostream>
#include "soplex/spxdefines.h"
#include "soplex/idlist.h"

Go to the source code of this file.

Classes

class  Rational
 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...
 

Namespaces

 soplex
 Everything should be within this namespace.
 

Functions

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 &r)
 print Rational More...
 
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)
 equality operator More...
 
bool operator!= (const Rational &r, const Rational &s)
 inequality 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)
 equality operator for Rational and double More...
 
bool operator!= (const Rational &r, const double &s)
 inequality 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)
 equality operator for double and Rational More...
 
bool operator!= (const double &r, const Rational &s)
 inequality operator 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)
 equality operator for Rational and long double 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)
 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)
 equality operator for long double and Rational More...
 
bool operator!= (const long double &r, const Rational &s)
 inequality operator long double and Rational More...
 
bool operator< (const long double &r, const Rational &s)
 less than operator long double and Rational More...
 
bool operator<= (const long double &r, const Rational &s)
 less than or equal to operator long double and Rational More...
 
bool operator> (const long double &r, const Rational &s)
 greater than operator long double and Rational More...
 
bool operator>= (const long double &r, const Rational &s)
 greater than or equal to operator long double and Rational More...
 
bool operator== (const Rational &r, const int &s)
 equality operator for Rational and int More...
 
bool operator!= (const Rational &r, const int &s)
 inequality 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)
 equality operator for int and Rational More...
 
bool operator!= (const int &r, const Rational &s)
 inequality operator for int and Rational More...
 
bool operator< (const int &r, const Rational &s)
 less than operator for int and Rational More...
 
bool operator<= (const int &r, const Rational &s)
 less than or equal to operator for int and Rational More...
 
bool operator> (const int &r, const Rational &s)
 greater than operator for int and Rational More...
 
bool operator>= (const int &r, const Rational &s)
 greater than or equal to operator for int and Rational More...
 
Rational operator+ (const double &d, const Rational &r)
 addition operator for double and Rational More...
 
Rational operator+ (const int &d, const Rational &r)
 addition 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 &r)
 Negation. More...
 
int totalSizeRational (const Rational *vector, const int length, const int base)
 Total size of rational vector. More...
 
int dlcmSizeRational (const Rational *vector, const int length, const int base)
 Size of least common multiple of denominators in rational vector. More...
 
int dmaxSizeRational (const Rational *vector, const int length, const int base)
 Size of largest denominator in rational vector. More...
 

Detailed Description

Wrapper for GMP types.

Definition in file rational.h.