SCIP Doxygen Documentation
Loading...
Searching...
No Matches
scip::Rational Class Reference

Detailed Description

Definition at line 68 of file multiprecision.hpp.

#include <multiprecision.hpp>

Public Member Functions

 Rational ()
 Rational (const Rational &r)
 copy constructor
 Rational (const char *s)
Rationaloperator= (const Rational &r)
 Rational (const long long num, const long long den)
 Rational (const Rational &num, const Rational &den)
 Rational (const std::string &s)
 Rational (const double d)
int sign () const
bool is_zero () const
std::string str () const
Rationaloperator= (const double &r)
Rationaloperator= (const int &i)
Rationaloperator+ (const Rational &r)
Rationaloperator+ (const double &r)
Rationaloperator- (const Rational &r)
Rationaloperator- (const double &r)
Rationaloperator- ()
Rationaloperator* (const Rational &r)
Rationaloperator* (const double &r)
Rationaloperator*= (const double &r)
Rationaloperator+= (const Rational &r)
Rationaloperator+= (const double &r)
Rationaloperator-= (const Rational &r)
Rationaloperator-= (const double &r)
Rationaloperator/ (const Rational &r)
Rationaloperator/ (const double &r)

Data Fields

double val

Friends

std::ostream & operator<< (std::ostream &os, const Rational &q)
double operator/ (const double d, const Rational &r)
bool operator< (const Rational &r, const double &d)
bool operator< (const Rational &r, const Rational &d)
bool operator> (const Rational &r, const double &d)
bool operator> (const Rational &r, const Rational &d)
bool operator<= (const Rational &r, const double &d)
bool operator<= (const Rational &r, const Rational &d)
bool operator>= (const Rational &r, const double &d)
bool operator>= (const Rational &r, const Rational &d)
bool operator== (const Rational &r, const double &d)
bool operator== (const Rational &r, const Rational &d)

Constructor & Destructor Documentation

◆ Rational() [1/7]

◆ Rational() [2/7]

scip::Rational::Rational ( const Rational & r)
inline

copy constructor

Definition at line 74 of file multiprecision.hpp.

References r, and Rational().

◆ Rational() [3/7]

scip::Rational::Rational ( const char * s)
inline

Definition at line 75 of file multiprecision.hpp.

References val.

◆ Rational() [4/7]

scip::Rational::Rational ( const long long num,
const long long den )
inline

Definition at line 77 of file multiprecision.hpp.

References val.

◆ Rational() [5/7]

scip::Rational::Rational ( const Rational & num,
const Rational & den )
inline

Definition at line 78 of file multiprecision.hpp.

References Rational(), and val.

◆ Rational() [6/7]

scip::Rational::Rational ( const std::string & s)
inline

Definition at line 79 of file multiprecision.hpp.

References val.

◆ Rational() [7/7]

scip::Rational::Rational ( const double d)
inline

Definition at line 80 of file multiprecision.hpp.

References val.

Member Function Documentation

◆ operator=() [1/3]

Rational & scip::Rational::operator= ( const Rational & r)
inline

Definition at line 76 of file multiprecision.hpp.

References r, Rational(), and val.

◆ sign()

◆ is_zero()

bool scip::Rational::is_zero ( ) const
inline

◆ str()

std::string scip::Rational::str ( ) const
inline

◆ operator=() [2/3]

Rational & scip::Rational::operator= ( const double & r)
inline

Definition at line 84 of file multiprecision.hpp.

References r, Rational(), and val.

◆ operator=() [3/3]

Rational & scip::Rational::operator= ( const int & i)
inline

Definition at line 85 of file multiprecision.hpp.

References i, Rational(), and val.

◆ operator+() [1/2]

Rational & scip::Rational::operator+ ( const Rational & r)
inline

Definition at line 86 of file multiprecision.hpp.

References r, and Rational().

◆ operator+() [2/2]

Rational & scip::Rational::operator+ ( const double & r)
inline

Definition at line 87 of file multiprecision.hpp.

References r, and Rational().

◆ operator-() [1/3]

Rational & scip::Rational::operator- ( const Rational & r)
inline

Definition at line 88 of file multiprecision.hpp.

References r, and Rational().

◆ operator-() [2/3]

Rational & scip::Rational::operator- ( const double & r)
inline

Definition at line 89 of file multiprecision.hpp.

References r, and Rational().

◆ operator-() [3/3]

Rational & scip::Rational::operator- ( )
inline

Definition at line 90 of file multiprecision.hpp.

References Rational().

◆ operator*() [1/2]

Rational & scip::Rational::operator* ( const Rational & r)
inline

Definition at line 91 of file multiprecision.hpp.

References r, and Rational().

◆ operator*() [2/2]

Rational & scip::Rational::operator* ( const double & r)
inline

Definition at line 92 of file multiprecision.hpp.

References r, and Rational().

◆ operator*=()

Rational & scip::Rational::operator*= ( const double & r)
inline

Definition at line 93 of file multiprecision.hpp.

References r, and Rational().

◆ operator+=() [1/2]

Rational & scip::Rational::operator+= ( const Rational & r)
inline

Definition at line 94 of file multiprecision.hpp.

References r, and Rational().

◆ operator+=() [2/2]

Rational & scip::Rational::operator+= ( const double & r)
inline

Definition at line 95 of file multiprecision.hpp.

References r, and Rational().

◆ operator-=() [1/2]

Rational & scip::Rational::operator-= ( const Rational & r)
inline

Definition at line 96 of file multiprecision.hpp.

References r, and Rational().

◆ operator-=() [2/2]

Rational & scip::Rational::operator-= ( const double & r)
inline

Definition at line 97 of file multiprecision.hpp.

References r, and Rational().

◆ operator/() [1/2]

Rational & scip::Rational::operator/ ( const Rational & r)
inline

Definition at line 98 of file multiprecision.hpp.

References r, and Rational().

◆ operator/() [2/2]

Rational & scip::Rational::operator/ ( const double & r)
inline

Definition at line 99 of file multiprecision.hpp.

References r, and Rational().

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Rational & q )
friend

Definition at line 100 of file multiprecision.hpp.

References Rational().

◆ operator/

double operator/ ( const double d,
const Rational & r )
friend

Definition at line 101 of file multiprecision.hpp.

References r, and Rational().

◆ operator< [1/2]

bool operator< ( const Rational & r,
const double & d )
friend

Definition at line 102 of file multiprecision.hpp.

References r, and Rational().

◆ operator< [2/2]

bool operator< ( const Rational & r,
const Rational & d )
friend

Definition at line 103 of file multiprecision.hpp.

References r, and Rational().

◆ operator> [1/2]

bool operator> ( const Rational & r,
const double & d )
friend

Definition at line 104 of file multiprecision.hpp.

References r, and Rational().

◆ operator> [2/2]

bool operator> ( const Rational & r,
const Rational & d )
friend

Definition at line 105 of file multiprecision.hpp.

References r, and Rational().

◆ operator<= [1/2]

bool operator<= ( const Rational & r,
const double & d )
friend

Definition at line 106 of file multiprecision.hpp.

References r, and Rational().

◆ operator<= [2/2]

bool operator<= ( const Rational & r,
const Rational & d )
friend

Definition at line 107 of file multiprecision.hpp.

References r, and Rational().

◆ operator>= [1/2]

bool operator>= ( const Rational & r,
const double & d )
friend

Definition at line 108 of file multiprecision.hpp.

References r, and Rational().

◆ operator>= [2/2]

bool operator>= ( const Rational & r,
const Rational & d )
friend

Definition at line 109 of file multiprecision.hpp.

References r, and Rational().

◆ operator== [1/2]

bool operator== ( const Rational & r,
const double & d )
friend

Definition at line 110 of file multiprecision.hpp.

References r, and Rational().

◆ operator== [2/2]

bool operator== ( const Rational & r,
const Rational & d )
friend

Definition at line 111 of file multiprecision.hpp.

References r, and Rational().

Field Documentation

◆ val

double scip::Rational::val