Fraction Class Reference
[SymbolicValues]

Fraction implements a mathematical fraction More...

#include <fraction.h>

Inheritance diagram for Fraction:

CASSymbolic CASObject List of all members.

Public Member Functions

CASObjectAbsolute () const
 Returns the absolute value of the fraction.
void AbsoluteIP ()
 Makes the fraction absolute in-place.
CASObjectAdd (const CASObject *addend) const
 Mathematically adds another CASObject to the fraction.
CASObjectClone () const
 Clones the object.
CASObjectDivide (const CASObject *divisor) const
 Mathematically divides the fraction by another CASObject.
CASObjectEvaluate () const
 Evaluates the fraction.
 Fraction (const Fraction &f)
 Copy constructor.
 Fraction (const CASObject *denom)
 Constructor.
 Fraction (const CASObject *num, const CASObject *denom)
 Constructor.
 Fraction ()
 Constructor.
CASObjectGCD (const CASObject *o) const
 Calculates the gcd for the fraction and another CASObject.
void Get (char *s, unsigned long size) const
 Returns the string representation of the fraction.
void Get (std::string &s) const
 Returns the string representation of the fraction.
CASType GetType () const
 Returns the type of the object.
CASObjectInvert () const
 Inverts the fraction.
void InvertIP ()
 Inverts the fraction in-place.
bool IsEqual (const CASObject *o) const
 Compares the fraction and another CASObject for equality.
bool IsGT (const CASObject *o) const
 Compares whether or not the fraction is greater than another CASObject.
bool IsLT (const CASObject *o) const
 Compares whether or not the fraction is less than another CASObject.
bool IsOne () const
 Indicates whether or not the fraction is one.
bool IsPureNumerical () const
 Indicates whether or not the fraction is pure numerical.
bool IsSimilar (const CASObject *o) const
 Indicates whether or not a CASObject is similar to the fraction.
bool IsZero () const
 Indicates whether or not the fraction is zero.
unsigned long Length () const
 Returns the lenght of the fraction for string representation.
CASObjectModulo (const CASObject *divisor) const
 Calculates the modulus of the fraction.
CASObjectMultiply (const CASObject *factor) const
 Mathematically multiplies the fraction by another CASObject.
const Fractionoperator= (const Fraction &f)
 Assignment operator.
const bool operator== (const Fraction &f) const
 Comparison operator.
CASObjectPower (const CASObject *exp) const
 Raises the fraction to the edp-Power.
void Print () const
 Prints the string representation to the stdout.
void Sort ()
 Sorts the numerator and denominator of the fraction.
CASObjectSortWeight () const
 Calculates the sort weight of the fraction.
CASObjectSubtract (const CASObject *subtrahend) const
 Mathematically subtracts another CASObject from the fraction.
 ~Fraction ()
 Copy constructor.

Private Attributes

CASObjectdenominator
 Holds the denominator.
CASObjectnumerator
 Holds the numerator.

Friends

class CASConvert

Detailed Description

Fraction implements a mathematical fraction. It does so by having two attributes, numerator and denominator, which are of the type *CASObject. Therefore, it is possible to have any object derived from CASObject assigned to those attributes.

Fraction itself is derived from CASSymbolic.

Definition at line 58 of file fraction.h.


Member Function Documentation

CASType Fraction::GetType (  )  const [inline, virtual]

Returns the type of the object which is always CT_FRACTION.

Returns:
a CASType of value CT_FRACTION.

Implements CASObject.

Definition at line 110 of file fraction.h.


Member Data Documentation

CASObject* Fraction::denominator [private]

Holds the denominator of the fraction.

Definition at line 71 of file fraction.h.

CASObject* Fraction::numerator [private]

Holds the numerator of the fraction.

Definition at line 65 of file fraction.h.


The documentation for this class was generated from the following files:
Generated on Sun Dec 31 01:57:36 2006 for ECAS by  doxygen 1.4.7