Wildmeshing Toolkit
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Friends | List of all members
wmtk::Rational Class Reference

Public Member Functions

void canonicalize ()
 
int get_sign ()
 
template<typename T >
void init (const T &v)
 
void init_from_bin (const std::string &bin)
 
 Rational (double d)
 
 Rational (const mpq_t &v_)
 
 Rational (const Rational &other)
 
Rationaloperator= (const Rational &x)
 
Rationaloperator= (const double x)
 
double to_double () const
 
 operator double () const
 
std::string get_str ()
 
std::string get_num_str () const
 
std::string get_den_str () const
 

Public Attributes

mpq_t value
 

Friends

Rational operator+ (const Rational &x, const Rational &y)
 
Rational operator- (const Rational &x, const Rational &y)
 
Rational operator- (const Rational &x)
 
Rational pow (const Rational &x, int p)
 
Rational operator* (const Rational &x, const Rational &y)
 
Rational operator/ (const Rational &x, const Rational &y)
 
bool operator< (const Rational &r, const Rational &r1)
 
bool operator> (const Rational &r, const Rational &r1)
 
bool operator<= (const Rational &r, const Rational &r1)
 
bool operator>= (const Rational &r, const Rational &r1)
 
bool operator== (const Rational &r, const Rational &r1)
 
bool operator!= (const Rational &r, const Rational &r1)
 
Rational abs (const Rational &r0)
 
std::ostream & operator<< (std::ostream &os, const Rational &r)
 

The documentation for this class was generated from the following file: