|
Py2Cpp 1.6.3; VERSION ${PROJECT_VERSION}
|
#include <fractions.hpp>
Public Member Functions | |
| CONSTEXPR14 | Fraction (Z num, Z den) |
| Construct a new Fraction object. | |
| CONSTEXPR14 auto | normalize () -> Z |
| normalize to a canonical form | |
| CONSTEXPR14 void | normalize1 () |
| normalize to a canonical form | |
| CONSTEXPR14 auto | normalize2 () -> Z |
| normalize to a canonical form | |
| CONSTEXPR14 | Fraction (Z &&num) |
| Construct a new Fraction object. | |
| CONSTEXPR14 | Fraction (const Z &num) |
| Construct a new Fraction object. | |
| CONSTEXPR14 | Fraction () |
| Construct a new Fraction object (default constructor) | |
| CONSTEXPR14 auto | num () const noexcept -> const Z & |
| Get the numerator. | |
| CONSTEXPR14 auto | den () const noexcept -> const Z & |
| Get the denominator. | |
| CONSTEXPR14 auto | cross (const Fraction &rhs) const -> Z |
| cross product | |
| CONSTEXPR14 void | reciprocal () |
| reciprocal | |
| CONSTEXPR14 auto | operator*= (Fraction rhs) -> Fraction & |
| multiply and assign | |
| CONSTEXPR14 auto | operator*= (Z rhs) -> Fraction & |
| multiply and assign | |
| CONSTEXPR14 auto | operator/= (Fraction rhs) -> Fraction & |
| divide and assign | |
| CONSTEXPR14 auto | operator/= (Z rhs) -> Fraction & |
| divide and assign | |
| CONSTEXPR14 auto | operator- () const -> Fraction |
| Negate. | |
| CONSTEXPR14 auto | operator+ (const Fraction &rhs) const -> Fraction |
| Add. | |
| CONSTEXPR14 auto | operator- (const Fraction &frac) const -> Fraction |
| Subtract. | |
| CONSTEXPR14 auto | operator- (const Z &i) const -> Fraction |
| Subtract an integer from the fraction. | |
| CONSTEXPR14 auto | operator+= (const Fraction &rhs) -> Fraction & |
| Add and assign a fraction. | |
| CONSTEXPR14 auto | operator-= (const Fraction &rhs) -> Fraction & |
| Subtract and assign a fraction. | |
| CONSTEXPR14 auto | operator+= (const Z &i) -> Fraction & |
| Add and assign an integer. | |
| CONSTEXPR14 auto | operator-= (const Z &rhs) -> Fraction & |
| Subtract and assign an integer. | |
Public Attributes | |
| Z | _num |
| Z | _den |
Friends | |
| CONSTEXPR14 auto | operator* (Fraction lhs, const Fraction &rhs) -> Fraction |
| multiply | |
| CONSTEXPR14 auto | operator* (Fraction lhs, const Z &rhs) -> Fraction |
| multiply | |
| CONSTEXPR14 auto | operator* (const Z &lhs, Fraction rhs) -> Fraction |
| multiply | |
| CONSTEXPR14 auto | operator/ (Fraction lhs, const Fraction &rhs) -> Fraction |
| divide | |
| CONSTEXPR14 auto | operator/ (Fraction lhs, const Z &rhs) -> Fraction |
| divide | |
| CONSTEXPR14 auto | operator/ (const Z &lhs, Fraction rhs) -> Fraction |
| divide | |
| CONSTEXPR14 auto | operator+ (Fraction frac, const Z &i) -> Fraction |
| Add. | |
| CONSTEXPR14 auto | operator+ (const Z &i, Fraction frac) -> Fraction |
| Add. | |
| CONSTEXPR14 auto | operator- (const Z &c, const Fraction &frac) -> Fraction |
| Subtract a fraction from an integer. | |
| CONSTEXPR14 auto | operator+ (int &&c, const Fraction &frac) -> Fraction |
| Add a fraction to an integer rvalue. | |
| CONSTEXPR14 auto | operator- (int &&c, const Fraction &frac) -> Fraction |
| Subtract a fraction from an integer rvalue. | |
| CONSTEXPR14 auto | operator* (int &&c, const Fraction &frac) -> Fraction |
| Multiply a fraction by an integer rvalue. | |
| template<typename Stream > | |
| auto | operator<< (Stream &os, const Fraction &frac) -> Stream & |
| Stream output operator for Fraction. | |
Comparison operators | |
==, !=, <, >, <=, >= etc. | |
| CONSTEXPR14 auto | operator!= (const Fraction &rhs) const -> bool |
| Not equal to. | |
| CONSTEXPR14 auto | operator> (const Fraction &rhs) const -> bool |
| Greater than. | |
| CONSTEXPR14 auto | operator>= (const Fraction &rhs) const -> bool |
| Greater than or euqal to. | |
| CONSTEXPR14 auto | operator<= (const Fraction &rhs) const -> bool |
| Less than or equal to. | |
| CONSTEXPR14 auto | operator> (const Z &rhs) const -> bool |
| Greater than. | |
| CONSTEXPR14 auto | operator<= (const Z &rhs) const -> bool |
| Less than or equal to. | |
| CONSTEXPR14 auto | operator>= (const Z &rhs) const -> bool |
| Greater than or equal to. | |
| CONSTEXPR14 auto | operator== (const Fraction &lhs, const Z &rhs) -> bool |
| Equal to. | |
| CONSTEXPR14 auto | operator< (const Fraction &lhs, const Z &rhs) -> bool |
| Less than. | |
| CONSTEXPR14 auto | operator< (const Z &lhs, const Fraction &rhs) -> bool |
| Less than. | |
| CONSTEXPR14 auto | operator== (const Z &lhs, const Fraction &rhs) -> bool |
| Equal to. | |
| CONSTEXPR14 auto | operator== (const Fraction &lhs, const Fraction &rhs) -> bool |
| Equal to. | |
| CONSTEXPR14 auto | operator< (const Fraction &lhs, const Fraction &rhs) -> bool |
| Less than. | |
| CONSTEXPR14 auto | operator> (const Z &lhs, const Fraction &rhs) -> bool |
| Greater than. | |
| CONSTEXPR14 auto | operator<= (const Z &lhs, const Fraction &rhs) -> bool |
| Less than or equal to. | |
| CONSTEXPR14 auto | operator>= (const Z &lhs, const Fraction &rhs) -> bool |
| Greater than or euqal to. | |
| Z | The integer type for numerator and denominator |
|
inline |
Construct a new Fraction object.
| [in] | num | |
| [in] | den |
|
inlineexplicit |
Construct a new Fraction object.
| [in] | num |
|
inlineexplicit |
Construct a new Fraction object.
| [in] | num |
|
inline |
Construct a new Fraction object (default constructor)
|
inline |
cross product
| [in] | rhs |
|
inlinenoexcept |
Get the denominator.
|
inline |
normalize to a canonical form
denominator is always non-negative and co-prime with numerator
|
inline |
normalize to a canonical form
denominator is always non-negative
|
inline |
normalize to a canonical form
denominator is always co-prime with numerator
|
inlinenoexcept |
Get the numerator.
|
inline |
Not equal to.
| [in] | rhs | The fraction to compare with |
|
inline |
|
inline |
|
inline |
|
inline |
Add and assign a fraction.
| [in] | rhs | The fraction to add |
|
inline |
Add and assign an integer.
| [in] | i | The integer value to add |
|
inline |
Negate.
|
inline |
|
inline |
Subtract an integer from the fraction.
| [in] | i | The integer value to subtract |
|
inline |
Subtract and assign a fraction.
| [in] | rhs | The fraction to subtract |
|
inline |
Subtract and assign an integer.
| [in] | rhs | The integer value to subtract |
|
inline |
|
inline |
|
inline |
Less than or equal to.
| [in] | rhs |
|
inline |
Less than or equal to.
| [in] | rhs |
|
inline |
Greater than.
| [in] | rhs |
|
inline |
Greater than.
| [in] | rhs |
|
inline |
Greater than or euqal to.
| [in] | rhs |
|
inline |
Greater than or equal to.
| [in] | rhs |
|
inline |
reciprocal
|
friend |
|
friend |
|
friend |
|
friend |
Multiply a fraction by an integer rvalue.
| [in] | c | The integer rvalue |
| [in] | frac | The fraction to multiply |
|
friend |
|
friend |
|
friend |
Add a fraction to an integer rvalue.
| [in] | c | The integer rvalue |
| [in] | frac | The fraction to add |
|
friend |
Subtract a fraction from an integer.
| [in] | c | The integer value |
| [in] | frac | The fraction to subtract |
|
friend |
Subtract a fraction from an integer rvalue.
| [in] | c | The integer rvalue |
| [in] | frac | The fraction to subtract |
|
friend |
|
friend |
|
friend |
|
friend |
Less than.
| [in] | lhs | |
| [in] | rhs |
|
friend |
Less than.
| [in] | lhs | |
| [in] | rhs |
|
friend |
Less than.
| [in] | lhs | |
| [in] | rhs |
|
friend |
Stream output operator for Fraction.
| Stream | The stream type |
| [in] | os | The output stream to write to |
| [in] | frac | The fraction to output |
|
friend |
Less than or equal to.
| [in] | lhs | |
| [in] | rhs |
|
friend |
Equal to.
| [in] | lhs | The first fraction |
| [in] | rhs | The second fraction |
|
friend |
Equal to.
| [in] | lhs | The fraction |
| [in] | rhs | The integer value |
|
friend |
Equal to.
| [in] | lhs | The integer value |
| [in] | rhs | The fraction |
|
friend |
Greater than.
| [in] | lhs | |
| [in] | rhs |
|
friend |
Greater than or euqal to.
| [in] | lhs | |
| [in] | rhs |
| Z fun::Fraction< Z >::_den |
| Z fun::Fraction< Z >::_num |