#include <product.h>
Inheritance diagram for Product:

Public Member Functions | |
| CASObject * | Absolute () const |
Returns the absolute representation of the Product. | |
| void | AbsoluteIP () |
Makes the Product absolute in-place. | |
| CASObject * | Add (const CASObject *addend) const |
Adds a CASObject to the Product. | |
| CASObject * | Clone () const |
Clones the Product. | |
| CASObject * | Collect () const |
Collects in the Product. | |
| CASObject * | Divide (const CASObject *divisor) const |
Divides the Product by a CASObject. | |
| CASObject * | Evaluate () const |
Evaluates the Product. | |
| CASObject * | Expand () const |
Expands the Product. | |
| CASObject * | GCD (const CASObject *o) const |
Calculates the gcd of the Product and a CASObject. | |
| void | Get (char *s, unsigned long size) const |
Gets the string representation of the Product. | |
| void | Get (std::string &s) const |
Gets the string representation of the Product. | |
| CASType | GetType () const |
Returns the CASType of the Product. | |
| CASObject * | Invert () const |
Returns the inverted Product. | |
| void | InvertIP () |
Inverts the Product in-place. | |
| bool | IsOne () const |
Indicates whether or not the Product is one. | |
| bool | IsSimilar (const CASObject *o) const |
Indicates whether or not the Product is similar to a CASObject. | |
| bool | IsZero () const |
Indicates whether or not the Product is zero. | |
| unsigned long | Length () const |
| Returns the length of the string representation. | |
| CASObject * | Modulo (const CASObject *divisor) const |
| Calculates the modulus. | |
| CASObject * | Multiply (const CASObject *factor) const |
Multiplies the Product by a CASObject. | |
| const Product & | operator= (const Product &f) |
| Assignment operator. | |
| void | Print () const |
| Prints the string representation to the stdout. | |
| Product (const Product &p) | |
| Copy constructor. | |
| Product () | |
| Constructor. | |
| void | RemoveNoOpElements () |
Removes operands having no effect on the Product. | |
| CASObject * | Subtract (const CASObject *subtrahend) const |
Subtracts a CASObject from the Product. | |
| ~Product () | |
| Destructor. | |
Private Member Functions | |
| CASObject * | CollectEqualOperands () const |
| Collects operands of the same value and type. | |
| CASObject * | CollectOther () const |
| Collect all other (non-equal) operands. | |
| void | ExplodeSumsIP () |
| Expands sums in place. | |
| const CASObject * | GetCoefficient () const |
| Returns the pointer to the coefficient if any. | |
| void | GetNonSums (const std::vector< const CASObject * > &in, std::vector< const CASObject * > &out) |
Get all operands which are not of the CASType CT_SUM. | |
| void | GetOperandsWithoutCoefficient (std::vector< const CASObject * > &lst) const |
| Returns a vector holding all operands not including the coefficient if any. | |
| void | GetSums (const std::vector< const CASObject * > &in, std::vector< const CASObject * > &out) |
Get all operands of the CASType CT_SUM. | |
Friends | |
| class | CASConvert |
Friend for converting to this CASType. | |
| void | evaluate_operands (Product *) |
| Friend for evaluating operands. | |
| void | expand_operands (Product *) |
| Friend for expanding operands. | |
| void | resolve_parentheses (CASObject *) |
| Friend for resolving parentheses. | |
CASTerm.
Objects can either be appended by calling Append() or they can be used as operands of the various arithmetic operations.
Definition at line 60 of file product.h.
| CASType Product::GetType | ( | ) | const [inline, virtual] |
friend class CASConvert [friend] |
CASConvert has to be the friend because it modifies private attributes directly when doing conversions.
| void evaluate_operands | ( | Product * | ) | [friend] |
Friend for evaluating operands. It needs direct access to the operands vector.
| void expand_operands | ( | Product * | ) | [friend] |
Friend for expanding operands. It needs direct access to the operands vector.
| void resolve_parentheses | ( | CASObject * | o | ) | [friend] |
T. The parameter T is used to determine when to stop parenthese resolution, e.g. if T specifies a Sum, the resolution is stopped when another type as Sum is encountered.Resolving parentheses is done in the following manner:
It loops thru all operands of the CASObject and checks if they are of the same type as the object itself, if so, it appends their operands to the operands list of the object.
| o | Pointer to a CASObject of which the parentheses have to be resolved. |
Definition at line 86 of file castemplates.h.
1.4.7