Classes | |
| class | CASTerm |
| Pure abstract class for implementing a term. More... | |
| class | Product |
| Implements a multi-term product. More... | |
| class | Sum |
| Implements an algebraic sum. More... | |
Functions | |
| CASObject * | Sum::Absolute () const |
Returns the absolute representation of the Sum. | |
| CASObject * | Product::Absolute () const |
Returns the absolute representation of the Product. | |
| void | Sum::AbsoluteIP () |
Makes the Sum absolute in-place. | |
| void | Product::AbsoluteIP () |
Makes the Product absolute in-place. | |
| CASObject * | Sum::Add (const CASObject *addend) const |
Adds a CASObject to the Sum. | |
| CASObject * | Product::Add (const CASObject *addend) const |
Adds a CASObject to the Product. | |
| virtual void | CASTerm::Append (const CASObject *a) |
Appends a CASObject to the operands vector. | |
| CASTerm::CASTerm () | |
| Constructor. | |
| CASObject * | Sum::Clone () const |
Clones the Sum. | |
| CASObject * | Product::Clone () const |
Clones the Product. | |
| CASObject * | Sum::Collect () const |
Collects operands in the Sum. | |
| CASObject * | Product::Collect () const |
Collects in the Product. | |
| CASObject * | Sum::CollectEqualOperands () const |
| Collects operands of the same value and type. | |
| CASObject * | Product::CollectEqualOperands () const |
| Collects operands of the same value and type. | |
| CASObject * | Sum::CollectNonSingleValues () const |
| Collects in non-single values. | |
| CASObject * | Product::CollectOther () const |
| Collect all other (non-equal) operands. | |
| CASObject * | Sum::CollectSingleValues () const |
| Collects in single values. | |
| CASObject * | Sum::Divide (const CASObject *divisor) const |
Divides the Sum by a CASObject. | |
| CASObject * | Product::Divide (const CASObject *divisor) const |
Divides the Product by a CASObject. | |
| CASObject * | Sum::Evaluate () const |
Evaluates the Sum. | |
| CASObject * | Product::Evaluate () const |
Evaluates the Product. | |
| CASObject * | Sum::Expand () const |
Expands the Sum. | |
| CASObject * | Product::Expand () const |
Expands the Product. | |
| void | Product::ExplodeSumsIP () |
| Expands sums in place. | |
| CASObject * | Sum::GCD (const CASObject *o) const |
Calculates the gcd of the Sum and a CASObject. | |
| CASObject * | Product::GCD (const CASObject *o) const |
Calculates the gcd of the Product and a CASObject. | |
| void | Sum::Get (char *s, unsigned long size) const |
Gets the string representation of the Sum. | |
| void | Sum::Get (std::string &s) const |
Gets the string representation of the Sum. | |
| void | Product::Get (char *s, unsigned long size) const |
Gets the string representation of the Product. | |
| void | Product::Get (std::string &s) const |
Gets the string representation of the Product. | |
| const CASObject * | Product::GetCoefficient () const |
| Returns the pointer to the coefficient if any. | |
| virtual void | CASTerm::GetNonSingleValues (std::vector< const CASObject * > &lst) const |
| Populates a vector with non single values. | |
| void | Product::GetNonSums (const std::vector< const CASObject * > &in, std::vector< const CASObject * > &out) |
Get all operands which are not of the CASType CT_SUM. | |
| virtual void | CASTerm::GetOperands (const CASTerm *t, std::vector< const CASObject * > &out) const |
Populates the vector with the operands of the given CASTerm. | |
| void | Product::GetOperandsWithoutCoefficient (std::vector< const CASObject * > &lst) const |
| Returns a vector holding all operands not including the coefficient if any. | |
| virtual void | CASTerm::GetSingleValues (std::vector< const CASObject * > &lst) const |
| Populates a vector with single values. | |
| void | Product::GetSums (const std::vector< const CASObject * > &in, std::vector< const CASObject * > &out) |
Get all operands of the CASType CT_SUM. | |
| virtual bool | CASTerm::HaveSameOperands (const CASObject *o) const |
Determines whether or not another CASObject has the same operands. | |
| CASObject * | Sum::Invert () const |
Returns the inverted representation of the Sum. | |
| CASObject * | Product::Invert () const |
Returns the inverted Product. | |
| void | Sum::InvertIP () |
Inverts the Sum in-place. | |
| void | Product::InvertIP () |
Inverts the Product in-place. | |
| virtual bool | CASTerm::IsEqual (const CASObject *o) const |
Indicates whether another CASObject is equal to this. | |
| virtual bool | CASTerm::IsGT (const CASObject *o) const |
Indicates whether another CASObject is greater than this. | |
| virtual bool | CASTerm::IsLT (const CASObject *o) const |
Indicates whether another CASObject is less than this. | |
| bool | Sum::IsOne () const |
Indicates whether or not the Sum is one. | |
| bool | Product::IsOne () const |
Indicates whether or not the Product is one. | |
| virtual bool | CASTerm::IsPureNumerical () const |
| Indicates whether or not this object is a pure numerical. | |
| bool | Sum::IsSimilar (const CASObject *o) const |
Indicates whether or not the Sum is similar to a CASObject. | |
| bool | Product::IsSimilar (const CASObject *o) const |
Indicates whether or not the Product is similar to a CASObject. | |
| bool | Sum::IsZero () const |
Indicates whether or not the Sum is zero. | |
| bool | Product::IsZero () const |
Indicates whether or not the Product is zero. | |
| unsigned long | Sum::Length () const |
| Returns the length of the string representation. | |
| unsigned long | Product::Length () const |
| Returns the length of the string representation. | |
| CASObject * | Sum::Modulo (const CASObject *divisor) const |
| Calculates the modulus. | |
| CASObject * | Product::Modulo (const CASObject *divisor) const |
| Calculates the modulus. | |
| CASObject * | Sum::Multiply (const CASObject *factor) const |
Multiplies the Sum by a CASObject. | |
| CASObject * | Product::Multiply (const CASObject *factor) const |
Multiplies the Product by a CASObject. | |
| unsigned long | CASTerm::NumOperands () const |
| Returns the number of operands in the vector. | |
| const Sum & | Sum::operator= (const Sum &s) |
| Assignment operator. | |
| const Product & | Product::operator= (const Product &f) |
| Assignment operator. | |
| virtual CASObject * | CASTerm::Power (const CASObject *exp) const |
| Exponentiates the term. | |
| void | Sum::Print () const |
| Prints the string representation to stdout. | |
| void | Product::Print () const |
| Prints the string representation to the stdout. | |
| Product::Product (const Product &p) | |
| Copy constructor. | |
| Product::Product () | |
| Constructor. | |
| void | Sum::RemoveNoOpElements () |
Remove operands having no effect on the Sum. | |
| void | Product::RemoveNoOpElements () |
Removes operands having no effect on the Product. | |
| virtual void | CASTerm::SetAllEvaluated () |
| Used to set all subobject into an evaluated state. | |
| virtual void | CASTerm::SetOperands (CASTerm *t, const std::vector< CASObject * > &in) const |
Populates the operands of the given CASTerm with the given vector. | |
| virtual void | CASTerm::SetOperands (CASTerm *t, const std::vector< const CASObject * > &in) const |
Populates the operands of the given CASTerm with the given vector. | |
| virtual void | CASTerm::Sort () |
| Sorts the operands. | |
| virtual CASObject * | CASTerm::SortWeight () const |
Returns the sort weight of the CASTerm. | |
| CASObject * | Sum::Subtract (const CASObject *subtrahend) const |
Subtracts a CASObject from the Sum. | |
| CASObject * | Product::Subtract (const CASObject *subtrahend) const |
Subtracts a CASObject from the Product. | |
| Sum::Sum (const Sum &s) | |
| Copy constructor. | |
| Sum::Sum () | |
| Constructor. | |
| virtual void | CASTerm::UnsetAllEvaluated () |
| Used to set all subobjects into an unevaluated state. | |
| Sum * | Sum::WithExponentOne () const |
Returns the Sum with an exponent of one. | |
| virtual | CASTerm::~CASTerm () |
| Destructor. | |
| Product::~Product () | |
| Destructor. | |
| Sum::~Sum () | |
| Destructor. | |
| CASObject * Sum::Absolute | ( | ) | const [virtual, inherited] |
| CASObject * Product::Absolute | ( | ) | const [virtual, inherited] |
| void Sum::AbsoluteIP | ( | ) | [virtual, inherited] |
| void Product::AbsoluteIP | ( | ) | [virtual, inherited] |
Makes the Product absolute in-place. Therefor, it makes all operands absolute in place.
Implements CASObject.
Definition at line 757 of file product.cc.
Adds a CASObject to the Sum. If the addend is a Sum, too, it checks whether or not it is equal to this Sum. If so, it returns a Product with the coefficient set to 2 and this Sum appended.
If the addend is not of the type CT_SUM, it clones itself and searches for a occurence of the type of the addend in the operands vector of the clone. If it finds an operand of the same type, it adds them together. However this is only done, if the exponent of clone is one, thus the exponent of this Sum is one.
As a last resort, it simply puts the addend and this Sum together in a new Sum.
CASObject returned has to be freed by the caller.CASObject representing the sum. Implements CASObject.
Add a CASObject to the Product.
It first checks whether or not the CASObject is of the type CT_PRODUCT. If it is a product:
Sum of both operands vectors.
If the addend is not a CT_PRODUCT:
Product has only a single element. If so, it checks whether or not the addend is equal this single element and acts accordingly.Sum and appends this Product and the addend.
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 821 of file product.cc.
| void CASTerm::Append | ( | const CASObject * | o | ) | [virtual, inherited] |
Appends a CASObject to the operands vector. The CASObject o will be cloned, so it does not have to be kept after calling Append().
CASObject passed is cloned. The caller is responsible for freeing the memory occupied by that CASObject.| o | Pointer to a CASObject which will be appended to the operands vector by cloning it first. |
Definition at line 299 of file casterm.cc.
| CASTerm::CASTerm | ( | ) | [inherited] |
Constructor. Sets the flag CASMetaInfo::singlevalue to false using CASMetaInfo::UnsetSingleValue().
Definition at line 232 of file casterm.cc.
| CASObject * Sum::Clone | ( | ) | const [virtual, inherited] |
| CASObject * Product::Clone | ( | ) | const [virtual, inherited] |
| CASObject * Sum::Collect | ( | ) | const [virtual, inherited] |
| CASObject * Product::Collect | ( | ) | const [virtual, inherited] |
| CASObject * Sum::CollectEqualOperands | ( | ) | const [private, inherited] |
The Sum has to be sorted for collecting. Collecting is done by looping thru all operands and looking ahead if the next operand IsEqual() than the current one. If it is equal, it will be put in a separate vector. After all operands have been processed in this manner, the occurence of the equal objects is used as coefficient for each distinct group of equal objects. This gives a new vector, the final vector holding the objects with their coefficient. Then all the equal objects are destroyed.
The return value is a pointer to a CASObject, because it is not certain that the Sum stays a Sum. For instance, if we collect 'a+a' the result would be '2*a' which is not a Sum anymore.
CASObject returned has to be freed by the caller.| CASObject * Product::CollectEqualOperands | ( | ) | const [private, inherited] |
The Product has to be sorted for collecting. Collecting is done by looping thru all operands and looking ahead if the next operand IsEqual() than the current one. If it is equal, it will be put in a separate vector. After all operands have been processed in this manner, the occurence of the equal objects is used as exponent for each distinct group of equal objects. This gives a new vector, the final vector holding the objects with their exponents. Then all the equal objects are destroyed.
CASObject returned has to be freed by the caller.Definition at line 103 of file product.cc.
| CASObject * Sum::CollectNonSingleValues | ( | ) | const [private, inherited] |
Collects remaining non-single values which are not equal, thus have been left untouched by Sum::CollectEqualOperands(). It retrieves a vector holding the non-single values by calling CASTerm::GetNonSingleValues(). It then goes thru all the non-single values and looks for similar CASObject. If it finds similar CASObject, it sums them up replacing the old CASObject with the outcome.
The return value is a pointer to a CASObject, because it is not certain that the Sum stays a Sum. For instance, if we collect '2*a+3*a' the result would be '5*a' which is not a Sum anymore.
CASObject returned has to be freed by the caller.CASObject in which all non-single values are collected. | CASObject * Product::CollectOther | ( | ) | const [private, inherited] |
Collects operands not collected by Product::CollectEqualOperands().
It loops thru all operands and checks them for similarity with the other operands.
CASObject returned has to be freed by the caller.Definition at line 231 of file product.cc.
| CASObject * Sum::CollectSingleValues | ( | ) | const [private, inherited] |
Collects remaining single values which are not equal, thus have been left untouched by Sum::CollectEqualOperands(). It retrieves a vector holding the single values by calling CASTerm::GetSingleValues(). It then goes thru all the single values and looks for similar CASObject. If it finds similar CASObject, it sums them up replacing the old CASObject with the outcome.
The return value is a pointer to a CASObject, because it is not certain that the Sum stays a Sum. For instance, if we collect '2*a+a' the result would be '3*a' which is not a Sum anymore.
CASObject returned has to be freed by the caller.CASObject in which all single values are collected.
Divides this Sum by a CASObject. This will always result in a Fraction with this Sum as numerator and the divisor as denominator.
CASObject returned has to be freed by the caller.| divisor | Pointer to a CASObject which is the divisor. |
CASObject representing the quotient. Implements CASObject.
Divides this Product by a CASObject. The result is a Fraction with this Product as numerator and the CASObject as denominator.
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 1063 of file product.cc.
| CASObject * Sum::Evaluate | ( | ) | const [virtual, inherited] |
Evaluates the Sum. This is done by
Sum.CASMetaInfo::evaluated flags on all subobjects.
Further if the outcome of the evaluation is either zero or one, it returns the appropriate LongInt.
CASObject returned has to be freed by the caller.CASObject representing the evaluated form. Implements CASObject.
| CASObject * Product::Evaluate | ( | ) | const [virtual, inherited] |
Evaluates the Product. This is done by:
Product.CASMetaInfo::evaluated flags on all subobjects.
Further if the outcome of the evaluation is either zero or one, it returns the appropriate LongInt.
CASObject returned has to be freed by the caller.CASObject representing the evaluated form. Implements CASObject.
Definition at line 1137 of file product.cc.
| CASObject * Sum::Expand | ( | ) | const [virtual, inherited] |
Sum has to be evaluated. Otherwise a EEvaluateFirst exception is thrown.Sum. Expansion is done only if
Expansion is done in the following fashion:
Sum is retrieved with an exponent of one.Product is created with Sum appended 'exponent'-times.
CASObject returned has to be freed by the caller.Implements CASTerm.
| CASObject * Product::Expand | ( | ) | const [virtual, inherited] |
Product has to be evaluated. Otherwise a EEvaluateFirst exception is thrown.Product. Expansion is done only if the Product is already evaluated.Expansion is done in the following fashion:
Sum in-place by calling Product::ExplodeSumsIP().
This is all done by while() loops. No intelligence is implemented. Therefore, a huge memory consumption is likely when expanding terms with huge exponents.
CASObject returned has to be freed by the caller.Implements CASTerm.
Definition at line 1256 of file product.cc.
| void Product::ExplodeSumsIP | ( | ) | [private, inherited] |
Sum in-place. It loops thru all operands and checks if they are of the type CT_SUM with an exponent not equal to one. If so, it puts the Sum in the operands vector as many times the exponent says.
Definition at line 296 of file product.cc.
Sum and a CASObject.
CASObject returned has to be freed by the caller.| o | Pointer to a CASObject. |
CASObject representing the gcd. Implements CASObject.
Product and a CASObject.
CASObject returned has to be freed by the caller.| o | Pointer to a CASObject representing the divisor. |
CASObject representing the modulus. Implements CASObject.
Definition at line 1109 of file product.cc.
| void Sum::Get | ( | char * | s, | |
| unsigned long | size | |||
| ) | const [virtual, inherited] |
Return the string representation of the Sum 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.
| void Sum::Get | ( | std::string & | s | ) | const [virtual, inherited] |
| void Product::Get | ( | char * | s, | |
| unsigned long | size | |||
| ) | const [virtual, inherited] |
Return the string representation of the Product 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 546 of file product.cc.
| void Product::Get | ( | std::string & | s | ) | const [virtual, inherited] |
Returns the string representation of the Product.
| s | Reference to a std::string receiving the string representation. | |
| s | Reference to a std::string. |
Implements CASObject.
Definition at line 480 of file product.cc.
| void CASTerm::GetNonSingleValues | ( | std::vector< const CASObject * > & | lst | ) | const [protected, virtual, inherited] |
Populates a vector with non single values, such as Sum and Product. Therefore, it uses std::for_each as well as CASExtractNonSingleValues.
| lst | A reference to a vector which will hold all non-single values. |
Definition at line 69 of file casterm.cc.
| void Product::GetNonSums | ( | const std::vector< const CASObject * > & | in, | |
| std::vector< const CASObject * > & | out | |||
| ) | [private, inherited] |
Product. Modifications of those objects are reflected in the Product as well.CT_SUM in the operands vector of this Product. The vector returned contains the pointer to the objects in the operands vector. No cloning takes place. So, if the objects in the vector in are modified, this is reflected in the Product operands as well.
| in | Reference to a vector holding all operands. | |
| out | Reference to a vector which will be populated with the pointers to the non Sum objects. |
Definition at line 385 of file product.cc.
| void CASTerm::GetOperands | ( | const CASTerm * | t, | |
| std::vector< const CASObject * > & | out | |||
| ) | const [protected, virtual, inherited] |
This method returns the operands of t in out. With this function, it is possible for the offsprings of CASTerm to access one others operands.
CASObjects copied into the vector out point to the same objects as the pointers in t. So destroying those objects will result in a disaster.| t | Pointer to a CASTerm from which the operands will be copied to the vector. | |
| out | Reference to a vector which will be populated with the pointers to the operands of t. |
Definition at line 157 of file casterm.cc.
| void Product::GetOperandsWithoutCoefficient | ( | std::vector< const CASObject * > & | lst | ) | const [private, inherited] |
Returns all operands excluding the coefficient if any. The vector returned holds the pointers to the operands in this object (this->operands). Therefore there is no need to destroy the objects pointed to by the returned vector.
| lst | Vector which will be populated with the operands. |
Definition at line 67 of file product.cc.
| void CASTerm::GetSingleValues | ( | std::vector< const CASObject * > & | lst | ) | const [protected, virtual, inherited] |
Populates a vector with non single values, such as Variable and LongInt. Therefore, it uses std::for_each as well as CASExtractNonSingleValues.
| lst | A reference to a vector which will hold all non-single values. |
Definition at line 86 of file casterm.cc.
| void Product::GetSums | ( | const std::vector< const CASObject * > & | in, | |
| std::vector< const CASObject * > & | out | |||
| ) | [private, inherited] |
Product. Modifications of those objects are reflected in the Product as well.Sum objects in the operands vector. The vector returned contains the pointer to the objects in the operands vector. No cloning takes place. So, if the objects in the vector in are modified, this is reflected in the Product operands as well.
| in | Reference to a vector holding all operands. | |
| out | Reference to a vector which will be populated with the pointers to the Sum object. |
Definition at line 358 of file product.cc.
| bool CASTerm::HaveSameOperands | ( | const CASObject * | o | ) | const [protected, virtual, inherited] |
Determines whether or not another CASObject has the same operands. They must be of the same type, so comparing a Sum with a Product does not work.
The two objects are first cloned and the sorted, in order to prepare them for use with std::equal. They further have to have the same amount of operands, of course.
| o | Pointer to a CASObject which will be compared to this object. |
true if the operands are the same, false otherwise. Definition at line 107 of file casterm.cc.
| CASObject * Sum::Invert | ( | ) | const [virtual, inherited] |
| CASObject * Product::Invert | ( | ) | const [virtual, inherited] |
| void Sum::InvertIP | ( | ) | [virtual, inherited] |
| void Product::InvertIP | ( | ) | [virtual, inherited] |
Inverts the Product in-place. Therefor, it inverts all of its operands in-place.
Implements CASObject.
Definition at line 789 of file product.cc.
| bool CASTerm::IsEqual | ( | const CASObject * | o | ) | const [virtual, inherited] |
Indicates whether o is equal to this CASTerm. This means everything is compared for equalness, the type, the amount of operands, the exponent, and last but not least whether or not the operands are the same.
o have to be sorted, since std::equal is used.| o | Pointer to a CASObject which will be compared to this. |
true if o is equal to this, false otherwise. Implements CASObject.
Definition at line 318 of file casterm.cc.
| bool CASTerm::IsGT | ( | const CASObject * | o | ) | const [virtual, inherited] |
o is greater than this object.
| o | Pointer to a CASObject which is compared to this object. |
true if this object is greater than o, false otherwise. Implements CASObject.
Definition at line 380 of file casterm.cc.
| bool CASTerm::IsLT | ( | const CASObject * | o | ) | const [virtual, inherited] |
o is less than this object.
| o | Pointer to a CASObject which is compared to this object. |
true if this object is less than o, false otherwise. Implements CASObject.
Definition at line 359 of file casterm.cc.
| bool Sum::IsOne | ( | ) | const [virtual, inherited] |
| bool Product::IsOne | ( | ) | const [virtual, inherited] |
Indicates whether or not the Product is one. Therefor it checks if every operand is one.
true if the Product is one, false otherwise. Implements CASObject.
Definition at line 628 of file product.cc.
| bool CASTerm::IsPureNumerical | ( | ) | const [virtual, inherited] |
Indicates whether or not this object is a pure numerical one. It does this by using std::for_each together with CASIsPureNumerical.
true if it is a pure numerical object, false otherwise. Implements CASObject.
Definition at line 406 of file casterm.cc.
| bool Sum::IsSimilar | ( | const CASObject * | o | ) | const [virtual, inherited] |
Indicates whether or not a CASObject is similar to this Sum. It calls CASTerm::HaveSameOperands() to find out whether or not o is similar. The exponent is not checked.
| o | Pointer to a CASObject. |
true if o is similar, false otherwise. Implements CASObject.
| bool Product::IsSimilar | ( | const CASObject * | o | ) | const [virtual, inherited] |
Indicates whether or not a CASObject is similar to this Product. If the CASObject is of type CT_PRODUCT it extracts all non-coefficient operands of both objects and converts the outcome to two Product objects. It then compares the two new Product object using IsEqual().
| o | Pointer to a CASObject which is tested for similarity. |
true if the objects are similar, false otherwise. Implements CASObject.
Definition at line 655 of file product.cc.
| bool Sum::IsZero | ( | ) | const [virtual, inherited] |
| bool Product::IsZero | ( | ) | const [virtual, inherited] |
| unsigned long Sum::Length | ( | ) | const [virtual, inherited] |
| unsigned long Product::Length | ( | ) | const [virtual, inherited] |
Returns the length of the string representation of the Product.
Implements CASObject.
Definition at line 580 of file product.cc.
Sum 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.
Product 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 1086 of file product.cc.
Multiplies this Sum by a CASObject. If the factor is of the same type, CT_SUM, then it checks whether or not the operands are the same, if so, it adds the exponent of the factor to the exponent of this Sum. Else, it simply creates a new Product by appending this and factor as factors.
CASObject returned has to be freed by the caller.| factor | Pointer to a CASObject which is the factor. |
CASObject representing the product. Implements CASObject.
Multiplies this Product by a CASObject. If the factor is of the type CT_PRODUCT, its operands are appended to the operands of this Product.
If the factor is a different type, it searches for an occurrence of the type of the factor in its operands. If there is a occurrence with the same type, it is multiplied by the factor. If there is no occurrence, the factor is appended to the operands vector and set as coefficient if appropriate.
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 989 of file product.cc.
| unsigned long CASTerm::NumOperands | ( | ) | const [inherited] |
Returns the number of operands in the operands vector.
operands vector. Definition at line 393 of file casterm.cc.
Assignment operator.
| p | Reference to a Product. |
Product. Definition at line 1442 of file product.cc.
Raises the term to the exp-Power. The exisiting exponent will be multiplied by exp.
CASObject returned has to be freed by the caller.| exp | Pointer to a CASObject, which denotes the exponent, which will be multiplied with the existing one. |
CASObject representing the term with the new exponent. Implements CASObject.
Definition at line 265 of file casterm.cc.
| void Sum::Print | ( | ) | const [virtual, inherited] |
| void Product::Print | ( | ) | const [virtual, inherited] |
Prints the string representation to stdout.
Implements CASObject.
Definition at line 567 of file product.cc.
| Product::Product | ( | const Product & | p | ) | [inherited] |
Copy constructor.
| p | Reference to the Product. |
Definition at line 434 of file product.cc.
| Product::Product | ( | ) | [inherited] |
Constructor. Initializes the Product with a zero length operands vector and sets the exponent to one.
Definition at line 407 of file product.cc.
| void Sum::RemoveNoOpElements | ( | ) | [virtual, inherited] |
| void Product::RemoveNoOpElements | ( | ) | [virtual, inherited] |
Removes operands which have no effect on the Product. One is considered a noop. This is method is called for each operand as well.
Implements CASTerm.
Definition at line 1412 of file product.cc.
| void CASTerm::SetAllEvaluated | ( | ) | [virtual, inherited] |
Sets all operands and their operands in turn into the evaluated state by calling CASMetaInfo::SetEvaluated().
Definition at line 478 of file casterm.cc.
| void CASTerm::SetOperands | ( | CASTerm * | t, | |
| const std::vector< CASObject * > & | in | |||
| ) | const [protected, virtual, inherited] |
Replaces the operands vector of t with the operands in in. It has the same purpose as CASTerm::GetOperands(), which is to give access to the offspring of CASTerm to give one others access to the operands.
The operands are cloned.
| t | Pointer to a CASTerm of which the operands are replaced. | |
| in | Reference to the vector which is used to replace the operands of t. |
Definition at line 210 of file casterm.cc.
| void CASTerm::SetOperands | ( | CASTerm * | t, | |
| const std::vector< const CASObject * > & | in | |||
| ) | const [protected, virtual, inherited] |
Replaces the operands vector of t with the operands in in. It has the same purpose as CASTerm::GetOperands(), which is to give access to the offspring of CASTerm to give one others access to the operands.
The operands are cloned.
| t | Pointer to a CASTerm of which the operands are replaced. | |
| in | Reference to the vector which is used to replace the operands of t. |
Definition at line 180 of file casterm.cc.
| void CASTerm::Sort | ( | ) | [virtual, inherited] |
Sorts itself by calling Sort() for each of its operands and finally sorting the operands vector by calling std::sort. Eventually, it sets the CASMeta::sorted flag by calling CASMeta::SetSorted().
Implements CASObject.
Definition at line 438 of file casterm.cc.
| CASObject * CASTerm::SortWeight | ( | ) | const [virtual, inherited] |
Calculates the sort weight of it. It sums up the sort weight of each of its operands and returns the sum.
CASObject returned has to be freed by the caller.CASObject which indicates the sort weight if it. Implements CASObject.
Definition at line 421 of file casterm.cc.
Subtracts a CASObject from this Sum. If the subtrahend is of the same type, hence CT_SUM, it appends all operands of the subtrahend in their inverted form.
If the subtrahend is a different type, it searches for an occurrence of that type in its operands and subtracts the subtrahend from that object, if any is found.
As last resort, it simply appends the inverted form of the subtrahend to a cloned Sum.
CASObject returned has to be freed by the caller.CASObject representing the sum. Implements CASObject.
Product::Add().Sum and apends this Product and the inverted form of the subtrahend.
CASObject returned has to be freed by the caller.| subtrahend | Pointer to a CASObject representing the subtrahend. |
Implements CASObject.
Definition at line 959 of file product.cc.
| Sum::Sum | ( | const Sum & | s | ) | [inherited] |
| Sum::Sum | ( | ) | [inherited] |
| void CASTerm::UnsetAllEvaluated | ( | ) | [virtual, inherited] |
Sets all operands and their operands in turn into the enevaluated state by calling CASMetaInfo::UnsetEvaluated().
Definition at line 458 of file casterm.cc.
| Sum * Sum::WithExponentOne | ( | ) | const [private, inherited] |
| CASTerm::~CASTerm | ( | ) | [virtual, inherited] |
Destructor. Destroys all the operands.
Definition at line 239 of file casterm.cc.
| Product::~Product | ( | ) | [inherited] |
Destructor. Destroys the exponent. Operands are destroyed by CASTerm::~CASTerm().
Definition at line 419 of file product.cc.
| Sum::~Sum | ( | ) | [inherited] |
Destructor. Destroys the exponent. Operands are destroyed by CASTerm::~CASTerm().
1.4.7