Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
model::Rational< IntScalarType > Struct Template Reference

#include <Rational.h>

Collaboration diagram for model::Rational< IntScalarType >:

Public Member Functions

 Rational ()
 Rational (const long int &n_in)
 Rational (const long int &n_in, const long int &d_in)
double asDouble () const
bool operator== (const long int &other) const
bool operator!= (const long int &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 long int &i) const
Rational operator/ (const long int &i) const
Rational operator+ (const long int &i) const
Rational operator- (const long int &i) const
 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

Public Attributes

long int n
long int d
IntScalarType n
IntScalarType d

Friends

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

Detailed Description

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

Definition at line 17 of file Rational.h.

Constructor & Destructor Documentation

◆ Rational() [1/6]

template<typename IntScalarType>
model::Rational< IntScalarType >::Rational ( )

Definition at line 17 of file Rational.cpp.

◆ Rational() [2/6]

template<typename IntScalarType>
model::Rational< IntScalarType >::Rational ( const long int & n_in)

Definition at line 21 of file Rational.cpp.

◆ Rational() [3/6]

template<typename IntScalarType>
model::Rational< IntScalarType >::Rational ( const long int & n_in,
const long int & d_in )

Definition at line 25 of file Rational.cpp.

◆ Rational() [4/6]

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

Definition at line 22 of file Rational_NEW.h.

◆ Rational() [5/6]

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

Definition at line 30 of file Rational_NEW.h.

◆ Rational() [6/6]

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

Definition at line 38 of file Rational_NEW.h.

Member Function Documentation

◆ asDouble() [1/2]

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

◆ asDouble() [2/2]

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

Definition at line 46 of file Rational_NEW.h.

◆ operator!=() [1/2]

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

Definition at line 69 of file Rational_NEW.h.

◆ operator!=() [2/2]

template<typename IntScalarType>
bool model::Rational< IntScalarType >::operator!= ( const long int & other) const

◆ operator*() [1/4]

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

Definition at line 94 of file Rational_NEW.h.

◆ operator*() [2/4]

template<typename IntScalarType>
Rational model::Rational< IntScalarType >::operator* ( const long int & i) const

◆ operator*() [3/4]

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

◆ operator*() [4/4]

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

Definition at line 74 of file Rational_NEW.h.

◆ operator+() [1/4]

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

Definition at line 104 of file Rational_NEW.h.

◆ operator+() [2/4]

template<typename IntScalarType>
Rational model::Rational< IntScalarType >::operator+ ( const long int & i) const

◆ operator+() [3/4]

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

◆ operator+() [4/4]

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

Definition at line 84 of file Rational_NEW.h.

◆ operator-() [1/4]

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

Definition at line 109 of file Rational_NEW.h.

◆ operator-() [2/4]

template<typename IntScalarType>
Rational model::Rational< IntScalarType >::operator- ( const long int & i) const

◆ operator-() [3/4]

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

◆ operator-() [4/4]

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

Definition at line 89 of file Rational_NEW.h.

◆ operator/() [1/4]

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

Definition at line 99 of file Rational_NEW.h.

◆ operator/() [2/4]

template<typename IntScalarType>
Rational model::Rational< IntScalarType >::operator/ ( const long int & i) const

◆ operator/() [3/4]

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

◆ operator/() [4/4]

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

Definition at line 79 of file Rational_NEW.h.

◆ operator==() [1/2]

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

Definition at line 51 of file Rational_NEW.h.

◆ operator==() [2/2]

template<typename IntScalarType>
bool model::Rational< IntScalarType >::operator== ( const long int & other) const

◆ operator<< [1/2]

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

Definition at line 98 of file Rational.cpp.

◆ operator<< [2/2]

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

Definition at line 114 of file Rational_NEW.h.

Member Data Documentation

◆ d [1/2]

template<typename IntScalarType>
long int model::Rational< IntScalarType >::d

Definition at line 28 of file Rational.h.

◆ d [2/2]

Definition at line 20 of file Rational_NEW.h.

◆ n [1/2]

template<typename IntScalarType>
long int model::Rational< IntScalarType >::n

Definition at line 27 of file Rational.h.

◆ n [2/2]

Definition at line 19 of file Rational_NEW.h.


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