35 # include <cppad/cppad.hpp> 37 typedef CppAD::vector<ADdouble>
ADvector;
212 virtual void getVariableIndexMap(std::map<int, int> *varIdx);
222 virtual double calculateFunction(
double *x) = 0;
231 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD) = 0;
242 OSnLNode* createExpressionTreeFromPrefix(std::vector<ExprNode*> nlNodeVec);
271 OSnLNode* createExpressionTreeFromPostfix(std::vector<ExprNode*> nlNodeVec);
295 virtual OSnLNode* copyNodeAndDescendants();
338 virtual double calculateFunction(
double *x);
388 virtual double calculateFunction(
double *x);
437 virtual double calculateFunction(
double *x);
486 virtual double calculateFunction(
double *x);
539 virtual double calculateFunction(
double *x);
589 virtual double calculateFunction(
double *x);
640 virtual double calculateFunction(
double *x);
690 virtual double calculateFunction(
double *x);
739 virtual double calculateFunction(
double *x);
788 virtual double calculateFunction(
double *x);
837 virtual double calculateFunction(
double *x);
886 virtual double calculateFunction(
double *x);
935 virtual double calculateFunction(
double *x);
985 virtual double calculateFunction(
double *x);
1035 virtual double calculateFunction(
double *x);
1047 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1085 virtual double calculateFunction(
double *x);
1091 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1135 virtual double calculateFunction(
double *x);
1147 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1185 virtual double calculateFunction(
double *x);
1197 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1235 virtual double calculateFunction(
double *x);
1247 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1308 virtual double calculateFunction(
double *x);
1320 virtual OSnLNode* copyNodeAndDescendants();
1326 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1384 virtual double calculateFunction(
double *x);
1397 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1450 virtual double calculateFunction(
double *x);
1463 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1500 virtual void getVariableIndexMap(std::map<int, int> *varIdx);
1521 virtual double calculateFunction(
double *x);
1533 virtual OSnLNode* copyNodeAndDescendants();
1539 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1583 virtual double calculateFunction(
double *x);
1595 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1635 virtual double calculateFunction(
double *x);
1641 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1686 virtual double calculateFunction(
double *x);
1692 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1736 virtual double calculateFunction(
double *x);
1742 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
1784 OSnLMNode* createExpressionTreeFromPrefix(std::vector<ExprNode*> nlNodeVec);
1813 OSnLMNode* createExpressionTreeFromPostfix(std::vector<ExprNode*> nlNodeVec);
1838 virtual OSnLMNode* copyNodeAndDescendants();
1925 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
2281 virtual OSnLMNode* copyNodeAndDescendants();
2335 virtual OSnLMNode* copyNodeAndDescendants();
2501 virtual double calculateFunction(
double *x);
2514 virtual OSnLMNode* copyNodeAndDescendants();
2521 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
2572 virtual double calculateFunction(
double *x);
2585 virtual OSnLMNode* copyNodeAndDescendants();
2592 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
2643 virtual double calculateFunction(
double *x);
2656 virtual OSnLMNode* copyNodeAndDescendants();
2663 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
2714 virtual double calculateFunction(
double *x);
2727 virtual OSnLMNode* copyNodeAndDescendants();
2734 virtual ADdouble constructADTape(std::map<int, int> *ADIdx,
ADvector *XAD);
virtual std::string getTokenName()=0
int idx
The index of the matrixCon.
The OSnLNodeDivide Class.
The OSnLNodeAllDiff Class.
bool includeDiagonal
A boolean to express whether the diagonal is to be part of the upper triangle or not.
The OSnLMNode Class for nonlinear expressions involving matrices.
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
virtual std::vector< ExprNode * > preOrderOSnLNodeTraversal(std::vector< ExprNode *> *prefixVector)
Called by getPrefixFromExpressionTree().
The OSnLNodeVariable Class.
virtual std::string getNonlinearExpressionInXML()
The following method writes an OSnLNode or OSnLMNode in OSiL format.
bool includeDiagonal
A boolean to express whether the diagonal is to be part of the upper triangle or not.
int idx
The index of the matrix.
virtual std::vector< ExprNode * > getPrefixFromExpressionTree()
Get a vector of pointers to OSnLNodes and OSnLMNodes that correspond to the (scalar-valued or matrix-...
The OSnLNodeMatrixTrace Class.
virtual ExprNode * cloneExprNode()=0
Create or clone a node of this type.
The OSnLMNodeMatrixProduct Class.
virtual std::vector< ExprNode * > getPostfixFromExpressionTree()
Get a vector of pointers to ExprNodes that correspond to the expression tree in postfix format...
double m_dFunctionValue
m_dFunctionValue holds the function value given the current variable values.
unsigned int inumberOfMatrixChildren
inumberOfMatrixChildren is the number of OSnLMNode child elements If this number is not fixed...
std::vector< ADdouble > ADvector
The OSnLNodeMatrixTrace Class.
int idx
The index of the matrixObj.
std::string type
in the C++ type is real
double coef
coef is an option coefficient on the variable, the default value is 1.0
The next few nodes evaluate to a scalar even though one or more of its arguments are matrices...
virtual bool IsEqual(ExprNode *that)
A function to check for the equality of two objects.
int idx
idx is the index of the variable
virtual std::string getTokenNumber()
The OSnLNodeNegate Class.
OSnLMNode ** m_mMatrixChildren
m_mMatrixChildren holds all the matrix-valued operands, if any.
std::string id
later, e.g.
The OSnLNodeNumber Class.
A generic class from which we derive both OSnLNode and OSnLMNode.
The OSnLNodeSquare Class.
ExprNode()
default constructor.
virtual ~ExprNode()
default destructor.
int idx
The index of the matrixVar.
int inodeInt
inodeInt is the unique integer assigned to the OSnLNode or OSnLMNode in OSParameters.h.
OSnLNode ** m_mChildren
m_mChildren holds all the operands, that is, nodes that the current node operates on...
a data structure to represent a matrix object (derived from MatrixType)
ADdouble m_ADTape
m_ADTape stores the expression tree for the this OSnLNode as an ADdouble.
The OSnLNodeProduct Class.
virtual std::vector< ExprNode * > postOrderOSnLNodeTraversal(std::vector< ExprNode *> *postfixVector)
Called by getPostfixFromExpressionTree().
double value
value is the value of the number
The OSnLNode Class for nonlinear expressions.
int inodeType
inodeType essentially tracks whether the number of children are known or not.