My Project
OSnLNode.h
Go to the documentation of this file.
1/* $Id$ */
24#ifndef OSNLNODE_H
25#define OSNLNODE_H
26
27#include "OSConfig.h"
28#include "OSGeneral.h"
29#include "OSErrorClass.h"
30#include <iostream>
31#include <vector>
32#include <map>
33
34#ifdef OS_HAS_CPPAD
35# include <cppad/cppad.hpp>
36typedef CppAD::AD<double> ADdouble;
37typedef CppAD::vector<ADdouble> ADvector;
38#else
39typedef double ADdouble;
40typedef std::vector<ADdouble> ADvector;
41#endif
42
46class OSnLNode;
47class OSnLMNode;
48class OSMatrix;
49
57{
58public:
59
63
70
74 unsigned int inumberOfChildren;
75
80
85
90
91
95 ExprNode();
96
100 virtual ~ExprNode();
101
102
106 virtual std::string getTokenNumber();
107
111 virtual std::string getTokenName() = 0;
112
120 virtual std::string getNonlinearExpressionInXML();
121
128 virtual std::vector<ExprNode*> getPrefixFromExpressionTree();
129
138 virtual std::vector<ExprNode*> preOrderOSnLNodeTraversal( std::vector<ExprNode*> *prefixVector);
139
146 virtual std::vector<ExprNode*> getPostfixFromExpressionTree();
147
156 virtual std::vector<ExprNode*> postOrderOSnLNodeTraversal( std::vector<ExprNode*> *postfixVector);
157
163 virtual ExprNode *cloneExprNode() = 0;
164
168 virtual bool IsEqual(ExprNode *that);
169};//end ExprNode
170
171
179class OSnLNode: public ExprNode
180{
181public:
186
191
192
196 OSnLNode();
197
201 virtual ~OSnLNode();
202
203
212 virtual void getVariableIndexMap(std::map<int, int> *varIdx);
213
222 virtual double calculateFunction(double *x) = 0;
223
231 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD) = 0;
232
242 OSnLNode* createExpressionTreeFromPrefix(std::vector<ExprNode*> nlNodeVec);
243
250 virtual std::vector<ExprNode*> getPrefixFromExpressionTree();
251
260 virtual std::vector<ExprNode*> preOrderOSnLNodeTraversal( std::vector<ExprNode*> *prefixVector);
261
271 OSnLNode* createExpressionTreeFromPostfix(std::vector<ExprNode*> nlNodeVec);
272
279 virtual std::vector<ExprNode*> getPostfixFromExpressionTree();
280
289 virtual std::vector<ExprNode*> postOrderOSnLNodeTraversal( std::vector<ExprNode*> *postfixVector);
290
296
300 bool IsEqual(OSnLNode *that);
301};//end OSnLNode
302
303
315class OSnLNodePlus : public OSnLNode
316{
317public:
321 OSnLNodePlus();
322
327
332 virtual std::string getTokenName();
333
338 virtual double calculateFunction( double *x);
339
344 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
345
350 virtual OSnLNode *cloneExprNode();
351
352};//end OSnLNodePlus
353
365class OSnLNodeSum : public OSnLNode
366{
367public:
371 OSnLNodeSum();
372
376 ~OSnLNodeSum();
377
382 virtual std::string getTokenName();
383
388 virtual double calculateFunction( double *x);
389
394 virtual OSnLNode *cloneExprNode();
395
400 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
401};//end OSnLNodeSum
402
414class OSnLNodeMax : public OSnLNode
415{
416public:
420 OSnLNodeMax();
421
425 ~OSnLNodeMax();
426
431 virtual std::string getTokenName();
432
437 virtual double calculateFunction( double *x);
438
443 virtual OSnLNode *cloneExprNode();
444
449 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
450};//end OSnLNodeMax
451
463class OSnLNodeMin : public OSnLNode
464{
465public:
469 OSnLNodeMin();
470
474 ~OSnLNodeMin();
475
480 virtual std::string getTokenName();
481
486 virtual double calculateFunction( double *x);
487
493 virtual OSnLNode *cloneExprNode();
494
499 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
500
501};//end OSnLNodeMin
502
503
516{
517public:
522
527
528
533 virtual std::string getTokenName();
534
539 virtual double calculateFunction( double *x);
540
545 virtual OSnLNode *cloneExprNode();
546
551 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
552};//end OSnLNodeMinus
553
554
567{
568public:
573
578
583 virtual std::string getTokenName();
584
589 virtual double calculateFunction( double *x);
590
595 virtual OSnLNode *cloneExprNode();
596
597
602 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
603};//end OSnLNodeNegate
604
605
618{
619public:
624
629
634 virtual std::string getTokenName();
635
640 virtual double calculateFunction( double *x);
641
646 virtual OSnLNode *cloneExprNode();
647
652 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
653
654};//end OSnLNodeTimes
655
656
669{
670public:
675
680
684 virtual std::string getTokenName();
685
690 virtual double calculateFunction( double *x);
691
696 virtual OSnLNode *cloneExprNode();
697
702 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
703};//end OSnLNodeDivide
704
705
718{
719public:
724
729
733 virtual std::string getTokenName();
734
739 virtual double calculateFunction( double *x);
740
745 virtual OSnLNode *cloneExprNode();
746
751 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
752};//end OSnLNodePower
753
754
767{
768public:
773
778
782 virtual std::string getTokenName();
783
788 virtual double calculateFunction( double *x);
789
794 virtual OSnLNode *cloneExprNode();
795
800 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
801};//end OSnLNodeProduct
802
803
815class OSnLNodeLn : public OSnLNode
816{
817public:
821 OSnLNodeLn();
822
826 ~OSnLNodeLn();
827
831 virtual std::string getTokenName();
832
837 virtual double calculateFunction( double *x);
838
843 virtual OSnLNode *cloneExprNode();
844
849 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
850};//end OSnLNodeLn
851
852
864class OSnLNodeSqrt : public OSnLNode
865{
866public:
870 OSnLNodeSqrt();
871
876
880 virtual std::string getTokenName();
881
886 virtual double calculateFunction( double *x);
887
892 virtual OSnLNode *cloneExprNode();
897 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
898};//end OSnLNodeSqrt
899
900
913{
914public:
919
924
929 virtual std::string getTokenName();
930
935 virtual double calculateFunction( double *x);
936
941 virtual OSnLNode *cloneExprNode();
942
947 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
948};//end OSnLNodeSquare
949
950
962class OSnLNodeCos : public OSnLNode
963{
964public:
968 OSnLNodeCos();
969
973 ~OSnLNodeCos();
974
979 virtual std::string getTokenName();
980
985 virtual double calculateFunction( double *x);
986
991 virtual OSnLNode *cloneExprNode();
992
997 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
998};//end OSnLNodeCos
999
1000
1012class OSnLNodeSin : public OSnLNode
1013{
1014public:
1018 OSnLNodeSin();
1019
1023 ~OSnLNodeSin();
1024
1029 virtual std::string getTokenName();
1030
1035 virtual double calculateFunction( double *x);
1036
1041 virtual OSnLNode *cloneExprNode();
1042
1047 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1048};//end OSnLNodeSin
1049
1050
1062class OSnLNodeExp : public OSnLNode
1063{
1064public:
1068 OSnLNodeExp();
1069
1073 ~OSnLNodeExp();
1074
1079 virtual std::string getTokenName();
1080
1085 virtual double calculateFunction( double *x);
1086
1091 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1092
1097 virtual OSnLNode *cloneExprNode();
1098};//end OSnLNodeExp
1099
1100
1112class OSnLNodeAbs : public OSnLNode
1113{
1114public:
1118 OSnLNodeAbs();
1119
1123 ~OSnLNodeAbs();
1124
1129 virtual std::string getTokenName();
1130
1135 virtual double calculateFunction( double *x);
1136
1141 virtual OSnLNode *cloneExprNode();
1142
1147 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1148};//end OSnLNodeAbs
1149
1150
1162class OSnLNodeErf : public OSnLNode
1163{
1164public:
1168 OSnLNodeErf();
1169
1173 ~OSnLNodeErf();
1174
1179 virtual std::string getTokenName();
1180
1185 virtual double calculateFunction( double *x);
1186
1191 virtual OSnLNode *cloneExprNode();
1192
1197 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1198};//end OSnLNodeErf
1199
1200
1212class OSnLNodeIf : public OSnLNode
1213{
1214public:
1218 OSnLNodeIf();
1219
1223 ~OSnLNodeIf();
1224
1229 virtual std::string getTokenName();
1230
1235 virtual double calculateFunction( double *x);
1236
1241 virtual OSnLNode *cloneExprNode();
1242
1247 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1248};//end OSnLNodeIf
1249
1250
1263{
1264public:
1266 double value;
1267
1269 std::string type;
1270
1274 std::string id;
1275
1280
1285
1290 virtual std::string getTokenName();
1291
1296 virtual std::string getTokenNumber();
1297
1302 virtual std::string getNonlinearExpressionInXML();
1303
1308 virtual double calculateFunction( double *x);
1309
1314 virtual OSnLNode *cloneExprNode();
1315
1321
1326 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1327
1331 virtual bool IsEqual(OSnLNodeNumber *that);
1332};//end OSnLNodeNumber
1333
1334
1346class OSnLNodeE : public OSnLNode
1347{
1348public:
1349
1353 OSnLNodeE();
1354
1358 ~OSnLNodeE();
1359
1360
1365 virtual std::string getTokenNumber();
1366
1367
1372 virtual std::string getTokenName();
1373
1378 virtual std::string getNonlinearExpressionInXML();
1379
1384 virtual double calculateFunction( double *x);
1385
1390 virtual OSnLNode *cloneExprNode();
1391
1392
1397 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1398};//end OSnLNodeE
1399
1400
1412class OSnLNodePI : public OSnLNode
1413{
1414public:
1415
1419 OSnLNodePI();
1420
1424 ~OSnLNodePI();
1425
1426
1431 virtual std::string getTokenNumber();
1432
1433
1438 virtual std::string getTokenName();
1439
1444 virtual std::string getNonlinearExpressionInXML();
1445
1450 virtual double calculateFunction( double *x);
1451
1456 virtual OSnLNode *cloneExprNode();
1457
1458
1463 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1464};//end OSnLNodePI
1465
1466
1479{
1480public:
1481
1485 double coef;
1486
1488 int idx;
1489
1494
1499
1500 virtual void getVariableIndexMap(std::map<int, int> *varIdx);
1501
1505 virtual std::string getTokenNumber();
1506
1510 virtual std::string getTokenName();
1511
1515 virtual std::string getNonlinearExpressionInXML();
1516
1521 virtual double calculateFunction( double *x);
1522
1527 virtual OSnLNode *cloneExprNode();
1528
1534
1539 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1540
1544 virtual bool IsEqual(OSnLNodeVariable *that);
1545};//end OSnLNodeVariable
1546
1547
1561{
1562public:
1567
1572
1577 virtual std::string getTokenName();
1578
1583 virtual double calculateFunction( double *x);
1584
1589 virtual OSnLNode *cloneExprNode();
1590
1595 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1596};//end OSnLNodeAllDiff
1597
1598
1613{
1614public:
1619
1624
1629 virtual std::string getTokenName();
1630
1635 virtual double calculateFunction( double *x);
1636
1641 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1642
1647 virtual OSnLNode *cloneExprNode();
1648
1649};//end OSnLNodeMatrixDeterminant
1650
1663{
1664public:
1669
1675
1680 virtual std::string getTokenName();
1681
1686 virtual double calculateFunction( double *x);
1687
1692 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1693
1698 virtual OSnLNode *cloneExprNode();
1699};//end OSnLNodeMatrixToScalar
1700
1713{
1714public:
1719
1725
1730 virtual std::string getTokenName();
1731
1736 virtual double calculateFunction( double *x);
1737
1742 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1743
1748 virtual OSnLNode *cloneExprNode();
1749};//end OSnLNodeMatrixToScalar
1750
1751
1760class OSnLMNode: public ExprNode
1761{
1762public:
1763
1767 OSnLMNode();
1768
1772 virtual ~OSnLMNode();
1773
1774
1784 OSnLMNode* createExpressionTreeFromPrefix(std::vector<ExprNode*> nlNodeVec);
1785
1792 std::vector<ExprNode*> getPrefixFromExpressionTree();
1793
1802 std::vector<ExprNode*> preOrderOSnLNodeTraversal( std::vector<ExprNode*> *prefixVector);
1803
1813 OSnLMNode* createExpressionTreeFromPostfix(std::vector<ExprNode*> nlNodeVec);
1814
1821 std::vector<ExprNode*> getPostfixFromExpressionTree();
1822
1831 std::vector<ExprNode*> postOrderOSnLNodeTraversal( std::vector<ExprNode*> *postfixVector);
1832
1833
1839
1843 bool IsEqual(OSnLMNode *that);
1844};//end OSnLMNode
1845
1847{
1848public:
1853
1858
1863 virtual std::string getTokenName();
1864
1869// virtual std::string getTokenNumber();
1870
1875// virtual std::string getNonlinearExpressionInXML();
1876
1881 virtual OSnLMNode *cloneExprNode();
1882};//end OSnLMNodeMatrixPlus
1883
1885{
1886public:
1891
1896
1901 virtual std::string getTokenName();
1902
1907// virtual std::string getTokenNumber();
1908
1913// virtual std::string getNonlinearExpressionInXML();
1918 virtual OSnLMNode *cloneExprNode();
1919
1920#if 0
1925 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1926#endif
1927
1928};//end OSnLMNodeMatrixPlus
1929
1931{
1932public:
1937
1942
1947 virtual std::string getTokenName();
1948
1953// virtual std::string getTokenNumber();
1954
1959// virtual std::string getNonlinearExpressionInXML();
1960
1965 virtual OSnLMNode *cloneExprNode();
1966};//end OSnLMNodeMatrixMinus
1967
1969{
1970public:
1975
1980
1985 virtual std::string getTokenName();
1986
1991// virtual std::string getTokenNumber();
1992
1997// virtual std::string getNonlinearExpressionInXML();
1998
1999
2004 virtual OSnLMNode *cloneExprNode();
2005};//end OSnLMNodeMatrixNegate
2006
2008{
2009public:
2014
2019
2024 virtual std::string getTokenName();
2025
2030// virtual std::string getTokenNumber();
2031
2036// virtual std::string getNonlinearExpressionInXML();
2037
2042 virtual OSnLMNode *cloneExprNode();
2043};//end OSnLMNodeMatrixTimes
2044
2046{
2047public:
2052
2057
2062 virtual std::string getTokenName();
2063
2068// virtual std::string getTokenNumber();
2069
2074// virtual std::string getNonlinearExpressionInXML();
2075
2080 virtual OSnLMNode *cloneExprNode();
2081};//end OSnLMNodeMatrixInverse
2082
2084{
2085public:
2090
2095
2100 virtual std::string getTokenName();
2101
2106// virtual std::string getTokenNumber();
2107
2112// virtual std::string getNonlinearExpressionInXML();
2113
2118 virtual OSnLMNode *cloneExprNode();
2119};//end OSnLMNodeMatrixTranspose
2120
2122{
2123public:
2128
2133
2138 virtual std::string getTokenName();
2139
2144// virtual std::string getTokenNumber();
2145
2150// virtual std::string getNonlinearExpressionInXML();
2151
2156 virtual OSnLMNode *cloneExprNode();
2157};//end OSnLMNodeMatrixScalarTimes
2158
2160{
2161public:
2166
2171
2176 virtual std::string getTokenName();
2177
2182// virtual std::string getTokenNumber();
2183
2188// virtual std::string getNonlinearExpressionInXML();
2189
2194 virtual OSnLMNode *cloneExprNode();
2195};//end OSnLMNodeMatrixDotTimes
2196
2198{
2199public:
2204
2209
2214 virtual std::string getTokenName();
2215
2220// virtual std::string getTokenNumber();
2221
2226// virtual std::string getNonlinearExpressionInXML();
2227
2232 virtual OSnLMNode *cloneExprNode();
2233};//end OSnLMNodeIdentityMatrix
2234
2236{
2237public:
2242
2247
2252
2257 virtual std::string getTokenName();
2258
2263// virtual std::string getTokenNumber();
2264
2269 virtual std::string getNonlinearExpressionInXML();
2270
2275 virtual OSnLMNode *cloneExprNode();
2276
2282
2286 virtual bool IsEqual(OSnLMNodeMatrixLowerTriangle *that);
2287};//end OSnLMNodeMatrixLowerTriangle
2288
2290{
2291public:
2296
2301
2306
2311 virtual std::string getTokenName();
2312
2317// virtual std::string getTokenNumber();
2318
2323 virtual std::string getNonlinearExpressionInXML();
2324
2329 virtual OSnLMNode *cloneExprNode();
2330
2336
2340 virtual bool IsEqual(OSnLMNodeMatrixUpperTriangle *that);
2341};//end OSnLMNodeMatrixUpperTriangle
2342
2343
2345{
2346public:
2351
2356
2361 virtual std::string getTokenName();
2362
2367// virtual std::string getTokenNumber();
2368
2373// virtual std::string getNonlinearExpressionInXML();
2374
2379 virtual OSnLMNode *cloneExprNode();
2380};//end OSnLMNodeMatrixDiagonal
2381
2383{
2384public:
2389
2394
2399 virtual std::string getTokenName();
2400
2405// virtual std::string getTokenNumber();
2406
2411// virtual std::string getNonlinearExpressionInXML();
2412
2417 virtual OSnLMNode *cloneExprNode();
2418};//end OSnLMNodeDiagonalMatrixFromVector
2419
2420
2422{
2423public:
2428
2433
2438 virtual std::string getTokenName();
2439
2444// virtual std::string getTokenNumber();
2445
2450// virtual std::string getNonlinearExpressionInXML();
2451
2456 virtual OSnLMNode *cloneExprNode();
2457};//end OSnLMNodeMatrixSubmatrixAt
2458
2459
2461{
2462public:
2466 int idx;
2467
2472
2477
2482 virtual std::string getTokenName();
2483
2488 virtual std::string getTokenNumber();
2489
2494 virtual std::string getNonlinearExpressionInXML();
2495
2496#if 0
2501 virtual double calculateFunction( double *x);
2502#endif
2503
2508 virtual OSnLMNode *cloneExprNode();
2509
2515
2516#if 0
2521 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
2522#endif
2523
2527 virtual bool IsEqual(OSnLMNodeMatrixReference *that);
2528};//end OSnLMNodeMatrixReference
2529
2530
2532{
2533public:
2537 int idx;
2538
2543
2548
2553 virtual std::string getTokenName();
2554
2559 virtual std::string getTokenNumber();
2560
2565 virtual std::string getNonlinearExpressionInXML();
2566
2567#if 0
2572 virtual double calculateFunction( double *x);
2573#endif
2574
2579 virtual OSnLMNode *cloneExprNode();
2580
2586
2587#if 0
2592 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
2593#endif
2594
2598 virtual bool IsEqual(OSnLMNodeMatrixVar *that);
2599};//end OSnLMNodeMatrixVar
2600
2601
2603{
2604public:
2608 int idx;
2609
2614
2619
2624 virtual std::string getTokenName();
2625
2630 virtual std::string getTokenNumber();
2631
2636 virtual std::string getNonlinearExpressionInXML();
2637
2638#if 0
2643 virtual double calculateFunction( double *x);
2644#endif
2645
2650 virtual OSnLMNode *cloneExprNode();
2651
2657
2658#if 0
2663 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
2664#endif
2665
2669 virtual bool IsEqual(OSnLMNodeMatrixObj *that);
2670};//end OSnLMNodeMatrixObj
2671
2672
2674{
2675public:
2679 int idx;
2680
2685
2690
2695 virtual std::string getTokenName();
2696
2701 virtual std::string getTokenNumber();
2702
2707 virtual std::string getNonlinearExpressionInXML();
2708
2709#if 0
2714 virtual double calculateFunction( double *x);
2715#endif
2716
2721 virtual OSnLMNode *cloneExprNode();
2722
2728
2729#if 0
2734 virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
2735#endif
2736
2740 virtual bool IsEqual(OSnLMNodeMatrixCon *that);
2741};//end OSnLMNodeMatrixCon
2742
2743
2756{
2757public:
2762
2767
2771 virtual std::string getTokenName();
2772
2777 //virtual double calculateFunction( double *x);
2778
2783 virtual OSnLMNode *cloneExprNode();
2784
2790 //virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
2791};//end OSnLNodeProduct
2792
2793
2794
2795/*
2796TO DO:
2797
27981. Allow for a variable node with a child
2799
28002. When we create the Expression Tree from postfix, do we check if the coefficient of a variable is 1?
2801*/
2802#endif
2803
2804
std::vector< ADdouble > ADvector
Definition OSnLNode.h:40
double ADdouble
Definition OSnLNode.h:39
A generic class from which we derive both OSnLNode and OSnLMNode.
Definition OSnLNode.h:57
virtual std::vector< ExprNode * > getPrefixFromExpressionTree()
Get a vector of pointers to OSnLNodes and OSnLMNodes that correspond to the (scalar-valued or matrix-...
Definition OSnLNode.cpp:259
OSnLNode ** m_mChildren
m_mChildren holds all the operands, that is, nodes that the current node operates on.
Definition OSnLNode.h:84
int inodeType
inodeType essentially tracks whether the number of children are known or not.
Definition OSnLNode.h:69
int inodeInt
inodeInt is the unique integer assigned to the OSnLNode or OSnLMNode in OSParameters....
Definition OSnLNode.h:62
virtual std::vector< ExprNode * > getPostfixFromExpressionTree()
Get a vector of pointers to ExprNodes that correspond to the expression tree in postfix format.
Definition OSnLNode.cpp:282
virtual bool IsEqual(ExprNode *that)
A function to check for the equality of two objects.
Definition OSnLNode.cpp:308
virtual ~ExprNode()
default destructor.
Definition OSnLNode.cpp:167
virtual std::string getTokenNumber()
Definition OSnLNode.cpp:208
ExprNode()
default constructor.
Definition OSnLNode.cpp:154
unsigned int inumberOfMatrixChildren
inumberOfMatrixChildren is the number of OSnLMNode child elements If this number is not fixed,...
Definition OSnLNode.h:79
virtual std::vector< ExprNode * > preOrderOSnLNodeTraversal(std::vector< ExprNode * > *prefixVector)
Called by getPrefixFromExpressionTree().
Definition OSnLNode.cpp:266
unsigned int inumberOfChildren
inumberOfChildren is the number of OSnLNode child elements If this number is not fixed,...
Definition OSnLNode.h:74
virtual std::string getNonlinearExpressionInXML()
The following method writes an OSnLNode or OSnLMNode in OSiL format.
Definition OSnLNode.cpp:221
OSnLMNode ** m_mMatrixChildren
m_mMatrixChildren holds all the matrix-valued operands, if any.
Definition OSnLNode.h:89
virtual std::vector< ExprNode * > postOrderOSnLNodeTraversal(std::vector< ExprNode * > *postfixVector)
Called by getPostfixFromExpressionTree().
Definition OSnLNode.cpp:289
virtual ExprNode * cloneExprNode()=0
Create or clone a node of this type.
virtual std::string getTokenName()=0
a data structure to represent a matrix object (derived from MatrixType)
Definition OSMatrix.h:2186
~OSnLMNodeDiagonalMatrixFromVector()
default destructor.
virtual std::string getTokenName()
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeDiagonalMatrixFromVector()
default constructor.
The OSnLMNode Class for nonlinear expressions involving matrices.
Definition OSnLNode.h:1761
std::vector< ExprNode * > postOrderOSnLNodeTraversal(std::vector< ExprNode * > *postfixVector)
Called by getPostfixFromExpressionTree().
std::vector< ExprNode * > getPrefixFromExpressionTree()
Get a vector of pointers to OSnLNodes and OSnLMNodes that correspond to the (matrix-valued) expressio...
OSnLMNode * createExpressionTreeFromPrefix(std::vector< ExprNode * > nlNodeVec)
Take a vector of ExprNodes (OSnLNodes and OSnLMNodes) in prefix format and create a matrix-valued OSE...
OSnLMNode * createExpressionTreeFromPostfix(std::vector< ExprNode * > nlNodeVec)
Take a vector of ExprNodes (OSnLNodes and OSnLMNodes) in postfix format and create a matrix-valued OS...
std::vector< ExprNode * > preOrderOSnLNodeTraversal(std::vector< ExprNode * > *prefixVector)
Called by getPrefixFromExpressionTree().
std::vector< ExprNode * > getPostfixFromExpressionTree()
Get a vector of pointers to ExprNodes that correspond to the expression tree in postfix format.
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
bool IsEqual(OSnLMNode *that)
A function to check for the equality of two objects.
virtual ~OSnLMNode()
default destructor.
OSnLMNode()
default constructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeIdentityMatrix()
default constructor.
~OSnLMNodeIdentityMatrix()
default destructor.
virtual std::string getTokenName()
int idx
The index of the matrixCon.
Definition OSnLNode.h:2679
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
~OSnLMNodeMatrixCon()
default destructor.
virtual std::string getNonlinearExpressionInXML()
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
virtual std::string getTokenNumber()
OSnLMNodeMatrixCon()
default constructor.
virtual bool IsEqual(OSnLMNodeMatrixCon *that)
A function to check for the equality of two objects.
virtual std::string getTokenName()
OSnLMNodeMatrixDiagonal()
default constructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
~OSnLMNodeMatrixDiagonal()
default destructor.
virtual std::string getTokenName()
~OSnLMNodeMatrixDotTimes()
default destructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeMatrixDotTimes()
default constructor.
virtual std::string getTokenName()
~OSnLMNodeMatrixInverse()
default destructor.
virtual std::string getTokenName()
OSnLMNodeMatrixInverse()
default constructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
bool includeDiagonal
A boolean to express whether the diagonal is to be part of the upper triangle or not.
Definition OSnLNode.h:2241
virtual std::string getNonlinearExpressionInXML()
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
virtual std::string getTokenName()
OSnLMNodeMatrixLowerTriangle()
default constructor.
~OSnLMNodeMatrixLowerTriangle()
default destructor.
virtual bool IsEqual(OSnLMNodeMatrixLowerTriangle *that)
A function to check for the equality of two objects.
~OSnLMNodeMatrixMinus()
default destructor.
virtual std::string getTokenName()
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeMatrixMinus()
default constructor.
OSnLMNodeMatrixNegate()
default constructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
~OSnLMNodeMatrixNegate()
default destructor.
virtual std::string getTokenName()
OSnLMNodeMatrixObj()
default constructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
virtual bool IsEqual(OSnLMNodeMatrixObj *that)
A function to check for the equality of two objects.
virtual std::string getNonlinearExpressionInXML()
~OSnLMNodeMatrixObj()
default destructor.
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
int idx
The index of the matrixObj.
Definition OSnLNode.h:2608
virtual std::string getTokenNumber()
virtual std::string getTokenName()
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeMatrixPlus()
default constructor.
virtual std::string getTokenName()
~OSnLMNodeMatrixPlus()
default destructor.
The OSnLMNodeMatrixProduct Class.
Definition OSnLNode.h:2756
virtual OSnLMNode * cloneExprNode()
The implementation of the virtual functions.
~OSnLMNodeMatrixProduct()
default destructor.
OSnLMNodeMatrixProduct()
default constructor.
virtual std::string getTokenName()
int idx
The index of the matrix.
Definition OSnLNode.h:2466
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
virtual std::string getTokenName()
OSnLMNodeMatrixReference()
default constructor.
virtual std::string getTokenNumber()
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
virtual bool IsEqual(OSnLMNodeMatrixReference *that)
A function to check for the equality of two objects.
virtual std::string getNonlinearExpressionInXML()
~OSnLMNodeMatrixReference()
default destructor.
~OSnLMNodeMatrixScalarTimes()
default destructor.
virtual std::string getTokenName()
OSnLMNodeMatrixScalarTimes()
default constructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
virtual std::string getTokenName()
~OSnLMNodeMatrixSubmatrixAt()
default destructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeMatrixSubmatrixAt()
default constructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
virtual std::string getTokenName()
~OSnLMNodeMatrixSum()
default destructor.
OSnLMNodeMatrixSum()
default constructor.
virtual std::string getTokenName()
~OSnLMNodeMatrixTimes()
default destructor.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeMatrixTimes()
default constructor.
virtual std::string getTokenName()
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
OSnLMNodeMatrixTranspose()
default constructor.
~OSnLMNodeMatrixTranspose()
default destructor.
virtual std::string getTokenName()
bool includeDiagonal
A boolean to express whether the diagonal is to be part of the upper triangle or not.
Definition OSnLNode.h:2295
virtual std::string getNonlinearExpressionInXML()
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
OSnLMNodeMatrixUpperTriangle()
default constructor.
virtual bool IsEqual(OSnLMNodeMatrixUpperTriangle *that)
A function to check for the equality of two objects.
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
~OSnLMNodeMatrixUpperTriangle()
default destructor.
virtual std::string getTokenName()
virtual std::string getTokenNumber()
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
~OSnLMNodeMatrixVar()
default destructor.
int idx
The index of the matrixVar.
Definition OSnLNode.h:2537
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
virtual std::string getNonlinearExpressionInXML()
OSnLMNodeMatrixVar()
default constructor.
virtual bool IsEqual(OSnLMNodeMatrixVar *that)
A function to check for the equality of two objects.
The OSnLNodeAbs Class.
Definition OSnLNode.h:1113
~OSnLNodeAbs()
default destructor.
OSnLNodeAbs()
default constructor.
virtual std::string getTokenName()
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
The OSnLNodeAllDiff Class.
Definition OSnLNode.h:1561
virtual std::string getTokenName()
Definition OSnLNode.cpp:714
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition OSnLNode.cpp:756
~OSnLNodeAllDiff()
default destructor.
Definition OSnLNode.cpp:707
OSnLNodeAllDiff()
default constructor.
Definition OSnLNode.cpp:699
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition OSnLNode.cpp:720
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition OSnLNode.cpp:741
The OSnLNodeCos Class.
Definition OSnLNode.h:963
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
virtual std::string getTokenName()
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
~OSnLNodeCos()
default destructor.
OSnLNodeCos()
default constructor.
The OSnLNodeDivide Class.
Definition OSnLNode.h:669
~OSnLNodeDivide()
default destructor.
OSnLNodeDivide()
default constructor.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual std::string getTokenName()
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
The OSnLNodeE Class.
Definition OSnLNode.h:1347
~OSnLNodeE()
default destructor.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual std::string getTokenName()
OSnLNodeE()
default constructor.
virtual std::string getTokenNumber()
virtual std::string getNonlinearExpressionInXML()
The OSnLNodeErf Class.
Definition OSnLNode.h:1163
OSnLNodeErf()
default constructor.
virtual std::string getTokenName()
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
Create the AD tape to be evaluated by AD.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
~OSnLNodeErf()
default destructor.
The OSnLNodeExp Class.
Definition OSnLNode.h:1063
OSnLNodeExp()
default constructor.
~OSnLNodeExp()
default destructor.
virtual std::string getTokenName()
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
The OSnLNode Class for nonlinear expressions.
Definition OSnLNode.h:180
virtual std::vector< ExprNode * > postOrderOSnLNodeTraversal(std::vector< ExprNode * > *postfixVector)
Called by getPostfixFromExpressionTree().
Definition OSnLNode.cpp:475
OSnLNode * createExpressionTreeFromPostfix(std::vector< ExprNode * > nlNodeVec)
Take a vector of ExprNodes (OSnLNodes and OSnLMNodes) in postfix format and create a scalar-valued OS...
Definition OSnLNode.cpp:413
OSnLNode()
default constructor.
Definition OSnLNode.cpp:365
bool IsEqual(OSnLNode *that)
A function to check for the equality of two objects.
Definition OSnLNode.cpp:541
virtual std::vector< ExprNode * > preOrderOSnLNodeTraversal(std::vector< ExprNode * > *prefixVector)
Called by getPrefixFromExpressionTree().
Definition OSnLNode.cpp:452
virtual OSnLNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition OSnLNode.cpp:505
virtual ~OSnLNode()
default destructor.
Definition OSnLNode.cpp:374
virtual std::vector< ExprNode * > getPostfixFromExpressionTree()
Get a vector of pointers to ExprNodes that correspond to the expression tree in postfix format.
Definition OSnLNode.cpp:468
virtual void getVariableIndexMap(std::map< int, int > *varIdx)
varIdx is a map where the key is the index of an OSnLNodeVariable and (*varIdx)[ idx] is the kth vari...
Definition OSnLNode.cpp:493
ADdouble m_ADTape
m_ADTape stores the expression tree for the this OSnLNode as an ADdouble.
Definition OSnLNode.h:190
virtual std::vector< ExprNode * > getPrefixFromExpressionTree()
Get a vector of pointers to OSnLNodes and OSnLMNodes that correspond to the (scalar-valued or matrix-...
Definition OSnLNode.cpp:446
OSnLNode * createExpressionTreeFromPrefix(std::vector< ExprNode * > nlNodeVec)
Take a vector of ExprNodes (OSnLNodes and OSnLMNodes) in prefix format and create a scalar-valued OSE...
Definition OSnLNode.cpp:381
virtual double calculateFunction(double *x)=0
Calculate the function value given the current variable values.
double m_dFunctionValue
m_dFunctionValue holds the function value given the current variable values.
Definition OSnLNode.h:185
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)=0
Create the AD tape to be evaluated by AD.
The OSnLNodeIf Class.
Definition OSnLNode.h:1213
~OSnLNodeIf()
default destructor.
OSnLNodeIf()
default constructor.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual std::string getTokenName()
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
The OSnLNodeLn Class.
Definition OSnLNode.h:816
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
~OSnLNodeLn()
default destructor.
virtual std::string getTokenName()
OSnLNodeLn()
default constructor.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
The next few nodes evaluate to a scalar even though one or more of its arguments are matrices.
Definition OSnLNode.h:1613
~OSnLNodeMatrixDeterminant()
default destructor.
virtual OSnLNode * cloneExprNode()
Create or clone a node of this type.
virtual double calculateFunction(double *x)
The implementation of the virtual functions.
OSnLNodeMatrixDeterminant()
default constructor.
virtual std::string getTokenName()
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
The OSnLNodeMatrixTrace Class.
Definition OSnLNode.h:1713
~OSnLNodeMatrixToScalar()
default destructor.
OSnLNodeMatrixToScalar()
default constructor.
virtual std::string getTokenName()
virtual OSnLNode * cloneExprNode()
Create or clone a node of this type.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
Create the AD tape to be evaluated by AD.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
The OSnLNodeMatrixTrace Class.
Definition OSnLNode.h:1663
virtual std::string getTokenName()
virtual double calculateFunction(double *x)
The implementation of the virtual functions.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
~OSnLNodeMatrixTrace()
default destructor.
OSnLNodeMatrixTrace()
default constructor.
virtual OSnLNode * cloneExprNode()
Create or clone a node of this type.
The OSnLNodeMax Class.
Definition OSnLNode.h:415
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition OSnLNode.cpp:782
virtual std::string getTokenName()
Definition OSnLNode.cpp:796
~OSnLNodeMax()
default destructor.
Definition OSnLNode.cpp:775
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition OSnLNode.cpp:802
OSnLNodeMax()
default constructor.
Definition OSnLNode.cpp:767
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition OSnLNode.cpp:817
The OSnLNodeMin Class.
Definition OSnLNode.h:464
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition OSnLNode.cpp:848
~OSnLNodeMin()
default destructor.
Definition OSnLNode.cpp:835
virtual std::string getTokenName()
Definition OSnLNode.cpp:843
OSnLNodeMin()
default constructor.
Definition OSnLNode.cpp:827
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition OSnLNode.cpp:878
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition OSnLNode.cpp:863
The OSnLNodeMinus Class.
Definition OSnLNode.h:516
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition OSnLNode.cpp:926
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition OSnLNode.cpp:912
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition OSnLNode.cpp:919
~OSnLNodeMinus()
default destructor.
Definition OSnLNode.cpp:900
OSnLNodeMinus()
default constructor.
Definition OSnLNode.cpp:888
virtual std::string getTokenName()
Definition OSnLNode.cpp:907
The OSnLNodeNegate Class.
Definition OSnLNode.h:567
virtual std::string getTokenName()
Definition OSnLNode.cpp:955
OSnLNodeNegate()
default constructor.
Definition OSnLNode.cpp:937
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition OSnLNode.cpp:972
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition OSnLNode.cpp:966
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition OSnLNode.cpp:960
~OSnLNodeNegate()
default destructor.
Definition OSnLNode.cpp:948
The OSnLNodeNumber Class.
Definition OSnLNode.h:1263
double value
value is the value of the number
Definition OSnLNode.h:1266
virtual std::string getTokenNumber()
virtual std::string getTokenName()
virtual std::string getNonlinearExpressionInXML()
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
~OSnLNodeNumber()
default destructor.
OSnLNodeNumber()
default constructor.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
std::string id
later, e.g.
Definition OSnLNode.h:1274
virtual OSnLNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
std::string type
in the C++ type is real
Definition OSnLNode.h:1269
virtual bool IsEqual(OSnLNodeNumber *that)
A function to check for the equality of two objects.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
The OSnLNodePI Class.
Definition OSnLNode.h:1413
virtual std::string getTokenName()
~OSnLNodePI()
default destructor.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
virtual std::string getTokenNumber()
virtual std::string getNonlinearExpressionInXML()
OSnLNodePI()
default constructor.
The OSnLNodePlus Class.
Definition OSnLNode.h:316
virtual double calculateFunction(double *x)
The implementation of the virtual functions.
Definition OSnLNode.cpp:621
virtual std::string getTokenName()
Definition OSnLNode.cpp:616
OSnLNodePlus()
default constructor.
Definition OSnLNode.cpp:595
~OSnLNodePlus()
default destructor.
Definition OSnLNode.cpp:607
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition OSnLNode.cpp:634
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition OSnLNode.cpp:628
The OSnLNodePower Class.
Definition OSnLNode.h:718
~OSnLNodePower()
default destructor.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual std::string getTokenName()
OSnLNodePower()
default constructor.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
The OSnLNodeProduct Class.
Definition OSnLNode.h:767
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual std::string getTokenName()
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
OSnLNodeProduct()
default constructor.
~OSnLNodeProduct()
default destructor.
The OSnLNodeSin Class.
Definition OSnLNode.h:1013
OSnLNodeSin()
default constructor.
~OSnLNodeSin()
default destructor.
virtual std::string getTokenName()
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
The OSnLNodeSqrt Class.
Definition OSnLNode.h:865
OSnLNodeSqrt()
default constructor.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
~OSnLNodeSqrt()
default destructor.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual std::string getTokenName()
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
The OSnLNodeSquare Class.
Definition OSnLNode.h:913
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
OSnLNodeSquare()
default constructor.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
~OSnLNodeSquare()
default destructor.
virtual std::string getTokenName()
The OSnLNodeSum Class.
Definition OSnLNode.h:366
OSnLNodeSum()
default constructor.
Definition OSnLNode.cpp:644
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition OSnLNode.cpp:664
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition OSnLNode.cpp:676
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition OSnLNode.cpp:687
virtual std::string getTokenName()
Definition OSnLNode.cpp:659
~OSnLNodeSum()
default destructor.
Definition OSnLNode.cpp:652
The OSnLNodeTimes Class.
Definition OSnLNode.h:618
OSnLNodeTimes()
default constructor.
Definition OSnLNode.cpp:981
virtual std::string getTokenName()
~OSnLNodeTimes()
default destructor.
Definition OSnLNode.cpp:993
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
Create the AD tape to be evaluated by AD.
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
The OSnLNodeVariable Class.
Definition OSnLNode.h:1479
~OSnLNodeVariable()
default destructor.
virtual std::string getTokenName()
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
virtual OSnLNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
virtual bool IsEqual(OSnLNodeVariable *that)
A function to check for the equality of two objects.
OSnLNodeVariable()
default constructor.
virtual std::string getNonlinearExpressionInXML()
int idx
idx is the index of the variable
Definition OSnLNode.h:1488
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
double coef
coef is an option coefficient on the variable, the default value is 1.0
Definition OSnLNode.h:1485
virtual std::string getTokenNumber()
virtual void getVariableIndexMap(std::map< int, int > *varIdx)
varIdx is a map where the key is the index of an OSnLNodeVariable and (*varIdx)[ idx] is the kth vari...