oILAB
Loading...
Searching...
No Matches
oILAB::Rational< IntScalarType > Struct Template Reference

#include <Rational.h>

Public Member Functions

 Rational ()
 
 Rational (const IntScalarType &n_in)
 
 Rational (const IntScalarType &n_in, const IntScalarType &d_in)
 
double asDouble () const
 
bool operator== (const IntScalarType &other) const
 
bool operator!= (const IntScalarType &other) const
 
Rational operator* (const Rational &r2) const
 
Rational operator/ (const Rational &r2) const
 
Rational operator+ (const Rational &r2) const
 
Rational operator- (const Rational &r2) const
 
Rational operator* (const IntScalarType &i) const
 
Rational operator/ (const IntScalarType &i) const
 
Rational operator+ (const IntScalarType &i) const
 
Rational operator- (const IntScalarType &i) const
 

Data Fields

IntScalarType n
 
IntScalarType d
 

Friends

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

Detailed Description

template<typename IntScalarType>
struct oILAB::Rational< IntScalarType >

Definition at line 14 of file Rational.h.

Constructor & Destructor Documentation

◆ Rational() [1/3]

template<typename IntScalarType >
oILAB::Rational< IntScalarType >::Rational ( )
inline

Definition at line 19 of file Rational.h.

◆ Rational() [2/3]

template<typename IntScalarType >
oILAB::Rational< IntScalarType >::Rational ( const IntScalarType &  n_in)
inline

Definition at line 23 of file Rational.h.

◆ Rational() [3/3]

template<typename IntScalarType >
oILAB::Rational< IntScalarType >::Rational ( const IntScalarType &  n_in,
const IntScalarType &  d_in 
)
inline

Definition at line 27 of file Rational.h.

Member Function Documentation

◆ asDouble()

template<typename IntScalarType >
double oILAB::Rational< IntScalarType >::asDouble ( ) const
inline

Definition at line 33 of file Rational.h.

◆ operator!=()

template<typename IntScalarType >
bool oILAB::Rational< IntScalarType >::operator!= ( const IntScalarType &  other) const
inline

Definition at line 51 of file Rational.h.

◆ operator*() [1/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator* ( const IntScalarType &  i) const
inline

Definition at line 71 of file Rational.h.

◆ operator*() [2/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator* ( const Rational< IntScalarType > &  r2) const
inline

Definition at line 55 of file Rational.h.

◆ operator+() [1/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator+ ( const IntScalarType &  i) const
inline

Definition at line 79 of file Rational.h.

◆ operator+() [2/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator+ ( const Rational< IntScalarType > &  r2) const
inline

Definition at line 63 of file Rational.h.

◆ operator-() [1/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator- ( const IntScalarType &  i) const
inline

Definition at line 83 of file Rational.h.

◆ operator-() [2/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator- ( const Rational< IntScalarType > &  r2) const
inline

Definition at line 67 of file Rational.h.

◆ operator/() [1/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator/ ( const IntScalarType &  i) const
inline

Definition at line 75 of file Rational.h.

◆ operator/() [2/2]

template<typename IntScalarType >
Rational oILAB::Rational< IntScalarType >::operator/ ( const Rational< IntScalarType > &  r2) const
inline

Definition at line 59 of file Rational.h.

◆ operator==()

template<typename IntScalarType >
bool oILAB::Rational< IntScalarType >::operator== ( const IntScalarType &  other) const
inline

Definition at line 35 of file Rational.h.

Friends And Related Symbol Documentation

◆ operator<<

template<typename IntScalarType >
std::ostream & operator<< ( std::ostream &  os,
const Rational< IntScalarType > &  r 
)
friend

Definition at line 87 of file Rational.h.

Field Documentation

◆ d

template<typename IntScalarType >
IntScalarType oILAB::Rational< IntScalarType >::d

Definition at line 17 of file Rational.h.

◆ n

template<typename IntScalarType >
IntScalarType oILAB::Rational< IntScalarType >::n

Definition at line 16 of file Rational.h.


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