ARTS  2.2.66
rational.h File Reference

Contains the rational class definition. More...

#include <cassert>
#include <ostream>
#include "matpack.h"
#include "array.h"

Go to the source code of this file.

Classes

class  Rational
 

Macros

#define RATIONAL_UNDEFINED   Rational(0, 0)
 

Typedefs

typedef Array< RationalArrayOfRational
 

Functions

Rational operator- (const Rational &a)
 
Rational operator+ (const Rational &a)
 
Rational operator+ (const Rational &a, const Rational &b)
 
Rational operator- (const Rational &a, const Rational &b)
 
Rational operator/ (const Rational &a, const Rational &b)
 
Rational operator* (const Rational &a, const Rational &b)
 
Rational operator% (const Rational &a, const Rational &b)
 
bool operator== (const Rational &a, const Rational &b)
 
bool operator!= (const Rational &a, const Rational &b)
 
bool operator< (const Rational &a, const Rational &b)
 
bool operator> (const Rational &a, const Rational &b)
 
bool operator<= (const Rational &a, const Rational &b)
 
bool operator>= (const Rational &a, const Rational &b)
 
Numeric fac (const Rational &r)
 
std::ostream & operator<< (std::ostream &os, const Rational &a)
 
std::istream & operator>> (std::istream &os, Rational &a)
 
Rational abs (const Rational &a)
 

Detailed Description

Contains the rational class definition.

Author
Richard Larsson
Date
2012-10-31

Definition in file rational.h.

Macro Definition Documentation

◆ RATIONAL_UNDEFINED

#define RATIONAL_UNDEFINED   Rational(0, 0)

Definition at line 75 of file rational.h.

Typedef Documentation

◆ ArrayOfRational

Definition at line 102 of file rational.h.

Function Documentation

◆ abs()

Rational abs ( const Rational a)

Definition at line 107 of file rational.cc.

◆ fac()

Numeric fac ( const Rational r)
inline

Definition at line 94 of file rational.h.

References Rational::toIndex().

◆ operator!=()

bool operator!= ( const Rational a,
const Rational b 
)
inline

Definition at line 88 of file rational.h.

References operator==().

◆ operator%()

Rational operator% ( const Rational a,
const Rational b 
)
inline

Definition at line 84 of file rational.h.

References Rational::Denom(), and Rational::Nom().

◆ operator*()

Rational operator* ( const Rational a,
const Rational b 
)
inline

Definition at line 83 of file rational.h.

References Rational::Denom(), and Rational::Nom().

◆ operator+() [1/2]

Rational operator+ ( const Rational a)
inline

Definition at line 79 of file rational.h.

◆ operator+() [2/2]

Rational operator+ ( const Rational a,
const Rational b 
)
inline

Definition at line 80 of file rational.h.

References Rational::Denom(), and Rational::Nom().

◆ operator-() [1/2]

Rational operator- ( const Rational a)
inline

Definition at line 78 of file rational.h.

References Rational::Denom(), and Rational::Nom().

◆ operator-() [2/2]

Rational operator- ( const Rational a,
const Rational b 
)
inline

Definition at line 81 of file rational.h.

References Rational::Denom(), and Rational::Nom().

◆ operator/()

Rational operator/ ( const Rational a,
const Rational b 
)
inline

Definition at line 82 of file rational.h.

References Rational::Denom(), and Rational::Nom().

◆ operator<()

bool operator< ( const Rational a,
const Rational b 
)
inline

Definition at line 89 of file rational.h.

References Rational::Denom(), and Rational::Nom().

Referenced by operator>(), and operator>=().

◆ operator<<()

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

Definition at line 65 of file rational.cc.

References Rational::Denom(), and Rational::Nom().

◆ operator<=()

bool operator<= ( const Rational a,
const Rational b 
)
inline

Definition at line 91 of file rational.h.

References operator>().

◆ operator==()

bool operator== ( const Rational a,
const Rational b 
)
inline

Definition at line 87 of file rational.h.

References Rational::Denom(), and Rational::Nom().

Referenced by operator!=().

◆ operator>()

bool operator> ( const Rational a,
const Rational b 
)
inline

Definition at line 90 of file rational.h.

References operator<().

Referenced by operator<=().

◆ operator>=()

bool operator>= ( const Rational a,
const Rational b 
)
inline

Definition at line 92 of file rational.h.

References operator<().

◆ operator>>()

std::istream& operator>> ( std::istream &  os,
Rational a 
)

Definition at line 71 of file rational.cc.

References Array< base >::nelem().