A generic class from which we derive both OSnLNode and OSnLMNode. More...
#include <OSnLNode.h>
Public Member Functions | |
ExprNode () | |
default constructor. More... | |
virtual | ~ExprNode () |
default destructor. More... | |
virtual std::string | getTokenNumber () |
virtual std::string | getTokenName ()=0 |
virtual std::string | getNonlinearExpressionInXML () |
The following method writes an OSnLNode or OSnLMNode in OSiL format. More... | |
virtual std::vector< ExprNode * > | getPrefixFromExpressionTree () |
Get a vector of pointers to OSnLNodes and OSnLMNodes that correspond to the (scalar-valued or matrix-valued) expression tree in prefix format. More... | |
virtual std::vector< ExprNode * > | preOrderOSnLNodeTraversal (std::vector< ExprNode * > *prefixVector) |
Called by getPrefixFromExpressionTree(). More... | |
virtual std::vector< ExprNode * > | getPostfixFromExpressionTree () |
Get a vector of pointers to ExprNodes that correspond to the expression tree in postfix format. More... | |
virtual std::vector< ExprNode * > | postOrderOSnLNodeTraversal (std::vector< ExprNode * > *postfixVector) |
Called by getPostfixFromExpressionTree(). More... | |
virtual ExprNode * | cloneExprNode ()=0 |
Create or clone a node of this type. More... | |
virtual bool | IsEqual (ExprNode *that) |
A function to check for the equality of two objects. More... | |
Public Attributes | |
int | inodeInt |
inodeInt is the unique integer assigned to the OSnLNode or OSnLMNode in OSParameters.h. More... | |
int | inodeType |
inodeType essentially tracks whether the number of children are known or not. More... | |
unsigned int | inumberOfChildren |
inumberOfChildren is the number of OSnLNode child elements If this number is not fixed, e.g., for a sum node, it is temporarily set to 0 More... | |
unsigned int | inumberOfMatrixChildren |
inumberOfMatrixChildren is the number of OSnLMNode child elements If this number is not fixed, e.g., for a matrixProduct node, it is temporarily set to 0 More... | |
OSnLNode ** | m_mChildren |
m_mChildren holds all the operands, that is, nodes that the current node operates on. More... | |
OSnLMNode ** | m_mMatrixChildren |
m_mMatrixChildren holds all the matrix-valued operands, if any. More... | |
A generic class from which we derive both OSnLNode and OSnLMNode.
Definition at line 56 of file OSnLNode.h.
ExprNode::ExprNode | ( | ) |
default constructor.
Definition at line 154 of file OSnLNode.cpp.
|
virtual |
default destructor.
Definition at line 167 of file OSnLNode.cpp.
|
virtual |
Reimplemented in OSnLMNodeMatrixCon, OSnLMNodeMatrixObj, OSnLMNodeMatrixVar, OSnLMNodeMatrixReference, OSnLNodeVariable, OSnLNodePI, OSnLNodeE, and OSnLNodeNumber.
Definition at line 208 of file OSnLNode.cpp.
|
pure virtual |
Implemented in OSnLMNodeMatrixProduct, OSnLMNodeMatrixCon, OSnLMNodeMatrixObj, OSnLMNodeMatrixVar, OSnLMNodeMatrixReference, OSnLMNodeMatrixSubmatrixAt, OSnLMNodeDiagonalMatrixFromVector, OSnLMNodeMatrixDiagonal, OSnLMNodeMatrixUpperTriangle, OSnLMNodeMatrixLowerTriangle, OSnLMNodeIdentityMatrix, OSnLMNodeMatrixDotTimes, OSnLMNodeMatrixScalarTimes, OSnLMNodeMatrixTranspose, OSnLMNodeMatrixInverse, OSnLMNodeMatrixTimes, OSnLMNodeMatrixNegate, OSnLMNodeMatrixMinus, OSnLMNodeMatrixSum, OSnLMNodeMatrixPlus, OSnLNodeMatrixToScalar, OSnLNodeMatrixTrace, OSnLNodeMatrixDeterminant, OSnLNodeAllDiff, OSnLNodeVariable, OSnLNodePI, OSnLNodeE, OSnLNodeNumber, OSnLNodeIf, OSnLNodeErf, OSnLNodeAbs, OSnLNodeExp, OSnLNodeSin, OSnLNodeCos, OSnLNodeSquare, OSnLNodeSqrt, OSnLNodeLn, OSnLNodeProduct, OSnLNodePower, OSnLNodeDivide, OSnLNodeTimes, OSnLNodeNegate, OSnLNodeMinus, OSnLNodeMin, OSnLNodeMax, OSnLNodeSum, and OSnLNodePlus.
|
virtual |
The following method writes an OSnLNode or OSnLMNode in OSiL format.
It is used by OSiLWriter to assist in writing an OSiL file from a corresponding OSInstance.
Reimplemented in OSnLMNodeMatrixCon, OSnLMNodeMatrixObj, OSnLMNodeMatrixVar, OSnLMNodeMatrixReference, OSnLMNodeMatrixUpperTriangle, OSnLMNodeMatrixLowerTriangle, OSnLNodeVariable, OSnLNodePI, OSnLNodeE, and OSnLNodeNumber.
Definition at line 221 of file OSnLNode.cpp.
|
virtual |
Get a vector of pointers to OSnLNodes and OSnLMNodes that correspond to the (scalar-valued or matrix-valued) expression tree in prefix format.
Reimplemented in OSnLMNode, and OSnLNode.
Definition at line 259 of file OSnLNode.cpp.
|
virtual |
Called by getPrefixFromExpressionTree().
This method calls itself recursively and generates a vector of pointers to ExprNode in prefix
a | pointer prefixVector to a vector of pointers of ExprNodes |
Reimplemented in OSnLMNode, and OSnLNode.
Definition at line 266 of file OSnLNode.cpp.
|
virtual |
Get a vector of pointers to ExprNodes that correspond to the expression tree in postfix format.
Reimplemented in OSnLMNode, and OSnLNode.
Definition at line 282 of file OSnLNode.cpp.
|
virtual |
Called by getPostfixFromExpressionTree().
This method calls itself recursively and generates a vector of pointers to ExprNodes in postfix.
a | pointer postfixVector to a vector of pointers of ExprNodes |
Reimplemented in OSnLMNode, and OSnLNode.
Definition at line 289 of file OSnLNode.cpp.
|
pure virtual |
Create or clone a node of this type.
This is an abstract method which is required to be implemented by the concrete operator nodes that derive or extend from this class.
Implemented in OSnLMNodeMatrixProduct, OSnLMNodeMatrixCon, OSnLMNodeMatrixObj, OSnLMNodeMatrixVar, OSnLMNodeMatrixReference, OSnLMNodeMatrixSubmatrixAt, OSnLMNodeDiagonalMatrixFromVector, OSnLMNodeMatrixDiagonal, OSnLMNodeMatrixUpperTriangle, OSnLMNodeMatrixLowerTriangle, OSnLMNodeIdentityMatrix, OSnLMNodeMatrixDotTimes, OSnLMNodeMatrixScalarTimes, OSnLMNodeMatrixTranspose, OSnLMNodeMatrixInverse, OSnLMNodeMatrixTimes, OSnLMNodeMatrixNegate, OSnLMNodeMatrixMinus, OSnLMNodeMatrixSum, OSnLMNodeMatrixPlus, OSnLNodeMatrixToScalar, OSnLNodeMatrixTrace, OSnLNodeMatrixDeterminant, OSnLNodeAllDiff, OSnLNodeVariable, OSnLNodePI, OSnLNodeE, OSnLNodeNumber, OSnLNodeIf, OSnLNodeErf, OSnLNodeAbs, OSnLNodeExp, OSnLNodeSin, OSnLNodeCos, OSnLNodeSquare, OSnLNodeSqrt, OSnLNodeLn, OSnLNodeProduct, OSnLNodePower, OSnLNodeDivide, OSnLNodeTimes, OSnLNodeNegate, OSnLNodeMinus, OSnLNodeMin, OSnLNodeMax, OSnLNodeSum, and OSnLNodePlus.
|
virtual |
A function to check for the equality of two objects.
Definition at line 308 of file OSnLNode.cpp.
int ExprNode::inodeInt |
inodeInt is the unique integer assigned to the OSnLNode or OSnLMNode in OSParameters.h.
Definition at line 62 of file OSnLNode.h.
int ExprNode::inodeType |
inodeType essentially tracks whether the number of children are known or not.
For most nodes this is known, in which case inodeType is set to inumberOfChildren. For some nodes the number of children is not known a priori, e.g., a sum node, then inodeType is set to -1.
Definition at line 69 of file OSnLNode.h.
unsigned int ExprNode::inumberOfChildren |
inumberOfChildren is the number of OSnLNode child elements If this number is not fixed, e.g., for a sum node, it is temporarily set to 0
Definition at line 74 of file OSnLNode.h.
unsigned int ExprNode::inumberOfMatrixChildren |
inumberOfMatrixChildren is the number of OSnLMNode child elements If this number is not fixed, e.g., for a matrixProduct node, it is temporarily set to 0
Definition at line 79 of file OSnLNode.h.
OSnLNode** ExprNode::m_mChildren |
m_mChildren holds all the operands, that is, nodes that the current node operates on.
Definition at line 84 of file OSnLNode.h.
OSnLMNode** ExprNode::m_mMatrixChildren |
m_mMatrixChildren holds all the matrix-valued operands, if any.
Definition at line 89 of file OSnLNode.h.