#include <sum.h>
Inheritance diagram for Sum:

Public Member Functions | |
| CASObject * | Absolute () const |
Returns the absolute representation of the Sum. | |
| void | AbsoluteIP () |
Makes the Sum absolute in-place. | |
| CASObject * | Add (const CASObject *addend) const |
Adds a CASObject to the Sum. | |
| CASObject * | Clone () const |
Clones the Sum. | |
| CASObject * | Collect () const |
Collects operands in the Sum. | |
| CASObject * | Divide (const CASObject *divisor) const |
Divides the Sum by a CASObject. | |
| CASObject * | Evaluate () const |
Evaluates the Sum. | |
| CASObject * | Expand () const |
Expands the Sum. | |
| CASObject * | GCD (const CASObject *o) const |
Calculates the gcd of the Sum and a CASObject. | |
| void | Get (char *s, unsigned long size) const |
Gets the string representation of the Sum. | |
| void | Get (std::string &s) const |
Gets the string representation of the Sum. | |
| CASType | GetType () const |
Returns the CASType of the Sum. | |
| CASObject * | Invert () const |
Returns the inverted representation of the Sum. | |
| void | InvertIP () |
Inverts the Sum in-place. | |
| bool | IsOne () const |
Indicates whether or not the Sum is one. | |
| bool | IsSimilar (const CASObject *o) const |
Indicates whether or not the Sum is similar to a CASObject. | |
| bool | IsZero () const |
Indicates whether or not the Sum 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 Sum by a CASObject. | |
| const Sum & | operator= (const Sum &s) |
| Assignment operator. | |
| void | Print () const |
| Prints the string representation to stdout. | |
| void | RemoveNoOpElements () |
Remove operands having no effect on the Sum. | |
| CASObject * | Subtract (const CASObject *subtrahend) const |
Subtracts a CASObject from the Sum. | |
| Sum (const Sum &s) | |
| Copy constructor. | |
| Sum () | |
| Constructor. | |
| ~Sum () | |
| Destructor. | |
Private Member Functions | |
| CASObject * | CollectEqualOperands () const |
| Collects operands of the same value and type. | |
| CASObject * | CollectNonSingleValues () const |
| Collects in non-single values. | |
| CASObject * | CollectSingleValues () const |
| Collects in single values. | |
| Sum * | WithExponentOne () const |
Returns the Sum with an exponent of one. | |
Friends | |
| class | CASConvert |
Friend for converting to this CASType. | |
| void | evaluate_operands (Sum *) |
| Friend for evaluating operands. | |
| void | expand_operands (Sum *) |
| 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 sum.h.
| CASType Sum::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 | ( | Sum * | ) | [friend] |
Friend for evaluating operands. It needs direct access to the operands vector.
| void expand_operands | ( | Sum * | ) | [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