Classes | |
| class | CASSymbolic |
| Dummy class. More... | |
| class | Fraction |
Fraction implements a mathematical fraction More... | |
| class | Variable |
| Class which implements a mathematical variable. More... | |
Functions | |
| CASObject * | Variable::Absolute () const |
| Returns the absolute representation of the variable. | |
| CASObject * | Fraction::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. | |
| CASObject * | Variable::Add (const CASObject *addend) const |
Adds a CASObject to the variable. | |
| CASObject * | Fraction::Add (const CASObject *addend) const |
Mathematically adds another CASObject to the fraction. | |
| CASObject * | Variable::Clone () const |
| Clones the variable. | |
| CASObject * | Fraction::Clone () const |
| Clones the object. | |
| CASObject * | Variable::Divide (const CASObject *divisor) const |
Divides the variable by a CASObject. | |
| CASObject * | Fraction::Divide (const CASObject *divisor) const |
Mathematically divides the fraction by another CASObject. | |
| CASObject * | Variable::Evaluate () const |
| Evaluates the variable. | |
| CASObject * | Fraction::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. | |
| CASObject * | Variable::GCD (const CASObject *o) const |
Computes the gcd of the variable and a CASObject. | |
| CASObject * | Fraction::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. | |
| CASObject * | Variable::Invert () const |
| Returns the inverted representation of the variable. | |
| CASObject * | Fraction::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. | |
| CASObject * | Variable::Modulo (const CASObject *divisor) const |
| Calculates the modulus. | |
| CASObject * | Fraction::Modulo (const CASObject *divisor) const |
| Calculates the modulus of the fraction. | |
| CASObject * | Variable::Multiply (const CASObject *factor) const |
Multiplies the variable by a CASObject. | |
| CASObject * | Fraction::Multiply (const CASObject *factor) const |
Mathematically multiplies the fraction by another CASObject. | |
| const Variable & | Variable::operator= (const Variable &v) |
| Assignment operator. | |
| const Fraction & | Fraction::operator= (const Fraction &f) |
| Assignment operator. | |
| const bool | Fraction::operator== (const Fraction &f) const |
| Comparison operator. | |
| CASObject * | Variable::Power (const CASObject *exp) const |
| Raises the variable to the x-th power. | |
| CASObject * | Fraction::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. | |
| CASObject * | Variable::SortWeight () const |
| Calculates the sort weight of the variable. | |
| CASObject * | Fraction::SortWeight () const |
| Calculates the sort weight of the fraction. | |
| CASObject * | Variable::Subtract (const CASObject *subtrahend) const |
Subtracts a CASObject from the variable. | |
| CASObject * | Fraction::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. | |
| 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'.
CASObject returned has to be freed by the caller.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.
CASObject returned has to be freed by the caller.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.
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.
Implements CASObject.
Definition at line 337 of file fraction.cc.
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.
CASObject returned has to be freed by the caller.| addend | Pointer to a CASObject representing the addend. |
CASObject representing the sum. Implements CASObject.
Definition at line 340 of file variable.cc.
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.
CASObject returned has to be freed by the caller.| addend | Pointer to a CASObject which is added to this fraction. |
CASObject representing the sum. Implements CASObject.
Definition at line 397 of file fraction.cc.
| CASObject * Variable::Clone | ( | ) | const [virtual, inherited] |
| CASObject * Fraction::Clone | ( | ) | 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.
CASObject returned has to be freed by the caller.| divisor | Pointer to a CASObject representing the divisor. |
CASObject representing the quotient. Implements CASObject.
Definition at line 456 of file variable.cc.
Calculates the quotient by multiplying this fraction with the reciprocal value of the divisor.
CASObject returned has to be freed by the caller.| divisor | Pointer to a CASObject representing the divisor. |
CASObject representing the quotient. Implements CASObject.
Definition at line 539 of file fraction.cc.
| CASObject * Variable::Evaluate | ( | ) | const [virtual, inherited] |
| CASObject * Fraction::Evaluate | ( | ) | const [virtual, inherited] |
Evaluate() on the numerator and denominator.
CASObject returned has to be freed by the caller.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.
| 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').
| denom | Pointer to a CASObject denoting the denominator. |
Definition at line 108 of file fraction.cc.
Construct. Initializes the numerator and denominator to specified CASObject.
| 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.
Variable and a CASObject.
CASObject returned has to be freed by the caller.| o | Pointer to a CASObject. |
CASObject representing the gcd. Implements CASObject.
Definition at line 544 of file variable.cc.
CASObject returned has to be freed by the caller.| o | Pointer to a CASObject. |
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.
| s | Buffer receiving the string representation. | |
| size | Size of the buffer. Has to be large enough to hold the string representation. |
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.
| s | Reference to a std::string receiving the string representation. |
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.
| 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. |
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.
| s | Reference to a std::string which will receive the string representation of the fraction |
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'.
CASObject returned has to be freed by the caller.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] |
ENotImplemented on call.
CASObject returned has to be freed by the caller.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.
Implements CASObject.
Definition at line 322 of file variable.cc.
| void Fraction::InvertIP | ( | ) | [virtual, inherited] |
ENotImplemented on call.
Implements CASObject.
Definition at line 372 of file fraction.cc.
| bool Variable::IsEqual | ( | const CASObject * | o | ) | const [virtual, inherited] |
| bool Fraction::IsEqual | ( | const CASObject * | o | ) | const [virtual, inherited] |
CASObject is equal to the fraction.
| o | Pointer to a CASObject which is compared to the fraction. |
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] |
Variable is greater than a CASObject.
| o | Pointer to a CASObject. |
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.
| o | Pointer to a CASObject which is compared to the fraction. |
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] |
Variable is less than a CASObject.
| o | Pointer to a CASObject. |
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.
| o | Pointer to a CASObject which is compared to the fraction. |
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.
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.
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.
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.
| o | Pointer to a CASObject. |
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().
| o | Pointer to a CASObject which is tested for similarity. |
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.
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.
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.
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.
Implements CASObject.
Definition at line 274 of file fraction.cc.
Variable and a CASObject.
CASObject returned has to be freed by the caller.| divisor | Pointer to a CASObject representing the divisor. |
CASObject representing the modulus. Implements CASObject.
Definition at line 495 of file variable.cc.
CASObject returned has to be freed by the caller.| divisor | Pointer to a CASObject to the divisor. |
CASObject representing the modulus. Implements CASObject.
Definition at line 613 of file fraction.cc.
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.
CASObject returned has to be freed by the caller.| factor | Pointer to a CASObject representing the factor. |
CASObject representing the product. Implements CASObject.
Definition at line 412 of file variable.cc.
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.
CASObject returned has to be freed by the caller.| factor | Pointer to a CASObject which is the factor. |
CASObject representing the product. Implements CASObject.
Definition at line 499 of file fraction.cc.
Assignment operator.
| v | Reference to a Variable. |
Variable. Definition at line 752 of file variable.cc.
Assignment operator.
| f | Reference to a Fraction. |
Definition at line 865 of file fraction.cc.
| const bool Fraction::operator== | ( | const Fraction & | f | ) | const [inherited] |
| f | Reference to a Fraction. |
Definition at line 900 of file fraction.cc.
qRaises the Variable to the x-th power.
The exponent of this Variable is simply multiplied with exp.
CASObject returned has to be freed by the caller.| exp | Pointer to a CASObject representing the exponent. |
Variable. Implements CASObject.
Definition at line 515 of file variable.cc.
Raises the fraction to the x-th power by multiplying the current exponent of the numerator and denominator with the one provided as argument.
CASObject returned has to be freed by the caller.| exp | Pointer to a CASObject which represents the power to which the fraction is raised. |
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.
Implements CASObject.
Definition at line 218 of file variable.cc.
| void Fraction::Print | ( | ) | const [virtual, inherited] |
Prints the string representation to the screen.
Implements CASObject.
Definition at line 258 of file fraction.cc.
| void Variable::Sort | ( | ) | [virtual, inherited] |
Sorts the Variable. Only the exponent is sorted.
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.
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.
CASObject returned has to be freed by the caller.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.
CASObject returned has to be freed by the caller.CASObject representing the sort weight. Implements CASObject.
Definition at line 778 of file fraction.cc.
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.
CASObject returned has to be freed by the caller.| subtrahend | Pointer to a CASObject representing the subtrahend. |
CASObject representing the difference. Implements CASObject.
Definition at line 374 of file variable.cc.
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.
CASObject returned has to be freed by the caller.| subtrahend | Pointer to a CASObject which is subtracted from this fraction. |
CASObject representing the difference. Implements CASObject.
Definition at line 449 of file fraction.cc.
| Variable::Variable | ( | const Variable & | v | ) | [inherited] |
Copy constructor.
| 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').
| 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.
| 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.
1.4.7