Overture  Version 25
Public Member Functions | Protected Attributes | Friends | List of all members
Fraction Class Reference

#include <Fraction.h>

Public Member Functions

 Fraction ()
 
 Fraction (const int n, const int d=1)
 
virtual ~Fraction ()
 
virtual int get (const GenericDataBase &dir, const aString &name)
 
virtual int put (GenericDataBase &dir, const aString &name) const
 
Fraction operator+ (const Fraction &f1) const
 
Fraction operator- (const Fraction &f1) const
 
Fraction operator- () const
 
Fraction operator* (const Fraction &f1) const
 
Fraction operator/ (const Fraction &f1) const
 
int operator<= (const Fraction &f1) const
 
int operator< (const Fraction &f1) const
 
int operator>= (const Fraction &f1) const
 
int operator> (const Fraction &f1) const
 
int operator== (const Fraction &f1) const
 
int operator<= (const real x) const
 
int operator< (const real x) const
 
int operator>= (const real x) const
 
int operator> (const real x) const
 
int operator== (const real x) const
 
void setNumerator (const int n)
 
void setDenominator (const int d)
 
int getNumerator () const
 
int getDenominator () const
 

Protected Attributes

int numerator
 
int denominator
 

Friends

int operator<= (const real, const Fraction)
 
int operator< (const real, const Fraction)
 
int operator>= (const real, const Fraction)
 
int operator> (const real, const Fraction)
 
int operator== (const real, const Fraction)
 
real operator+ (const real, const Fraction)
 
real operator+ (const Fraction, const real)
 
real operator- (const real, const Fraction)
 
real operator- (const Fraction, const real)
 
real operator* (const real, const Fraction)
 
real operator* (const Fraction, const real)
 
real operator/ (const real, const Fraction)
 
real operator/ (const Fraction, const real)
 
ostream & operator<< (ostream &, const Fraction &)
 

Constructor & Destructor Documentation

Fraction::Fraction ( )
inline
Fraction::Fraction ( const int  n,
const int  d = 1 
)
inline

References denominator, and numerator.

virtual Fraction::~Fraction ( )
inlinevirtual

Member Function Documentation

int Fraction::get ( const GenericDataBase dir,
const aString name 
)
virtual
int Fraction::getDenominator ( ) const
inline

References denominator.

Referenced by Bound::isFinite(), and operator<<().

int Fraction::getNumerator ( ) const
inline

References numerator.

Referenced by operator<<().

Fraction Fraction::operator* ( const Fraction f1) const

References denominator, Fraction(), and numerator.

Fraction Fraction::operator+ ( const Fraction f1) const

References denominator, Fraction(), and numerator.

Fraction Fraction::operator- ( const Fraction f1) const

References denominator, Fraction(), and numerator.

Fraction Fraction::operator- ( ) const

References denominator, Fraction(), and numerator.

Fraction Fraction::operator/ ( const Fraction f1) const

References denominator, Fraction(), and numerator.

int Fraction::operator< ( const Fraction f1) const

References denominator, and numerator.

int Fraction::operator< ( const real  x) const

References denominator, and numerator.

int Fraction::operator<= ( const Fraction f1) const

References denominator, and numerator.

int Fraction::operator<= ( const real  x) const

References denominator, and numerator.

int Fraction::operator== ( const Fraction f1) const

References denominator, and numerator.

int Fraction::operator== ( const real  x) const

References denominator, and numerator.

int Fraction::operator> ( const Fraction f1) const

References denominator, and numerator.

int Fraction::operator> ( const real  x) const

References denominator, and numerator.

int Fraction::operator>= ( const Fraction f1) const

References denominator, and numerator.

int Fraction::operator>= ( const real  x) const

References denominator, and numerator.

int Fraction::put ( GenericDataBase dir,
const aString name 
) const
virtual
void Fraction::setDenominator ( const int  d)
inline

References denominator.

void Fraction::setNumerator ( const int  n)
inline

References numerator.

Friends And Related Function Documentation

real operator* ( const real  x0,
const Fraction  f0 
)
friend
real operator* ( const Fraction  f0,
const real  x0 
)
friend
real operator+ ( const real  x0,
const Fraction  f0 
)
friend
real operator+ ( const Fraction  f0,
const real  x0 
)
friend
real operator- ( const real  x0,
const Fraction  f0 
)
friend
real operator- ( const Fraction  f0,
const real  x0 
)
friend
real operator/ ( const real  x0,
const Fraction  f0 
)
friend
real operator/ ( const Fraction  f0,
const real  x0 
)
friend
int operator< ( const real  x0,
const Fraction  f0 
)
friend
ostream& operator<< ( ostream &  os,
const Fraction f 
)
friend
int operator<= ( const real  x0,
const Fraction  f0 
)
friend
int operator== ( const real  x0,
const Fraction  f0 
)
friend
int operator> ( const real  x0,
const Fraction  f0 
)
friend
int operator>= ( const real  x0,
const Fraction  f0 
)
friend

Member Data Documentation

int Fraction::denominator
protected
int Fraction::numerator
protected

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