Wildmeshing Toolkit
|
#include <Rational.hpp>
Public Member Functions | |
Rational (bool rounded=false) | |
Rational (int v, bool rounded=false) | |
Rational (double d, bool rounded=false) | |
Rational (const mpq_t &v_) | |
Rational (const Rational &other) | |
Rational (const Rational &other, bool rounded) | |
Rational (const Eigen::VectorX< char > &data) | |
Rational (const std::string &data, bool rounded=false) | |
Rational & | operator= (const Rational &x) |
Rational & | operator= (const double x) |
template<typename T > | |
void | init (const T &v) |
~Rational () | |
void | canonicalize () |
int | get_sign () const |
double | to_double () const |
operator double () const | |
void | round () |
bool | can_be_rounded () |
void | init_from_binary (const std::string &v) |
std::string | to_binary () const |
std::string | serialize () const |
bool | is_rounded () const |
Private Member Functions | |
std::string | numerator () const |
std::string | denominator () const |
Private Attributes | |
mpq_t | value |
double | d_value |
bool | m_is_rounded |
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 | abs (const Rational &r0) |
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) |
std::ostream & | operator<< (std::ostream &os, const Rational &r) |
int | cmp (const Rational &r, const Rational &r1) |
Definition at line 12 of file Rational.hpp.
wmtk::Rational::Rational | ( | bool | rounded = false | ) |
Definition at line 22 of file Rational.cpp.
wmtk::Rational::Rational | ( | int | v, |
bool | rounded = false |
||
) |
Definition at line 26 of file Rational.cpp.
wmtk::Rational::Rational | ( | double | d, |
bool | rounded = false |
||
) |
Definition at line 30 of file Rational.cpp.
References d_value, m_is_rounded, and value.
wmtk::Rational::Rational | ( | const mpq_t & | v_ | ) |
Definition at line 44 of file Rational.cpp.
References d_value, m_is_rounded, and value.
wmtk::Rational::Rational | ( | const Rational & | other | ) |
Definition at line 54 of file Rational.cpp.
References m_is_rounded, and value.
wmtk::Rational::Rational | ( | const Rational & | other, |
bool | rounded | ||
) |
Definition at line 63 of file Rational.cpp.
References d_value, m_is_rounded, to_double(), and value.
wmtk::Rational::Rational | ( | const Eigen::VectorX< char > & | data | ) |
Definition at line 371 of file Rational.cpp.
References d_value, m_is_rounded, and value.
wmtk::Rational::Rational | ( | const std::string & | data, |
bool | rounded = false |
||
) |
Definition at line 82 of file Rational.cpp.
References d_value, m_is_rounded, and value.
wmtk::Rational::~Rational | ( | ) |
Definition at line 99 of file Rational.cpp.
References m_is_rounded, and value.
|
inline |
Definition at line 74 of file Rational.hpp.
References m_is_rounded, and to_double().
void wmtk::Rational::canonicalize | ( | ) |
Definition at line 9 of file Rational.cpp.
References m_is_rounded, and value.
|
private |
Definition at line 449 of file Rational.cpp.
References d_value, m_is_rounded, and value.
Referenced by serialize().
int wmtk::Rational::get_sign | ( | ) | const |
Definition at line 15 of file Rational.cpp.
References d_value, m_is_rounded, and value.
Referenced by wmtk::utils::segment_intersection_rational(), wmtk::components::internal::segment_segment_inter(), wmtk::utils::wmtk_orient2d(), and wmtk::utils::wmtk_orient3d().
|
inline |
Definition at line 28 of file Rational.hpp.
References m_is_rounded, and value.
void wmtk::Rational::init_from_binary | ( | const std::string & | v | ) |
Definition at line 346 of file Rational.cpp.
References value.
Referenced by wmtk::HDF5Reader::read_mesh().
|
inline |
Definition at line 86 of file Rational.hpp.
References m_is_rounded.
Referenced by wmtk::utils::rational_to_interval(), and wmtk::utils::wmtk_orient3d().
|
private |
Definition at line 427 of file Rational.cpp.
References d_value, m_is_rounded, and value.
Referenced by serialize().
|
explicit |
Definition at line 323 of file Rational.cpp.
Rational & wmtk::Rational::operator= | ( | const double | x | ) |
Definition at line 247 of file Rational.cpp.
References d_value, m_is_rounded, and value.
Definition at line 230 of file Rational.cpp.
References d_value, m_is_rounded, and value.
|
inline |
Definition at line 65 of file Rational.hpp.
References d_value, m_is_rounded, to_double(), and value.
std::string wmtk::Rational::serialize | ( | ) | const |
Definition at line 366 of file Rational.cpp.
References denominator(), m_is_rounded, and numerator().
std::string wmtk::Rational::to_binary | ( | ) | const |
Definition at line 350 of file Rational.cpp.
References d_value, m_is_rounded, and value.
Referenced by wmtk::HDF5Writer::write().
double wmtk::Rational::to_double | ( | ) | const |
Definition at line 317 of file Rational.cpp.
References d_value, m_is_rounded, and value.
Referenced by can_be_rounded(), Rational(), wmtk::utils::rational_to_interval(), round(), and wmtk::function::Tri_AMIPS_energy().
Definition at line 328 of file Rational.cpp.
Definition at line 259 of file Rational.cpp.
Definition at line 311 of file Rational.cpp.
Definition at line 178 of file Rational.cpp.
Definition at line 104 of file Rational.cpp.
Definition at line 157 of file Rational.cpp.
Definition at line 130 of file Rational.cpp.
Definition at line 204 of file Rational.cpp.
Definition at line 51 of file Rational.hpp.
|
friend |
Definition at line 340 of file Rational.cpp.
Definition at line 53 of file Rational.hpp.
Definition at line 286 of file Rational.cpp.
Definition at line 52 of file Rational.hpp.
Definition at line 54 of file Rational.hpp.
Definition at line 166 of file Rational.cpp.
|
private |
Definition at line 91 of file Rational.hpp.
Referenced by denominator(), get_sign(), numerator(), operator=(), Rational(), round(), to_binary(), and to_double().
|
private |
Definition at line 92 of file Rational.hpp.
Referenced by can_be_rounded(), canonicalize(), denominator(), get_sign(), init(), is_rounded(), numerator(), operator=(), Rational(), round(), serialize(), to_binary(), to_double(), and ~Rational().
|
private |
Definition at line 90 of file Rational.hpp.
Referenced by canonicalize(), denominator(), get_sign(), init(), init_from_binary(), numerator(), operator=(), Rational(), round(), to_binary(), to_double(), and ~Rational().