Basic Polynomial Algebra Subprograms (BPAS)
v. 1.791
|
An ExpressionTree encompasses various forms of data that can be expressed generically as a binary tree with data elements connected by operators. More...
#include <ExpressionTree.hpp>
Public Member Functions | |
ExpressionTree () | |
Construct the default, empty tree. | |
ExpressionTree (ExprTreeNode *theRoot) | |
Construct a tree given the root node. | |
ExpressionTree (const ExpressionTree &otherTree) | |
Copy constructor. | |
ExpressionTree (const std::vector< ExpressionTree > &trees) | |
Construct a stree from a vector of trees as an array of trees. | |
~ExpressionTree () | |
Destructor. | |
ExpressionTree & | operator= (const ExpressionTree &otherTree) |
Copy assignment. | |
ExpressionTree | operator+ (const ExpressionTree &rightTree) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with addition. More... | |
ExpressionTree & | operator+= (const ExpressionTree &rightTree) |
Add the input rightTree to the right side of *this, adjoining the two trees with addition. More... | |
ExpressionTree | operator- (const ExpressionTree &rightTree) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with subtraction. More... | |
ExpressionTree & | operator-= (const ExpressionTree &rightTree) |
Add the input rightTree to the right side of *this, adjoining the two trees with subtraction. More... | |
ExpressionTree | operator* (const ExpressionTree &rightTree) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with multiplication. More... | |
ExpressionTree & | operator*= (const ExpressionTree &rightTree) |
Add the input rightTree to the right side of *this, adjoining the two trees with multiplication. More... | |
ExpressionTree | operator/ (const ExpressionTree &rightTree) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with divison. More... | |
ExpressionTree & | operator/= (const ExpressionTree &rightTree) |
Add the input rightTree to the right side of *this, adjoining the two trees with division. More... | |
ExpressionTree | operator^ (const ExpressionTree &rightTree) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with divison. More... | |
ExpressionTree & | operator^= (const ExpressionTree &rightTree) |
Add the input rightTree to the right side of *this, adjoining the two trees with division. More... | |
std::string | toString () const |
Convert *this to a generic string representation. | |
std::string | toMapleString () const |
Convert *this to a string in the format expected of a maple expression. More... | |
std::string | toLaTeXString () const |
Convert *this to a string in the format expected of LaTeX. More... | |
template<class ExpTreeConvert > | |
void | fromVector (const std::vector< ExpTreeConvert > &ringVec) |
Fill this expression tree with the vector of BPASRing elements specified. More... | |
Static Public Member Functions | |
static ExpressionTree | combineExpressionTrees (const ExpressionTree &left, const ExpressionTree &right, ExprTreeType type, ExprTreeVal *val=NULL) |
Combine two expression trees using the supplied type and value as their common parent. More... | |
An ExpressionTree encompasses various forms of data that can be expressed generically as a binary tree with data elements connected by operators.
Provides functions for converting this generic datatype into various external formats. For example, maple expression strings or latex mathmode strings.
|
static |
Combine two expression trees using the supplied type and value as their common parent.
This method will create copies of the input trees to use.
returns the adjoined ExpressionTree.
|
inline |
ExpressionTree ExpressionTree::operator* | ( | const ExpressionTree & | rightTree | ) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with multiplication.
returns the new tree.
ExpressionTree& ExpressionTree::operator*= | ( | const ExpressionTree & | rightTree | ) |
Add the input rightTree to the right side of *this, adjoining the two trees with multiplication.
returns a reference to *this, the updated tree.
ExpressionTree ExpressionTree::operator+ | ( | const ExpressionTree & | rightTree | ) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with addition.
returns the new tree.
ExpressionTree& ExpressionTree::operator+= | ( | const ExpressionTree & | rightTree | ) |
Add the input rightTree to the right side of *this, adjoining the two trees with addition.
returns a reference to *this, the updated tree.
ExpressionTree ExpressionTree::operator- | ( | const ExpressionTree & | rightTree | ) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with subtraction.
returns the new tree.
ExpressionTree& ExpressionTree::operator-= | ( | const ExpressionTree & | rightTree | ) |
Add the input rightTree to the right side of *this, adjoining the two trees with subtraction.
returns a reference to *this, the updated tree.
ExpressionTree ExpressionTree::operator/ | ( | const ExpressionTree & | rightTree | ) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with divison.
returns the new tree.
ExpressionTree& ExpressionTree::operator/= | ( | const ExpressionTree & | rightTree | ) |
Add the input rightTree to the right side of *this, adjoining the two trees with division.
returns a reference to *this, the updated tree.
ExpressionTree ExpressionTree::operator^ | ( | const ExpressionTree & | rightTree | ) |
Combine *this and the input rightTree into a new expression tree adjoining the two trees with divison.
returns the new tree.
ExpressionTree& ExpressionTree::operator^= | ( | const ExpressionTree & | rightTree | ) |
Add the input rightTree to the right side of *this, adjoining the two trees with division.
returns a reference to *this, the updated tree.
std::string ExpressionTree::toLaTeXString | ( | ) | const |
Convert *this to a string in the format expected of LaTeX.
returns a string in latex format.
std::string ExpressionTree::toMapleString | ( | ) | const |
Convert *this to a string in the format expected of a maple expression.
returns a string in maple format