Ring Daemon 16.0.0
Loading...
Searching...
No Matches
jami::rational< I > Class Template Reference

Naive implementation of the boost::rational interface, described here: https://www.boost.org/doc/libs/latest/libs/rational/rational.html. More...

#include <rational.h>

Inheritance diagram for jami::rational< I >:
Inheritance graph
Collaboration diagram for jami::rational< I >:
Collaboration graph

Public Member Functions

rationalassign (I n, I d)
 
constexpr I denominator () const
 
constexpr I numerator () const
 
constexpr operator AVRational () const
 
constexpr operator bool () const
 
constexpr bool operator! () const
 
constexpr bool operator!= (const rational &r) const
 
constexpr bool operator!= (I i) const
 
constexpr rational operator* (const rational &r) const
 
constexpr rationaloperator*= (const rational &r)
 
constexpr rationaloperator*= (I i)
 
constexpr rational operator+ (const rational &r) const
 
constexpr const rationaloperator++ ()
 
constexpr rationaloperator+= (const rational &r)
 
constexpr rationaloperator+= (I i)
 
constexpr rational operator- (const rational &r) const
 
constexpr const rationaloperator-- ()
 
constexpr rationaloperator-= (const rational &r)
 
constexpr rationaloperator-= (I i)
 
constexpr rational operator/ (const rational &r) const
 
constexpr rationaloperator/= (const rational &r)
 
constexpr rationaloperator/= (I i)
 
constexpr bool operator< (const rational &r) const
 
constexpr bool operator< (I i) const
 
rationaloperator= (I n)
 
constexpr bool operator== (const rational &r) const
 
constexpr bool operator== (I i) const
 
constexpr bool operator> (const rational &r) const
 
constexpr bool operator> (I i) const
 
constexpr rational ()
 
constexpr rational (AVRational r)
 
constexpr rational (I n)
 
constexpr rational (I n, I d)
 
template<typename R = double>
constexpr R real () const
 
std::string to_string () const
 

Detailed Description

template<typename I>
class jami::rational< I >

Naive implementation of the boost::rational interface, described here: https://www.boost.org/doc/libs/latest/libs/rational/rational.html.

Definition at line 38 of file rational.h.

Constructor & Destructor Documentation

◆ rational() [1/4]

template<typename I >
constexpr jami::rational< I >::rational ( )
inlineconstexpr

Definition at line 42 of file rational.h.

◆ rational() [2/4]

template<typename I >
constexpr jami::rational< I >::rational ( I  n)
inlineconstexpr

Definition at line 45 of file rational.h.

◆ rational() [3/4]

template<typename I >
constexpr jami::rational< I >::rational ( I  n,
I  d 
)
inlineconstexpr

Definition at line 49 of file rational.h.

◆ rational() [4/4]

template<typename I >
constexpr jami::rational< I >::rational ( AVRational  r)
inlineconstexpr

Definition at line 57 of file rational.h.

Member Function Documentation

◆ assign()

template<typename I >
rational & jami::rational< I >::assign ( I  n,
I  d 
)
inline

Definition at line 77 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ denominator()

template<typename I >
constexpr I jami::rational< I >::denominator ( ) const
inlineconstexpr

Definition at line 87 of file rational.h.

Referenced by jami::abs(), jami::operator-(), jami::operator/(), and jami::operator<<().

◆ numerator()

template<typename I >
constexpr I jami::rational< I >::numerator ( ) const
inlineconstexpr

◆ operator AVRational()

template<typename I >
constexpr jami::rational< I >::operator AVRational ( ) const
inlineconstexpr

Definition at line 60 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator bool()

template<typename I >
constexpr jami::rational< I >::operator bool ( ) const
inlineexplicitconstexpr

Definition at line 172 of file rational.h.

◆ operator!()

template<typename I >
constexpr bool jami::rational< I >::operator! ( ) const
inlineconstexpr

Definition at line 169 of file rational.h.

◆ operator!=() [1/2]

template<typename I >
constexpr bool jami::rational< I >::operator!= ( const rational< I > &  r) const
inlineconstexpr

Definition at line 186 of file rational.h.

◆ operator!=() [2/2]

template<typename I >
constexpr bool jami::rational< I >::operator!= ( I  i) const
inlineconstexpr

Definition at line 192 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator*()

template<typename I >
constexpr rational jami::rational< I >::operator* ( const rational< I > &  r) const
inlineconstexpr

Definition at line 104 of file rational.h.

◆ operator*=() [1/2]

template<typename I >
constexpr rational & jami::rational< I >::operator*= ( const rational< I > &  r)
inlineconstexpr

Definition at line 117 of file rational.h.

◆ operator*=() [2/2]

template<typename I >
constexpr rational & jami::rational< I >::operator*= ( I  i)
inlineconstexpr

Definition at line 143 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator+()

template<typename I >
constexpr rational jami::rational< I >::operator+ ( const rational< I > &  r) const
inlineconstexpr

Definition at line 96 of file rational.h.

◆ operator++()

template<typename I >
constexpr const rational & jami::rational< I >::operator++ ( )
inlineconstexpr

Definition at line 157 of file rational.h.

◆ operator+=() [1/2]

template<typename I >
constexpr rational & jami::rational< I >::operator+= ( const rational< I > &  r)
inlineconstexpr

Definition at line 107 of file rational.h.

◆ operator+=() [2/2]

template<typename I >
constexpr rational & jami::rational< I >::operator+= ( I  i)
inlineconstexpr

Definition at line 133 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator-()

template<typename I >
constexpr rational jami::rational< I >::operator- ( const rational< I > &  r) const
inlineconstexpr

Definition at line 100 of file rational.h.

◆ operator--()

template<typename I >
constexpr const rational & jami::rational< I >::operator-- ( )
inlineconstexpr

Definition at line 162 of file rational.h.

◆ operator-=() [1/2]

template<typename I >
constexpr rational & jami::rational< I >::operator-= ( const rational< I > &  r)
inlineconstexpr

Definition at line 112 of file rational.h.

◆ operator-=() [2/2]

template<typename I >
constexpr rational & jami::rational< I >::operator-= ( I  i)
inlineconstexpr

Definition at line 138 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator/()

template<typename I >
constexpr rational jami::rational< I >::operator/ ( const rational< I > &  r) const
inlineconstexpr

Definition at line 105 of file rational.h.

◆ operator/=() [1/2]

template<typename I >
constexpr rational & jami::rational< I >::operator/= ( const rational< I > &  r)
inlineconstexpr

Definition at line 124 of file rational.h.

◆ operator/=() [2/2]

template<typename I >
constexpr rational & jami::rational< I >::operator/= ( I  i)
inlineconstexpr

Definition at line 149 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator<() [1/2]

template<typename I >
constexpr bool jami::rational< I >::operator< ( const rational< I > &  r) const
inlineconstexpr

Definition at line 175 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator<() [2/2]

template<typename I >
constexpr bool jami::rational< I >::operator< ( I  i) const
inlineconstexpr

Definition at line 189 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator=()

template<typename I >
rational & jami::rational< I >::operator= ( I  n)
inline

Definition at line 69 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator==() [1/2]

template<typename I >
constexpr bool jami::rational< I >::operator== ( const rational< I > &  r) const
inlineconstexpr

Definition at line 185 of file rational.h.

◆ operator==() [2/2]

template<typename I >
constexpr bool jami::rational< I >::operator== ( I  i) const
inlineconstexpr

Definition at line 191 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator>() [1/2]

template<typename I >
constexpr bool jami::rational< I >::operator> ( const rational< I > &  r) const
inlineconstexpr

Definition at line 180 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ operator>() [2/2]

template<typename I >
constexpr bool jami::rational< I >::operator> ( I  i) const
inlineconstexpr

Definition at line 190 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ real()

template<typename I >
template<typename R = double>
constexpr R jami::rational< I >::real ( ) const
inlineconstexpr

Definition at line 90 of file rational.h.

References jami::emitSignal().

Here is the call graph for this function:

◆ to_string()

template<typename I >
std::string jami::rational< I >::to_string ( ) const
inline

Definition at line 62 of file rational.h.


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