SymbolicValues

Class used for symbolic values. More...

Classes

class  CASSymbolic
 Dummy class. More...
class  Fraction
 Fraction implements a mathematical fraction More...
class  Variable
 Class which implements a mathematical variable. More...

Functions

CASObjectVariable::Absolute () const
 Returns the absolute representation of the variable.
CASObjectFraction::Absolute () const
 Returns the absolute value of the fraction.
void Variable::AbsoluteIP ()
 Makes the variable in-place.
void Fraction::AbsoluteIP ()
 Makes the fraction absolute in-place.
CASObjectVariable::Add (const CASObject *addend) const
 Adds a CASObject to the variable.
CASObjectFraction::Add (const CASObject *addend) const
 Mathematically adds another CASObject to the fraction.
CASObjectVariable::Clone () const
 Clones the variable.
CASObjectFraction::Clone () const
 Clones the object.
CASObjectVariable::Divide (const CASObject *divisor) const
 Divides the variable by a CASObject.
CASObjectFraction::Divide (const CASObject *divisor) const
 Mathematically divides the fraction by another CASObject.
CASObjectVariable::Evaluate () const
 Evaluates the variable.
CASObjectFraction::Evaluate () const
 Evaluates the fraction.
 Fraction::Fraction (const Fraction &f)
 Copy constructor.
 Fraction::Fraction (const CASObject *denom)
 Constructor.
 Fraction::Fraction (const CASObject *num, const CASObject *denom)
 Constructor.
 Fraction::Fraction ()
 Constructor.
CASObjectVariable::GCD (const CASObject *o) const
 Computes the gcd of the variable and a CASObject.
CASObjectFraction::GCD (const CASObject *o) const
 Calculates the gcd for the fraction and another CASObject.
void Variable::Get (char *s, unsigned long size) const
 Returns the string representation of the variable.
void Variable::Get (std::string &s) const
 Returns the string representation of the variable.
void Fraction::Get (char *s, unsigned long size) const
 Returns the string representation of the fraction.
void Fraction::Get (std::string &s) const
 Returns the string representation of the fraction.
CASObjectVariable::Invert () const
 Returns the inverted representation of the variable.
CASObjectFraction::Invert () const
 Inverts the fraction.
void Variable::InvertIP ()
 Inverts the variable in-place.
void Fraction::InvertIP ()
 Inverts the fraction in-place.
bool Variable::IsEqual (const CASObject *o) const
 Indicates whether or not the variable is equal to a CASObject.
bool Fraction::IsEqual (const CASObject *o) const
 Compares the fraction and another CASObject for equality.
bool Variable::IsGT (const CASObject *o) const
 Indicates whether or not the variable is greater than a CASObject.
bool Fraction::IsGT (const CASObject *o) const
 Compares whether or not the fraction is greater than another CASObject.
bool Variable::IsLT (const CASObject *o) const
 Indicates whether or not the variable is less than a CASObject.
bool Fraction::IsLT (const CASObject *o) const
 Compares whether or not the fraction is less than another CASObject.
bool Variable::IsOne () const
 Indicates whether or not the variable is one.
bool Fraction::IsOne () const
 Indicates whether or not the fraction is one.
bool Fraction::IsPureNumerical () const
 Indicates whether or not the fraction is pure numerical.
bool Variable::IsSimilar (const CASObject *o) const
 Indicates whether or not the variable is similar to a CASObject.
bool Fraction::IsSimilar (const CASObject *o) const
 Indicates whether or not a CASObject is similar to the fraction.
bool Variable::IsZero () const
 Indicates whether or not the variable is zero.
bool Fraction::IsZero () const
 Indicates whether or not the fraction is zero.
unsigned long Variable::Length () const
 Length of the variable in string representation.
unsigned long Fraction::Length () const
 Returns the lenght of the fraction for string representation.
CASObjectVariable::Modulo (const CASObject *divisor) const
 Calculates the modulus.
CASObjectFraction::Modulo (const CASObject *divisor) const
 Calculates the modulus of the fraction.
CASObjectVariable::Multiply (const CASObject *factor) const
 Multiplies the variable by a CASObject.
CASObjectFraction::Multiply (const CASObject *factor) const
 Mathematically multiplies the fraction by another CASObject.
const VariableVariable::operator= (const Variable &v)
 Assignment operator.
const FractionFraction::operator= (const Fraction &f)
 Assignment operator.
const bool Fraction::operator== (const Fraction &f) const
 Comparison operator.
CASObjectVariable::Power (const CASObject *exp) const
 Raises the variable to the x-th power.
CASObjectFraction::Power (const CASObject *exp) const
 Raises the fraction to the edp-Power.
void Variable::Print () const
 Prints the string representation of the variable to stdout.
void Fraction::Print () const
 Prints the string representation to the stdout.
void Variable::Sort ()
 Sorts the variable.
void Fraction::Sort ()
 Sorts the numerator and denominator of the fraction.
CASObjectVariable::SortWeight () const
 Calculates the sort weight of the variable.
CASObjectFraction::SortWeight () const
 Calculates the sort weight of the fraction.
CASObjectVariable::Subtract (const CASObject *subtrahend) const
 Subtracts a CASObject from the variable.
CASObjectFraction::Subtract (const CASObject *subtrahend) const
 Mathematically subtracts another CASObject from the fraction.
 Variable::Variable (const Variable &v)
 Copy constructor.
 Variable::Variable (const std::string n)
 Constructor.
 Variable::Variable (const std::string n, const CASObject *mag)
 Constructor.
 Variable::Variable ()
 Constructor.
 Fraction::~Fraction ()
 Copy constructor.
 Variable::~Variable ()
 Destructor.

Detailed Description

Classes which represents symbolic values.

Function Documentation

CASObject * Variable::Absolute (  )  const [virtual, inherited]

Returns the absolute representation of the Variable. However, the method simply clones the Variable, since there is no sign attached to it. Negative Variable are represented by a Product by which the coefficient is '-1'.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the absolute value.

Implements CASObject.

Definition at line 277 of file variable.cc.

CASObject * Fraction::Absolute (  )  const [virtual, inherited]

Returns a CASObject representing the absolute value of the fraction. Both, numerator and denominator, are made absolute for this.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to CASObject representing the absolute value of the fraction.

Implements CASObject.

Definition at line 321 of file fraction.cc.

void Variable::AbsoluteIP (  )  [virtual, inherited]

Makes the Variable absolute in-place. This method has no effect, hence it is left blank.

Returns:
void.

Implements CASObject.

Definition at line 288 of file variable.cc.

void Fraction::AbsoluteIP (  )  [virtual, inherited]

Makes the fraction absolute in-place. Therefor, the numerator and denominator are made absolute in-place.

Returns:
void.

Implements CASObject.

Definition at line 337 of file fraction.cc.

CASObject * Variable::Add ( const CASObject addend  )  const [virtual, inherited]

Adds a CASObject to the Variable. If the addend is a Variable too, and is equal to this Variable, a Product is returned with the coefficient '2' and the Variable appended. Else a Sum is returned holding this Variable and the CASObject as addends.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
addend Pointer to a CASObject representing the addend.
Returns:
a pointer to a CASObject representing the sum.

Implements CASObject.

Definition at line 340 of file variable.cc.

CASObject * Fraction::Add ( const CASObject addend  )  const [virtual, inherited]

Todo:
Implementation propably not very efficient. Improve.
Adds another CASObject to the fraction.

If the addend is another fraction, the sum will have to product of the two denominators as its denominator. If the addend is not another fraction, the numerator of the sum is the addend multiplied by the denominator of this fraction.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
addend Pointer to a CASObject which is added to this fraction.
Returns:
a pointer to a CASObject representing the sum.

Implements CASObject.

Definition at line 397 of file fraction.cc.

CASObject * Variable::Clone (  )  const [virtual, inherited]

Clones the Variable by creating a new copy on in the memory.

Remarks:
The Variable returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the cloned Variable.

Implements CASObject.

Definition at line 139 of file variable.cc.

CASObject * Fraction::Clone (  )  const [virtual, inherited]

Clones the Fraction. After cloning, there will be no relation between this object and the newly created.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to the newly created Fraction.

Implements CASObject.

Definition at line 168 of file fraction.cc.

CASObject * Variable::Divide ( const CASObject divisor  )  const [virtual, inherited]

Divides the Variable by a CASObject. If the divisor is a Variable, too, and the name is identical, then the exponents are subtracted. Else a Fraction is returned.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
divisor Pointer to a CASObject representing the divisor.
Returns:
a pointer to a CASObject representing the quotient.

Implements CASObject.

Definition at line 456 of file variable.cc.

CASObject * Fraction::Divide ( const CASObject divisor  )  const [virtual, inherited]

Calculates the quotient by multiplying this fraction with the reciprocal value of the divisor.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
divisor Pointer to a CASObject representing the divisor.
Returns:
pointer to a CASObject representing the quotient.

Implements CASObject.

Definition at line 539 of file fraction.cc.

CASObject * Variable::Evaluate (  )  const [virtual, inherited]

Evaluates the Variable. This is done by only evaluating the exponent.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer representing the evaluated Variable.

Implements CASObject.

Definition at line 720 of file variable.cc.

CASObject * Fraction::Evaluate (  )  const [virtual, inherited]

Todo:
Evaluation should also cancel the fraction.
Warning:
Not fully implemented.
Evaluates the fraction by calling Evaluate() on the numerator and denominator.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the evaluated form of the fraction.

Implements CASObject.

Definition at line 819 of file fraction.cc.

Fraction::Fraction ( const Fraction f  )  [inherited]

Copy Constructor.

Parameters:
f Reference to a Fraction.

Definition at line 129 of file fraction.cc.

Fraction::Fraction ( const CASObject denom  )  [inherited]

Construct. Initializes the denominator to specified CASObject. The numerator is initialized to a LongInt of value 1 ('one').

Parameters:
denom Pointer to a CASObject denoting the denominator.

Definition at line 108 of file fraction.cc.

Fraction::Fraction ( const CASObject num,
const CASObject denom 
) [inherited]

Construct. Initializes the numerator and denominator to specified CASObject.

Parameters:
num Pointer to a CASObject denoting the numerator.
denom Pointer to a CASObject denoting the denominator.

Definition at line 85 of file fraction.cc.

Fraction::Fraction (  )  [inherited]

Constructor. Initializes both, numerator and denominator, with a LongInt of value 1 ('one').

Definition at line 68 of file fraction.cc.

CASObject * Variable::GCD ( const CASObject o  )  const [virtual, inherited]

Todo:
Has to be implemented properly. Returns 1 ('one') in any case.
Warning:
Not properly implemented. Returns 1 ('one') in any case.
Calculates the greatest common divisor of this Variable and a CASObject.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
o Pointer to a CASObject.
Returns:
a pointer to a CASObject representing the gcd.

Implements CASObject.

Definition at line 544 of file variable.cc.

CASObject * Fraction::GCD ( const CASObject o  )  const [virtual, inherited]

Todo:
Has to be implemented.
Warning:
Not properly implemented. Returns simply 1 ('one') in any case.
Calculates the greatest common divisor.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
o Pointer to a CASObject.
Returns:
pointer to a CASObject representing the GCD.

Implements CASObject.

Definition at line 635 of file fraction.cc.

void Variable::Get ( char *  s,
unsigned long  size 
) const [virtual, inherited]

Return the string representation of the Variable as a C-string. If the buffer is too small, a EBufTooSmall exception is thrown.

Remarks:
The buffer has to be freed by the caller.
Parameters:
s Buffer receiving the string representation.
size Size of the buffer. Has to be large enough to hold the string representation.
Returns:
void.

Implements CASObject.

Definition at line 197 of file variable.cc.

void Variable::Get ( std::string &  s  )  const [virtual, inherited]

Returns the string representation of the Variable.

Parameters:
s Reference to a std::string receiving the string representation.
Returns:
void.

Implements CASObject.

Definition at line 156 of file variable.cc.

void Fraction::Get ( char *  s,
unsigned long  size 
) const [virtual, inherited]

Copies the string representation to a buffer. The buffer has to be sufficient in size, else a EBufTooSmall exception is thrown.

Remarks:
The buffer has to be allocated by the caller.
Parameters:
s Pointer to the buffer receiving the string representation.
size Unsigned long specifying the size of the buffer. If the buffer is too small, a EBufTooSmall exception is thrown.
Returns:
void.

Implements CASObject.

Definition at line 236 of file fraction.cc.

void Fraction::Get ( std::string &  s  )  const [virtual, inherited]

Returns the string representation of the fraction in a std::string.

Parameters:
s Reference to a std::string which will receive the string representation of the fraction
Returns:
void.

Implements CASObject.

Definition at line 196 of file fraction.cc.

CASObject * Variable::Invert (  )  const [virtual, inherited]

Returns the inverted representation of the Variable. This is done by creating a Product with the coefficient '-1'. The Variable is then appended, e.g. the Variable is 'a', thus the inversion is '-1*a'.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the inverted Variable. The type of the CASObject is CT_Product.

Implements CASObject.

Definition at line 304 of file variable.cc.

CASObject * Fraction::Invert (  )  const [virtual, inherited]

Todo:
Has to be implemented.
Warning:
Not implemented. Throws ENotImplemented on call.
Returns the inverted representation of the fraction.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to a CASObject representing the inverted fraction.

Implements CASObject.

Definition at line 355 of file fraction.cc.

void Variable::InvertIP (  )  [virtual, inherited]

Inverts the Variable in-place. This method has no effect. There is no sign attached to a Variable, thus it is not possible to invert it in-place.

Returns:
void.

Implements CASObject.

Definition at line 322 of file variable.cc.

void Fraction::InvertIP (  )  [virtual, inherited]

Todo:
Has to be implemented.
Warning:
Not implemented. Throws ENotImplemented on call.
Inverts the fraction in-place.

Returns:
void.

Implements CASObject.

Definition at line 372 of file fraction.cc.

bool Variable::IsEqual ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not this Variable is equal to a CASObject. Both, the name as well as the exponent have to be equal.

Parameters:
o Pointer to a CASObject to be compared.
Returns:
true if both objects are equal, false otherwise.

Implements CASObject.

Definition at line 561 of file variable.cc.

bool Fraction::IsEqual ( const CASObject o  )  const [virtual, inherited]

Todo:
Has to be implemented properly. It should use the cancelled represention of fractions.
Warning:
Not properly implemented.
Indicates whether or not another CASObject is equal to the fraction.

Parameters:
o Pointer to a CASObject which is compared to the fraction.
Returns:
true if object pointed to by o is equal, false otherwise.

Implements CASObject.

Definition at line 659 of file fraction.cc.

bool Variable::IsGT ( const CASObject o  )  const [virtual, inherited]

Todo:
Has to be implemented properly. It also relies on the outcome of GetType() to decide which object is greater than the other.
Warning:
Not properly implemented.
Indicates whether or not this Variable is greater than a CASObject.

Parameters:
o Pointer to a CASObject.
Returns:
true if this Variable is greater than the CASObject, false otherwise.

Implements CASObject.

Definition at line 638 of file variable.cc.

bool Fraction::IsGT ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not the fraction is greater than another CASObject.

Parameters:
o Pointer to a CASObject which is compared to the fraction.
Returns:
true if the fraction is greater than the object pointed to by o, false otherwise.

Implements CASObject.

Definition at line 728 of file fraction.cc.

bool Variable::IsLT ( const CASObject o  )  const [virtual, inherited]

Todo:
Has to be implemented properly. It also relies on the outcome of GetType() to decide which object is less than the other.
Warning:
Not properly implemented.
Indicates whether or not this Variable is less than a CASObject.

Parameters:
o Pointer to a CASObject.
Returns:
true if this Variable is less than the CASObject, false otherwise.

Implements CASObject.

Definition at line 593 of file variable.cc.

bool Fraction::IsLT ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not the fraction is less than another CASObject.

Parameters:
o Pointer to a CASObject which is compared to the fraction.
Returns:
true if the fraction is less than the object pointed to by o, false otherwise.

Implements CASObject.

Definition at line 690 of file fraction.cc.

bool Variable::IsOne (  )  const [virtual, inherited]

Indicates whether or not the Variable is one.

Returns:
true if the Variable is zero, false otherwise.

Implements CASObject.

Definition at line 261 of file variable.cc.

bool Fraction::IsOne (  )  const [virtual, inherited]

Indicates whether or not the fraction is one. If the numerator and denominator are equal, it assumes that the fraction is one.

Returns:
true if the fraction is one, false otherwise.

Implements CASObject.

Definition at line 306 of file fraction.cc.

bool Fraction::IsPureNumerical (  )  const [inline, virtual, inherited]

Indicates whether or not the fraction is pure numerical. It tests the numerator and denominator for being pure numerical.

Returns:
true if both, the numerator and denominator, are pure numerical, false otherwise.

Implements CASObject.

Definition at line 851 of file fraction.cc.

bool Variable::IsSimilar ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not this Variable is similar to a CASObject. To be similar, the CASObject has to be of the type CT_VARIABLE and have the same name. The exponents are not checked.

Parameters:
o Pointer to a CASObject.
Returns:
true if the objects are similar, false otherwise.

Implements CASObject.

Definition at line 661 of file variable.cc.

bool Fraction::IsSimilar ( const CASObject o  )  const [virtual, inherited]

Indicates whether or not another CASObject is similar to this fraction.

This method is not a strictly mathematical one. One CASObject is similar to another if the operands are equal. The exponent is not tested for similarity.

If it o is a fraction too, the numerators and denominators are tested for similiarity by calling IsSimilar().

Parameters:
o Pointer to a CASObject which is tested for similarity.
Returns:
true if the objects are similar, false otherwise.

Implements CASObject.

Definition at line 753 of file fraction.cc.

bool Variable::IsZero (  )  const [virtual, inherited]

Indicates whether or not the Variable is zero.

Returns:
true if the Variable is zero, false otherwise.

Implements CASObject.

Definition at line 251 of file variable.cc.

bool Fraction::IsZero (  )  const [virtual, inherited]

Indicates whether or not the fraction is zero. It does this by checking whether or not the numerator is zero.

Returns:
true if the fraction is zero, false otherwise.

Implements CASObject.

Definition at line 295 of file fraction.cc.

unsigned long Variable::Length (  )  const [virtual, inherited]

Returns the length of the string representation of the Variable.

Returns:
a unsigned long indicating the length of the string representation.

Implements CASObject.

Definition at line 231 of file variable.cc.

unsigned long Fraction::Length (  )  const [virtual, inherited]

Returns the length of the fraction for string representation.

Remarks:
It counts only characters used for representation. The null-character is not included. If needed, you have to add 1 ('one') to the length returned.
Returns:
an unsigned long indicating the length of the fraction.

Implements CASObject.

Definition at line 274 of file fraction.cc.

CASObject * Variable::Modulo ( const CASObject divisor  )  const [virtual, inherited]

Todo:
Has to be implemented properly. Returns 0 ('zero') in any case.
Warning:
Not properly implemented. Returns 0 ('zero') in any case.
Calculates the modulus of the Variable and a CASObject.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
divisor Pointer to a CASObject representing the divisor.
Returns:
a pointer to a CASObject representing the modulus.

Implements CASObject.

Definition at line 495 of file variable.cc.

CASObject * Fraction::Modulo ( const CASObject divisor  )  const [virtual, inherited]

Todo:
Has to be implemented.
Warning:
Not properly implemented. Returns simply 0 ('zero') in any case.
Calculates the modulus of the fraction and the divisor.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
divisor Pointer to a CASObject to the divisor.
Returns:
pointer to a CASObject representing the modulus.

Implements CASObject.

Definition at line 613 of file fraction.cc.

CASObject * Variable::Multiply ( const CASObject factor  )  const [virtual, inherited]

Multiplies the Variable by a CASObject. If the factor is a Variable, too, the exponents of both factors are added and the return value is of the type CT_VARIABLE. Else a Product will be created which gets appended both factors.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
factor Pointer to a CASObject representing the factor.
Returns:
a pointer to a CASObject representing the product.

Implements CASObject.

Definition at line 412 of file variable.cc.

CASObject * Fraction::Multiply ( const CASObject factor  )  const [virtual, inherited]

Calculates the product.

If the factor is another fraction, the product will have the product of the two numerators as its numerator, and the product of the two denominators as its denominator. If the factor is not another fraction, then simply the numerator of this fraction is multiplied by the factor.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
factor Pointer to a CASObject which is the factor.
Returns:
pointer to a CASObject representing the product.

Implements CASObject.

Definition at line 499 of file fraction.cc.

const Variable & Variable::operator= ( const Variable v  )  [inherited]

Assignment operator.

Parameters:
v Reference to a Variable.
Returns:
const reference to the Variable.

Definition at line 752 of file variable.cc.

const Fraction & Fraction::operator= ( const Fraction f  )  [inherited]

Assignment operator.

Parameters:
f Reference to a Fraction.

Definition at line 865 of file fraction.cc.

const bool Fraction::operator== ( const Fraction f  )  const [inherited]

Todo:
Has to be implemented properly. It should use the cancelled representation of the fractions.
Warning:
Not properly implemented.
Tests whether or not two fractions are equal.

Parameters:
f Reference to a Fraction.

Definition at line 900 of file fraction.cc.

CASObject * Variable::Power ( const CASObject exp  )  const [virtual, inherited]

qRaises the Variable to the x-th power.

The exponent of this Variable is simply multiplied with exp.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
exp Pointer to a CASObject representing the exponent.
Returns:
a pointer to the exponentiated Variable.

Implements CASObject.

Definition at line 515 of file variable.cc.

CASObject * Fraction::Power ( const CASObject exp  )  const [virtual, inherited]

Raises the fraction to the x-th power by multiplying the current exponent of the numerator and denominator with the one provided as argument.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
exp Pointer to a CASObject which represents the power to which the fraction is raised.
Returns:
pointer to a CASObject representing the fraction raised to the x-th power.

Implements CASObject.

Definition at line 583 of file fraction.cc.

void Variable::Print (  )  const [virtual, inherited]

Prints the string representation of the Variable to stdout.

Returns:
void.

Implements CASObject.

Definition at line 218 of file variable.cc.

void Fraction::Print (  )  const [virtual, inherited]

Prints the string representation to the screen.

Returns:
void.

Implements CASObject.

Definition at line 258 of file fraction.cc.

void Variable::Sort (  )  [virtual, inherited]

Sorts the Variable. Only the exponent is sorted.

Returns:
void.

Implements CASObject.

Definition at line 704 of file variable.cc.

void Fraction::Sort (  )  [virtual, inherited]

Sorts the fraction by sorting the numerator and the denominator.

Returns:
void.

Implements CASObject.

Definition at line 794 of file fraction.cc.

CASObject * Variable::SortWeight (  )  const [virtual, inherited]

Calculates the sort weight of the Variable. The weight is computed by summing up the ASCII code of each character of the name. The exponent is not taken into account.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
a pointer to a CASObject holding the sort weight as LongInt.

Implements CASObject.

Definition at line 690 of file variable.cc.

CASObject * Fraction::SortWeight (  )  const [virtual, inherited]

Calculates the sort weight of the fraction by summing up the sort weight of the numerator and denominator.

Remarks:
The CASObject returned has to be freed by the caller.
Returns:
pointer to a CASObject representing the sort weight.

Implements CASObject.

Definition at line 778 of file fraction.cc.

CASObject * Variable::Subtract ( const CASObject subtrahend  )  const [virtual, inherited]

Subtracts a CASObject from the Variable. If the subtrahend is a Variable, too, it is inverted and both variables are appended to a Sum. Else, as Sum is made of this Variable and the subtrahend is subtracted from that Sum.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
subtrahend Pointer to a CASObject representing the subtrahend.
Returns:
a pointer to a CASObject representing the difference.

Implements CASObject.

Definition at line 374 of file variable.cc.

CASObject * Fraction::Subtract ( const CASObject subtrahend  )  const [virtual, inherited]

Todo:
Implementation propably not very efficient. Improve.
Subtracts another CASObject from the fraction.

If the subtrahend is another fraction, the difference will have to product of the two denominators as its denominator. If the subtrahend is not another fraction, the numerator of the difference is the subtrahend multiplied by the denominator of this fraction.

Remarks:
The CASObject returned has to be freed by the caller.
Parameters:
subtrahend Pointer to a CASObject which is subtracted from this fraction.
Returns:
a pointer to a CASObject representing the difference.

Implements CASObject.

Definition at line 449 of file fraction.cc.

Variable::Variable ( const Variable v  )  [inherited]

Copy constructor.

Parameters:
v Reference to a Variable.

Definition at line 104 of file variable.cc.

Variable::Variable ( const std::string  n  )  [inherited]

Constructor. Initializes the exponent to 1 ('one').

Parameters:
n String holding the name of the variable.

Definition at line 91 of file variable.cc.

Variable::Variable ( const std::string  n,
const CASObject exp 
) [inherited]

Constructor.

Parameters:
n String holding the name of the variable.
exp Pointer to a CASObject holding the exponent.

Definition at line 76 of file variable.cc.

Variable::Variable (  )  [inherited]

Constructor. Sets the name of the variable to 'a' and the exponent to 1 ('one').

Definition at line 61 of file variable.cc.

Fraction::~Fraction (  )  [inherited]

Destructor. Removes the objects pointed to by numerator and denominator from memory.

Definition at line 143 of file fraction.cc.

Variable::~Variable (  )  [inherited]

Destructor.

Definition at line 116 of file variable.cc.


Generated on Sun Dec 31 01:57:29 2006 for ECAS by  doxygen 1.4.7