OSnLNode.h
Go to the documentation of this file.
1 /* $Id: OSnLNode.h 5284 2017-12-08 13:52:50Z stefan $ */
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>
36 typedef CppAD::AD<double> ADdouble;
37 typedef CppAD::vector<ADdouble> ADvector;
38 #else
39 typedef double ADdouble;
40 typedef std::vector<ADdouble> ADvector;
41 #endif
42 
46 class OSnLNode;
47 class OSnLMNode;
48 class OSMatrix;
49 
56 class ExprNode
57 {
58 public:
59 
62  int inodeInt;
63 
69  int inodeType;
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 
179 class OSnLNode: public ExprNode
180 {
181 public:
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 
295  virtual OSnLNode* copyNodeAndDescendants();
296 
300  bool IsEqual(OSnLNode *that);
301 };//end OSnLNode
302 
303 
315 class OSnLNodePlus : public OSnLNode
316 {
317 public:
321  OSnLNodePlus();
322 
326  ~OSnLNodePlus();
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 
365 class OSnLNodeSum : public OSnLNode
366 {
367 public:
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 
414 class OSnLNodeMax : public OSnLNode
415 {
416 public:
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 
463 class OSnLNodeMin : public OSnLNode
464 {
465 public:
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 
515 class OSnLNodeMinus : public OSnLNode
516 {
517 public:
521  OSnLNodeMinus();
522 
526  ~OSnLNodeMinus();
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 
566 class OSnLNodeNegate : public OSnLNode
567 {
568 public:
572  OSnLNodeNegate();
573 
577  ~OSnLNodeNegate();
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 
617 class OSnLNodeTimes : public OSnLNode
618 {
619 public:
623  OSnLNodeTimes();
624 
628  ~OSnLNodeTimes();
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 
668 class OSnLNodeDivide : public OSnLNode
669 {
670 public:
674  OSnLNodeDivide();
675 
679  ~OSnLNodeDivide();
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 
717 class OSnLNodePower : public OSnLNode
718 {
719 public:
723  OSnLNodePower();
724 
728  ~OSnLNodePower();
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 
766 class OSnLNodeProduct : public OSnLNode
767 {
768 public:
772  OSnLNodeProduct();
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 
815 class OSnLNodeLn : public OSnLNode
816 {
817 public:
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 
864 class OSnLNodeSqrt : public OSnLNode
865 {
866 public:
870  OSnLNodeSqrt();
871 
875  ~OSnLNodeSqrt();
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 
912 class OSnLNodeSquare : public OSnLNode
913 {
914 public:
918  OSnLNodeSquare();
919 
923  ~OSnLNodeSquare();
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 
962 class OSnLNodeCos : public OSnLNode
963 {
964 public:
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 
1012 class OSnLNodeSin : public OSnLNode
1013 {
1014 public:
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 
1062 class OSnLNodeExp : public OSnLNode
1063 {
1064 public:
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 
1112 class OSnLNodeAbs : public OSnLNode
1113 {
1114 public:
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 
1162 class OSnLNodeErf : public OSnLNode
1163 {
1164 public:
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 
1212 class OSnLNodeIf : public OSnLNode
1213 {
1214 public:
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 
1262 class OSnLNodeNumber : public OSnLNode
1263 {
1264 public:
1266  double value;
1267 
1269  std::string type;
1270 
1274  std::string id;
1275 
1279  OSnLNodeNumber();
1280 
1284  ~OSnLNodeNumber();
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 
1320  virtual OSnLNode* copyNodeAndDescendants();
1321 
1326  virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1327 
1331  virtual bool IsEqual(OSnLNodeNumber *that);
1332 };//end OSnLNodeNumber
1333 
1334 
1346 class OSnLNodeE : public OSnLNode
1347 {
1348 public:
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 
1412 class OSnLNodePI : public OSnLNode
1413 {
1414 public:
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 {
1480 public:
1481 
1485  double coef;
1486 
1488  int idx;
1489 
1493  OSnLNodeVariable();
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 
1533  virtual OSnLNode* copyNodeAndDescendants();
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 {
1562 public:
1566  OSnLNodeAllDiff();
1567 
1571  ~OSnLNodeAllDiff();
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 {
1614 public:
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 {
1664 public:
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 {
1714 public:
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 
1760 class OSnLMNode: public ExprNode
1761 {
1762 public:
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 
1838  virtual OSnLMNode* copyNodeAndDescendants();
1839 
1843  bool IsEqual(OSnLMNode *that);
1844 };//end OSnLMNode
1845 
1847 {
1848 public:
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 {
1886 public:
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
1921 
1925  virtual ADdouble constructADTape(std::map<int, int> *ADIdx, ADvector *XAD);
1926 #endif
1927 
1928 };//end OSnLMNodeMatrixPlus
1929 
1931 {
1932 public:
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 {
1970 public:
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 {
2009 public:
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 {
2047 public:
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 {
2085 public:
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 {
2123 public:
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 {
2161 public:
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 {
2199 public:
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 {
2237 public:
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 
2281  virtual OSnLMNode* copyNodeAndDescendants();
2282 
2286  virtual bool IsEqual(OSnLMNodeMatrixLowerTriangle *that);
2287 };//end OSnLMNodeMatrixLowerTriangle
2288 
2290 {
2291 public:
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 
2335  virtual OSnLMNode* copyNodeAndDescendants();
2336 
2340  virtual bool IsEqual(OSnLMNodeMatrixUpperTriangle *that);
2341 };//end OSnLMNodeMatrixUpperTriangle
2342 
2343 
2345 {
2346 public:
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 {
2384 public:
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 {
2423 public:
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 {
2462 public:
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
2497 
2501  virtual double calculateFunction( double *x);
2502 #endif
2503 
2508  virtual OSnLMNode *cloneExprNode();
2509 
2514  virtual OSnLMNode* copyNodeAndDescendants();
2515 
2516 #if 0
2517 
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 {
2533 public:
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
2568 
2572  virtual double calculateFunction( double *x);
2573 #endif
2574 
2579  virtual OSnLMNode *cloneExprNode();
2580 
2585  virtual OSnLMNode* copyNodeAndDescendants();
2586 
2587 #if 0
2588 
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 {
2604 public:
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
2639 
2643  virtual double calculateFunction( double *x);
2644 #endif
2645 
2650  virtual OSnLMNode *cloneExprNode();
2651 
2656  virtual OSnLMNode* copyNodeAndDescendants();
2657 
2658 #if 0
2659 
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 {
2675 public:
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
2710 
2714  virtual double calculateFunction( double *x);
2715 #endif
2716 
2721  virtual OSnLMNode *cloneExprNode();
2722 
2727  virtual OSnLMNode* copyNodeAndDescendants();
2728 
2729 #if 0
2730 
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 {
2757 public:
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 /*
2796 TO DO:
2797 
2798 1. Allow for a variable node with a child
2799 
2800 2. When we create the Expression Tree from postfix, do we check if the coefficient of a variable is 1?
2801 */
2802 #endif
2803 
2804 
The OSnLNodeErf Class.
Definition: OSnLNode.h:1162
virtual double calculateFunction(double *x)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:2274
The OSnLNodeTimes Class.
Definition: OSnLNode.h:617
OSnLNodeE()
default constructor.
Definition: OSnLNode.cpp:1837
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:3797
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1358
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:912
OSnLMNodeMatrixUpperTriangle()
default constructor.
Definition: OSnLNode.cpp:3371
~OSnLMNodeMatrixObj()
default destructor.
Definition: OSnLNode.cpp:3951
int idx
The index of the matrix.
Definition: OSnLNode.h:2466
std::vector< ExprNode * > preOrderOSnLNodeTraversal(std::vector< ExprNode * > *prefixVector)
Called by getPrefixFromExpressionTree().
Definition: OSnLNode.cpp:2548
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:756
~OSnLNodeMinus()
default destructor.
Definition: OSnLNode.cpp:900
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1225
double coef
coef is an option coefficient on the variable, the default value is 1.0
Definition: OSnLNode.h:1485
virtual ~OSnLNode()
default destructor.
Definition: OSnLNode.cpp:374
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:664
~OSnLMNodeMatrixVar()
default destructor.
Definition: OSnLNode.cpp:3769
The OSnLNodeSin Class.
Definition: OSnLNode.h:1012
~OSnLNodeCos()
default destructor.
Definition: OSnLNode.cpp:1397
OSnLMNodeIdentityMatrix()
default constructor.
Definition: OSnLNode.cpp:3197
~OSnLMNodeMatrixReference()
default destructor.
Definition: OSnLNode.cpp:3622
OSnLMNodeMatrixInverse()
default constructor.
Definition: OSnLNode.cpp:3067
OSnLMNodeDiagonalMatrixFromVector()
default constructor.
Definition: OSnLNode.cpp:3545
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3216
~OSnLNodeLn()
default destructor.
Definition: OSnLNode.cpp:1213
virtual double calculateFunction(double *x)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:2214
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3657
~OSnLNodeIf()
default destructor.
Definition: OSnLNode.cpp:1602
OSnLNodeVariable()
default constructor.
Definition: OSnLNode.cpp:1973
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1096
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3027
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3250
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1501
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:628
double ADdouble
Definition: OSnLNode.h:39
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:3262
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3091
double m_dFunctionValue
m_dFunctionValue holds the function value given the current variable values.
Definition: OSnLNode.h:185
virtual OSnLNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:2373
virtual OSnLNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:2312
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:634
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1000
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1052
virtual OSnLNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:505
OSnLMNodeMatrixReference()
default constructor.
Definition: OSnLNode.cpp:3611
The OSnLNodeMatrixTrace Class.
Definition: OSnLNode.h:1662
OSnLMNodeMatrixTimes()
default constructor.
Definition: OSnLNode.cpp:3035
OSnLMNode * createExpressionTreeFromPrefix(std::vector< ExprNode * > nlNodeVec)
Take a vector of ExprNodes (OSnLNodes and OSnLMNodes) in prefix format and create a matrix-valued OSE...
Definition: OSnLNode.cpp:2478
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1455
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:926
The OSnLNodeSqrt Class.
Definition: OSnLNode.h:864
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3086
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2012
std::vector< ExprNode * > postOrderOSnLNodeTraversal(std::vector< ExprNode * > *postfixVector)
Called by getPostfixFromExpressionTree().
Definition: OSnLNode.cpp:2571
~OSnLNodeDivide()
default destructor.
Definition: OSnLNode.cpp:1040
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:2234
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1496
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2291
The OSnLNodeIf Class.
Definition: OSnLNode.h:1212
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1723
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:4199
virtual bool IsEqual(OSnLMNodeMatrixReference *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:3701
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:2338
virtual std::string getTokenName()
Definition: OSnLNode.cpp:714
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3255
virtual std::string getTokenName()
Definition: OSnLNode.cpp:796
The OSnLNodeMin Class.
Definition: OSnLNode.h:463
~OSnLMNodeMatrixLowerTriangle()
default destructor.
Definition: OSnLNode.cpp:3241
virtual double calculateFunction(double *x)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:621
~OSnLNodeNegate()
default destructor.
Definition: OSnLNode.cpp:948
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
Definition: OSnLNode.h:74
int idx
idx is the index of the variable
Definition: OSnLNode.h:1488
The OSnLNodeLn Class.
Definition: OSnLNode.h:815
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:3979
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1543
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3602
~OSnLMNodeMatrixScalarTimes()
default destructor.
Definition: OSnLNode.cpp:3142
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
~OSnLMNodeMatrixSubmatrixAt()
default destructor.
Definition: OSnLNode.cpp:3588
OSnLMNodeMatrixPlus()
default constructor.
Definition: OSnLNode.cpp:2845
~OSnLMNodeIdentityMatrix()
default destructor.
Definition: OSnLNode.cpp:3207
OSnLMNodeMatrixLowerTriangle()
default constructor.
Definition: OSnLNode.cpp:3230
OSnLNodeSin()
default constructor.
Definition: OSnLNode.cpp:1340
OSnLMNode ** m_mMatrixChildren
m_mMatrixChildren holds all the matrix-valued operands, if any.
Definition: OSnLNode.h:89
virtual std::vector< ExprNode * > preOrderOSnLNodeTraversal(std::vector< ExprNode * > *prefixVector)
Called by getPrefixFromExpressionTree().
Definition: OSnLNode.cpp:452
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1271
virtual std::string getTokenName()
Definition: OSnLNode.cpp:907
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3054
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:2088
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:2072
OSnLMNodeMatrixScalarTimes()
default constructor.
Definition: OSnLNode.cpp:3132
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1866
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
~OSnLNodeVariable()
default destructor.
Definition: OSnLNode.cpp:1985
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1109
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:4139
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:3631
int idx
The index of the matrixCon.
Definition: OSnLNode.h:2679
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1324
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:4025
~OSnLMNodeMatrixInverse()
default destructor.
Definition: OSnLNode.cpp:3077
The OSnLNodeCos Class.
Definition: OSnLNode.h:962
int idx
The index of the matrixObj.
Definition: OSnLNode.h:2608
~OSnLNodeAbs()
default destructor.
Definition: OSnLNode.cpp:1489
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1548
int idx
The index of the matrixVar.
Definition: OSnLNode.h:2537
virtual OSnLNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:1737
The OSnLMNode Class for nonlinear expressions involving matrices.
Definition: OSnLNode.h:1760
~OSnLNodeE()
default destructor.
Definition: OSnLNode.cpp:1850
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:1925
OSnLMNodeMatrixDiagonal()
default constructor.
Definition: OSnLNode.cpp:3512
virtual ~ExprNode()
default destructor.
Definition: OSnLNode.cpp:167
OSnLNodeSum()
default constructor.
Definition: OSnLNode.cpp:644
~OSnLNodeAllDiff()
default destructor.
Definition: OSnLNode.cpp:707
OSnLMNodeMatrixSum()
default constructor.
Definition: OSnLNode.cpp:2878
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1933
OSnLNodeSquare()
default constructor.
Definition: OSnLNode.cpp:1294
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2990
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3791
int inodeInt
inodeInt is the unique integer assigned to the OSnLNode or OSnLMNode in OSParameters.h.
Definition: OSnLNode.h:62
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:1668
OSnLMNodeMatrixCon()
default constructor.
Definition: OSnLNode.cpp:4119
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3406
~OSnLMNodeMatrixDotTimes()
default destructor.
Definition: OSnLNode.cpp:3174
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:2869
~OSnLNodeTimes()
default destructor.
Definition: OSnLNode.cpp:993
OSnLNodeDivide()
default constructor.
Definition: OSnLNode.cpp:1028
virtual std::string getTokenName()
Definition: OSnLNode.cpp:955
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3536
virtual std::string getTokenName()
Definition: OSnLNode.cpp:4152
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1167
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:2995
std::string id
later, e.g.
Definition: OSnLNode.h:1274
~OSnLNodeNumber()
default destructor.
Definition: OSnLNode.cpp:1661
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1957
unsigned int inumberOfMatrixChildren
inumberOfMatrixChildren is the number of OSnLMNode child elements If this number is not fixed...
Definition: OSnLNode.h:79
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:2297
OSnLNodeNegate()
default constructor.
Definition: OSnLNode.cpp:937
virtual ExprNode * cloneExprNode()=0
Create or clone a node of this type.
virtual ~OSnLMNode()
default destructor.
Definition: OSnLNode.cpp:2392
OSnLNodeMatrixTrace()
default constructor.
Definition: OSnLNode.cpp:2258
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:878
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
Create the AD tape to be evaluated by AD.
Definition: OSnLNode.cpp:2358
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:2029
~OSnLNodeSqrt()
default destructor.
Definition: OSnLNode.cpp:1259
The OSnLNodeNumber Class.
Definition: OSnLNode.h:1262
OSnLMNodeMatrixMinus()
default constructor.
Definition: OSnLNode.cpp:2971
~OSnLMNodeMatrixNegate()
default destructor.
Definition: OSnLNode.cpp:3013
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:802
OSnLMNode * createExpressionTreeFromPostfix(std::vector< ExprNode * > nlNodeVec)
Take a vector of ExprNodes (OSnLNodes and OSnLMNodes) in postfix format and create a matrix-valued OS...
Definition: OSnLNode.cpp:2509
OSnLNodeMinus()
default constructor.
Definition: OSnLNode.cpp:888
The next few nodes evaluate to a scalar even though one or more of its arguments are matrices...
Definition: OSnLNode.h:1612
OSnLNodePI()
default constructor.
Definition: OSnLNode.cpp:1906
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1162
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1896
~OSnLMNodeMatrixUpperTriangle()
default destructor.
Definition: OSnLNode.cpp:3383
The OSnLNodeNegate Class.
Definition: OSnLNode.h:566
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:919
virtual std::vector< ExprNode * > preOrderOSnLNodeTraversal(std::vector< ExprNode * > *prefixVector)
Called by getPrefixFromExpressionTree().
Definition: OSnLNode.cpp:266
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1192
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1312
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:972
OSnLNodeIf()
default constructor.
Definition: OSnLNode.cpp:1589
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1579
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3839
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)=0
Create the AD tape to be evaluated by AD.
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3151
OSnLNodeErf()
default constructor.
Definition: OSnLNode.cpp:1525
virtual bool IsEqual(OSnLNodeNumber *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:1776
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:720
The OSnLNodeSquare Class.
Definition: OSnLNode.h:912
A generic class from which we derive both OSnLNode and OSnLMNode.
Definition: OSnLNode.h:56
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1635
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3188
The OSnLNodePlus Class.
Definition: OSnLNode.h:315
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:2065
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1621
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1232
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1686
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1370
virtual std::vector< ExprNode * > postOrderOSnLNodeTraversal(std::vector< ExprNode * > *postfixVector)
Called by getPostfixFromExpressionTree().
Definition: OSnLNode.cpp:475
bool includeDiagonal
A boolean to express whether the diagonal is to be part of the upper triangle or not.
Definition: OSnLNode.h:2295
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1462
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
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1717
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:1692
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:676
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2931
~OSnLNodeMatrixTrace()
default destructor.
Definition: OSnLNode.cpp:2267
~OSnLMNodeMatrixCon()
default destructor.
Definition: OSnLNode.cpp:4130
The OSnLNodeVariable Class.
Definition: OSnLNode.h:1478
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1067
The OSnLNodeAllDiff Class.
Definition: OSnLNode.h:1560
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:3846
OSnLNodeExp()
default constructor.
Definition: OSnLNode.cpp:1432
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1101
~OSnLNodeSquare()
default destructor.
Definition: OSnLNode.cpp:1305
~OSnLNodeErf()
default destructor.
Definition: OSnLNode.cpp:1536
virtual OSnLNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:2249
~OSnLMNodeMatrixMinus()
default destructor.
Definition: OSnLNode.cpp:2981
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:4158
OSnLMNodeMatrixTranspose()
default constructor.
Definition: OSnLNode.cpp:3100
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1963
The OSnLNodeMax Class.
Definition: OSnLNode.h:414
OSnLMNodeMatrixNegate()
default constructor.
Definition: OSnLNode.cpp:3003
virtual bool IsEqual(OSnLNodeVariable *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:2135
~OSnLNodeSin()
default destructor.
Definition: OSnLNode.cpp:1351
OSnLMNode()
default constructor.
Definition: OSnLNode.cpp:2384
double value
value is the value of the number
Definition: OSnLNode.h:1266
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1330
The OSnLNodeDivide Class.
Definition: OSnLNode.h:668
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1729
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:1941
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1363
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1220
OSnLNode ** m_mChildren
m_mChildren holds all the operands, that is, nodes that the current node operates on...
Definition: OSnLNode.h:84
~OSnLMNodeDiagonalMatrixFromVector()
default destructor.
Definition: OSnLNode.cpp:3555
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1238
virtual std::string getTokenName()
Definition: OSnLNode.cpp:616
OSnLNodeCos()
default constructor.
Definition: OSnLNode.cpp:1386
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:2399
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1005
The OSnLNodeSum Class.
Definition: OSnLNode.h:365
virtual bool IsEqual(OSnLMNodeMatrixLowerTriangle *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:3313
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3022
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:1874
~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:1508
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3597
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1609
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3644
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2864
The OSnLNodePower Class.
Definition: OSnLNode.h:717
std::vector< ExprNode * > getPrefixFromExpressionTree()
Get a vector of pointers to OSnLNodes and OSnLMNodes that correspond to the (matrix-valued) expressio...
Definition: OSnLNode.cpp:2542
~OSnLNodeProduct()
default destructor.
Definition: OSnLNode.cpp:1155
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:3392
~OSnLNodeMin()
default destructor.
Definition: OSnLNode.cpp:835
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1060
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:3664
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3973
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3564
~OSnLMNodeMatrixDiagonal()
default destructor.
Definition: OSnLNode.cpp:3522
OSnLMNodeMatrixDotTimes()
default constructor.
Definition: OSnLNode.cpp:3164
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1951
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
OSnLNodeAbs()
default constructor.
Definition: OSnLNode.cpp:1478
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1416
OSnLNodeMatrixDeterminant()
default constructor.
Definition: OSnLNode.cpp:2197
std::vector< ADdouble > ADvector
Definition: OSnLNode.h:40
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:848
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1376
bool IsEqual(OSnLMNode *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:2760
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1266
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:741
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1884
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:4206
~OSnLMNodeMatrixProduct()
default destructor.
Definition: OSnLNode.cpp:2924
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1890
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1317
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2228
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
Create the AD tape to be evaluated by AD.
Definition: OSnLNode.cpp:1558
The OSnLNodeMatrixTrace Class.
Definition: OSnLNode.h:1712
virtual bool IsEqual(OSnLMNodeMatrixCon *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:4244
~OSnLNodeSum()
default destructor.
Definition: OSnLNode.cpp:652
~OSnLMNodeMatrixPlus()
default destructor.
Definition: OSnLNode.cpp:2855
virtual bool IsEqual(ExprNode *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:308
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:208
virtual std::string getTokenName()
Definition: OSnLNode.cpp:659
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:3650
OSnLNodeAllDiff()
default constructor.
Definition: OSnLNode.cpp:699
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
Create the AD tape to be evaluated by AD.
Definition: OSnLNode.cpp:1012
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3124
virtual bool IsEqual(OSnLMNodeMatrixUpperTriangle *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:3455
The OSnLNodeProduct Class.
Definition: OSnLNode.h:766
virtual bool IsEqual(OSnLMNodeMatrixObj *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:4062
~OSnLMNodeMatrixSum()
default destructor.
Definition: OSnLNode.cpp:2890
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1278
int inodeType
inodeType essentially tracks whether the number of children are known or not.
Definition: OSnLNode.h:69
virtual OSnLMNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:3418
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2899
virtual std::string getNonlinearExpressionInXML()
The following method writes an OSnLNode or OSnLMNode in OSiL format.
Definition: OSnLNode.cpp:221
virtual OSnLMNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:2962
virtual OSnLNode * copyNodeAndDescendants()
make a copy of this node and all its descendants
Definition: OSnLNode.cpp:2096
The OSnLNodeAbs Class.
Definition: OSnLNode.h:1112
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1047
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1468
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1422
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1514
OSnLNode()
default constructor.
Definition: OSnLNode.cpp:365
std::string type
in the C++ type is real
Definition: OSnLNode.h:1269
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3569
~OSnLNodeMatrixDeterminant()
default destructor.
Definition: OSnLNode.cpp:2206
OSnLMNodeMatrixObj()
default constructor.
Definition: OSnLNode.cpp:3940
ADdouble m_ADTape
m_ADTape stores the expression tree for the this OSnLNode as an ADdouble.
Definition: OSnLNode.h:190
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:2904
~OSnLMNodeMatrixTranspose()
default destructor.
Definition: OSnLNode.cpp:3110
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1404
OSnLMNodeMatrixProduct()
default constructor.
Definition: OSnLNode.cpp:2913
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:1858
bool IsEqual(OSnLNode *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:541
std::vector< ExprNode * > getPostfixFromExpressionTree()
Get a vector of pointers to ExprNodes that correspond to the expression tree in postfix format...
Definition: OSnLNode.cpp:2564
virtual std::string getNonlinearExpressionInXML()
Definition: OSnLNode.cpp:3299
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:179
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3221
The OSnLMNodeMatrixProduct Class.
Definition: OSnLNode.h:2755
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:863
virtual std::string getTokenName()=0
OSnLNodeLn()
default constructor.
Definition: OSnLNode.cpp:1202
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:782
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 std::string getTokenName()
Definition: OSnLNode.cpp:3119
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1409
~OSnLNodePI()
default destructor.
Definition: OSnLNode.cpp:1917
~OSnLMNodeMatrixTimes()
default destructor.
Definition: OSnLNode.cpp:3045
virtual bool IsEqual(OSnLMNodeMatrixVar *that)
A function to check for the equality of two objects.
Definition: OSnLNode.cpp:3883
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:3778
virtual std::string getTokenName()
Definition: OSnLNode.cpp:1450
The OSnLNodeExp Class.
Definition: OSnLNode.h:1062
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1018
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
OSnLNodeMatrixToScalar()
default constructor.
Definition: OSnLNode.cpp:2322
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3183
OSnLNodeNumber()
default constructor.
Definition: OSnLNode.cpp:1646
~OSnLNodePlus()
default destructor.
Definition: OSnLNode.cpp:607
OSnLNodeTimes()
default constructor.
Definition: OSnLNode.cpp:981
OSnLNodePower()
default constructor.
Definition: OSnLNode.cpp:1077
virtual ADdouble constructADTape(std::map< int, int > *ADIdx, ADvector *XAD)
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1180
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
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:1614
virtual std::vector< ExprNode * > postOrderOSnLNodeTraversal(std::vector< ExprNode * > *postfixVector)
Called by getPostfixFromExpressionTree().
Definition: OSnLNode.cpp:289
ExprNode()
default constructor.
Definition: OSnLNode.cpp:154
virtual std::string getTokenNumber()
Definition: OSnLNode.cpp:3960
virtual std::string getTokenName()
Definition: OSnLNode.cpp:3531
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1136
OSnLNodeMin()
default constructor.
Definition: OSnLNode.cpp:827
The OSnLNodeMinus Class.
Definition: OSnLNode.h:515
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:687
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:2059
virtual std::string getTokenName()
Definition: OSnLNode.cpp:2352
OSnLMNodeMatrixSubmatrixAt()
default constructor.
Definition: OSnLNode.cpp:3578
a data structure to represent a matrix object (derived from MatrixType)
Definition: OSMatrix.h:2185
The OSnLNodePI Class.
Definition: OSnLNode.h:1412
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 getTokenNumber()
Definition: OSnLNode.cpp:1995
OSnLNodeMax()
default constructor.
Definition: OSnLNode.cpp:767
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3411
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3156
virtual double calculateFunction(double *x)=0
Calculate the function value given the current variable values.
virtual double calculateFunction(double *x)
Calculate the function value given the current variable values.
Definition: OSnLNode.cpp:960
OSnLNodeProduct()
default constructor.
Definition: OSnLNode.cpp:1146
OSnLNodePlus()
default constructor.
Definition: OSnLNode.cpp:595
virtual std::string getTokenName()
Definition: OSnLNode.cpp:843
~OSnLNodePower()
default destructor.
Definition: OSnLNode.cpp:1089
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:3059
void fint fint fint real fint real * x
The OSnLNodeE Class.
Definition: OSnLNode.h:1346
OSnLMNodeMatrixVar()
default constructor.
Definition: OSnLNode.cpp:3758
~OSnLNodeMatrixToScalar()
default destructor.
Definition: OSnLNode.cpp:2331
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:817
virtual OSnLMNode * cloneExprNode()
Create or clone a node of this type.
Definition: OSnLNode.cpp:4018
~OSnLNodeExp()
default destructor.
Definition: OSnLNode.cpp:1443
OSnLNodeSqrt()
default constructor.
Definition: OSnLNode.cpp:1248
virtual OSnLNode * cloneExprNode()
The implementation of the virtual functions.
Definition: OSnLNode.cpp:1284