OS  2.10.2
OSInstance.h
Go to the documentation of this file.
1 /* $Id: OSInstance.h 5284 2017-12-08 13:52:50Z stefan $ */
29 #ifndef OSINSTANCE_H
30 #define OSINSTANCE_H
31 #include "OSConfig.h"
32 #include "OSParameters.h"
33 #include "OSGeneral.h"
34 #include "OSMatrix.h"
35 #include "OSnLNode.h"
36 #include "OSExpressionTree.h"
37 #include <string>
38 #include <map>
39 
40 
44 class Variable
45 {
46 public:
48  Variable();
49 
51  ~Variable();
52 
56  double lb;
57 
61  double ub;
62 
66  char type;
67 
71  std::string name;
72 
76  bool IsEqual(Variable *that);
77 }; // class Variable
78 
79 
83 class Variables
84 {
85 public:
86 
88  Variables();
89 
91  ~Variables();
92 
95 
98 
102  bool IsEqual(Variables *that);
103 }; // class Variables
104 
105 
110 class ObjCoef
111 {
112 public:
113 
115  ObjCoef();
116 
118  ~ObjCoef();
119 
123  int idx;
124 
128  double value;
129 
133  bool IsEqual(ObjCoef *that);
134 };//class ObjCoef
135 
136 
142 {
143 public:
144 
146  Objective();
147 
149  ~Objective();
150 
152  std::string name;
153 
157  std::string maxOrMin;
158 
162  double constant;
163 
167  double weight;
168 
173 
177 
181  bool IsEqual(Objective *that);
182 };//class Objective
183 
189 {
190 public:
191 
193  Objectives();
194 
196  ~Objectives();
197 
202 
206 
210  bool IsEqual(Objectives *that);
211 };//class Objectives
212 
213 
219 {
220 public:
221 
223  Constraint();
224 
226  ~Constraint();
227 
229  std::string name;
230 
232  double constant;
233 
235  double lb;
236 
238  double ub;
239 
243  bool IsEqual(Constraint *that);
244 };//class Constraint
245 
246 
252 {
253 public:
254 
256  Constraints();
257 
259  ~Constraints();
260 
265 
269 
273  bool IsEqual(Constraints *that);
274 };//class Constraints
275 
276 
289 {
290 public:
291 
294 
297 
302 
307 
310 
313 
323 
328 };//class LinearConstraintCoefficients
329 
330 
341 {
342 public:
343 
345  QuadraticTerm();
346 
348  ~QuadraticTerm();
349 
353  int idx;
354 
358  int idxOne;
359 
363  int idxTwo;
364 
366  double coef;
367 
371  bool IsEqual(QuadraticTerm *that);
372 }; // QuadraticTerm
373 
374 
381 {
382 public:
383 
386 
389 
394 
398 
402  bool IsEqual(QuadraticCoefficients *that);
403 }; // QuadraticCoefficients
404 
405 
410 class Nl
411 {
412 public:
414  int idx;
415 
421 
428 
431 
435  Nl();
436 
440  ~Nl();
441 
445  bool IsEqual(Nl *that);
446 };//end Nl
447 
453 {
454 public:
455 
458 
461 
467 
469  Nl **nl;
470 
474  bool IsEqual(NonlinearExpressions *that);
475 }; // NonlinearExpressions
476 
477 
482 class Matrices
483 {
484 public:
485 
487  Matrices();
488 
490  ~Matrices();
491 
497 
500 
504  bool IsEqual(Matrices *that);
505 
515  bool setRandom(double density, bool conformant, int iMin, int iMax);
516 
522  bool deepCopyFrom(Matrices *that);
523 }; // Matrices
524 
525 
530 class Cone
531 {
532 public:
533 
535  Cone();
536 
538  virtual ~Cone();
539 
545 
554 
557 
559  std::string name;
560 
562  int idx;
563 
567  virtual std::string getConeName();
568 
575  virtual std::string getConeInXML() = 0;
576 
577 
581  bool IsEqual(Cone *that);
582 
592  bool setRandom(double density, bool conformant, int iMin, int iMax);
593 
599  bool deepCopyFrom(Cone *that);
600 }; // Cone
601 
609 class NonnegativeCone : public Cone
610 {
611 public:
615  NonnegativeCone();
616 
621 
625  virtual std::string getConeName();
626 
633  virtual std::string getConeInXML();
634 
638  bool IsEqual(NonnegativeCone *that);
639 
649  bool setRandom(double density, bool conformant, int iMin, int iMax);
650 
656  bool deepCopyFrom(NonnegativeCone *that);
657 
658 };//end NonnegativeCone
659 
667 class NonpositiveCone : public Cone
668 {
669 public:
673  NonpositiveCone();
674 
679 
683  virtual std::string getConeName();
684 
691  virtual std::string getConeInXML();
692 
696  bool IsEqual(NonpositiveCone *that);
697 
707  bool setRandom(double density, bool conformant, int iMin, int iMax);
708 
714  bool deepCopyFrom(NonpositiveCone *that);
715 
716 };//end NonpositiveCone
717 
718 
726 class OrthantCone : public Cone
727 {
728 public:
733  double* ub;
734  double* lb;
735 
739  OrthantCone();
740 
744  ~OrthantCone();
745 
749  virtual std::string getConeName();
750 
757  virtual std::string getConeInXML();
758 
762  bool IsEqual(OrthantCone *that);
763 
773  bool setRandom(double density, bool conformant, int iMin, int iMax);
774 
780  bool deepCopyFrom(OrthantCone *that);
781 };//end OrthantCone
782 
786 class PolyhedralCone : public Cone
787 {
788 public:
789 
791  PolyhedralCone();
792 
794  ~PolyhedralCone();
795 
801 
809 
811  int coneType;
812 
814  int idx;
815 
818 
822  virtual std::string getConeName();
823 
830  virtual std::string getConeInXML();
831 
835  bool IsEqual(PolyhedralCone *that);
836 
846  bool setRandom(double density, bool conformant, int iMin, int iMax);
847 
853  bool deepCopyFrom(PolyhedralCone *that);
854 }; // PolyhedralCone
855 
856 
860 class QuadraticCone : public Cone
861 {
862 public:
863 
865  QuadraticCone();
866 
868  ~QuadraticCone();
869 
875 
883 
885  int coneType;
886 
888  int idx;
889 
898 
909 
913  virtual std::string getConeName();
914 
921  virtual std::string getConeInXML();
922 
926  bool IsEqual(QuadraticCone *that);
927 
937  bool setRandom(double density, bool conformant, int iMin, int iMax);
938 
944  bool deepCopyFrom(QuadraticCone *that);
945 }; // QuadraticCone
946 
947 
952 {
953 public:
954 
957 
960 
966 
974 
976  int coneType;
977 
979  int idx;
980 
989 
1001 
1005  virtual std::string getConeName();
1006 
1013  virtual std::string getConeInXML();
1014 
1018  bool IsEqual(RotatedQuadraticCone *that);
1019 
1029  bool setRandom(double density, bool conformant, int iMin, int iMax);
1030 
1036  bool deepCopyFrom(RotatedQuadraticCone *that);
1037 }; // RotatedQuadraticCone
1038 
1039 /* Not yet implemented:
1040  ENUM_CONE_TYPE_normed,
1041 */
1042 
1046 class SemidefiniteCone : public Cone
1047 {
1048 public:
1049 
1051  SemidefiniteCone();
1052 
1055 
1061 
1069 
1072 
1074  int idx;
1075 
1077  std::string semidefiniteness;
1078 
1081 
1085  virtual std::string getConeName();
1086 
1093  virtual std::string getConeInXML();
1094 
1098  bool IsEqual(SemidefiniteCone *that);
1099 
1109  bool setRandom(double density, bool conformant, int iMin, int iMax);
1110 
1116  bool deepCopyFrom(SemidefiniteCone *that);
1117 }; // SemidefiniteCone
1118 
1119 
1128 {
1129 public:
1134 
1139 
1143  virtual std::string getConeName();
1144 
1151  virtual std::string getConeInXML();
1152 
1156  bool IsEqual(CopositiveMatricesCone *that);
1157 
1167  bool setRandom(double density, bool conformant, int iMin, int iMax);
1168 
1175 
1176 };//end CopositiveMatricesCone
1177 
1178 
1187 {
1188 public:
1194 
1199 
1203  virtual std::string getConeName();
1204 
1212  virtual std::string getConeInXML();
1213 
1218 
1228  bool setRandom(double density, bool conformant, int iMin, int iMax);
1229 
1236 
1237 };//end CompletelyPositiveMatricesCone
1238 
1239 /* Not yet implemented:
1240  ENUM_CONE_TYPE_hyperbolicity,
1241  ENUM_CONE_TYPE_nonnegativePolynomials,
1242  ENUM_CONE_TYPE_moments,
1243 */
1244 
1248 class ProductCone : public Cone
1249 {
1250 public:
1251 
1253  ProductCone();
1254 
1256  ~ProductCone();
1257 
1263 
1271 
1274 
1276  int idx;
1277 
1282 
1286  virtual std::string getConeName();
1287 
1294  virtual std::string getConeInXML();
1295 
1299  bool IsEqual(ProductCone *that);
1300 
1310  bool setRandom(double density, bool conformant, int iMin, int iMax);
1311 
1312 
1318  bool deepCopyFrom(ProductCone *that);
1319 }; // ProductCone
1320 
1324 class IntersectionCone : public Cone
1325 {
1326 public:
1327 
1329  IntersectionCone();
1330 
1333 
1339 
1347 
1350 
1352  int idx;
1353 
1358 
1362  virtual std::string getConeName();
1363 
1370  virtual std::string getConeInXML();
1371 
1375  bool IsEqual(IntersectionCone *that);
1376 
1386  bool setRandom(double density, bool conformant, int iMin, int iMax);
1387 
1393  bool deepCopyFrom(IntersectionCone *that);
1394 }; // IntersectionCone
1395 
1396 
1400 class DualCone : public Cone
1401 {
1402 public:
1403 
1405  DualCone();
1406 
1408  ~DualCone();
1409 
1415 
1423 
1426 
1428  int idx;
1429 
1432 
1436  virtual std::string getConeName();
1437 
1441  bool IsEqual(DualCone *that);
1442 
1452  bool setRandom(double density, bool conformant, int iMin, int iMax);
1453 
1459  bool deepCopyFrom(DualCone *that);
1460 }; // DualCone
1461 
1465 class PolarCone : public Cone
1466 {
1467 public:
1468 
1470  PolarCone();
1471 
1473  ~PolarCone();
1474 
1480 
1488 
1491 
1493  int idx;
1494 
1497 
1501  virtual std::string getConeName();
1502 
1506  bool IsEqual(PolarCone *that);
1507 
1517  bool setRandom(double density, bool conformant, int iMin, int iMax);
1518 
1524  bool deepCopyFrom(PolarCone *that);
1525 }; // PolarCone
1526 
1527 
1532 class Cones
1533 {
1534 public:
1535 
1537  Cones();
1538 
1540  ~Cones();
1541 
1547 
1550 
1554  bool IsEqual(Cones *that);
1555 
1564  bool setRandom(double density, bool conformant, int iMin, int iMax);
1565 
1571  bool deepCopyFrom(Cones *that);
1572 }; // Cones
1573 
1574 
1580 {
1581 public:
1584 
1587 
1592 
1597 
1600 
1603 
1606 
1609 
1611  std::string name;
1612 
1616  char varType;
1617 
1619  MatrixVar();
1620 
1622  ~MatrixVar();
1623 
1627  bool IsEqual(MatrixVar *that);
1628 }; // MatrixVar
1629 
1630 
1636 {
1637 public:
1640 
1643 
1645  MatrixVariables();
1646 
1648  ~MatrixVariables();
1649 
1653  bool IsEqual(MatrixVariables *that);
1654 }; // MatrixVariables
1655 
1656 
1662 {
1663 public:
1666 
1669 
1674 
1679 
1684 
1687 
1689  std::string name;
1690 
1692  MatrixObj();
1693 
1695  ~MatrixObj();
1696 
1700  bool IsEqual(MatrixObj *that);
1701 }; // MatrixObj
1702 
1703 
1709 {
1710 public:
1711 
1713  MatrixObjectives();
1714 
1717 
1720 
1723 
1724 
1728  bool IsEqual(MatrixObjectives *that);
1729 }; // MatrixObjectives
1730 
1731 
1737 {
1738 public:
1741 
1744 
1749 
1754 
1757 
1760 
1763 
1766 
1768  std::string name;
1769 
1771  MatrixCon();
1772 
1774  ~MatrixCon();
1775 
1779  bool IsEqual(MatrixCon *that);
1780 }; // MatrixCon
1781 
1782 
1788 {
1789 public:
1790 
1793 
1796 
1799 
1802 
1803 
1807  bool IsEqual(MatrixConstraints *that);
1808 }; // MatrixConstraints
1809 
1817 {
1818 public:
1820  int idx;
1821 
1827 
1830 
1837 
1839  MatrixExpression();
1840 
1843 
1847  bool IsEqual(MatrixExpression *that);
1848 }; // MatrixExpression
1849 
1850 
1856 {
1857 public:
1860 
1865 
1868 
1871 
1875  bool IsEqual(MatrixExpressions *that);
1876 }; // MatrixExpressions
1877 
1883 {
1884 public:
1887 
1890 
1893 
1896 
1899 
1902 
1903 
1907  bool IsEqual(MatrixProgramming *that);
1908 
1918  bool setRandom(double density, bool conformant, int iMin, int iMax);
1919 
1925  bool deepCopyFrom(MatrixProgramming *that);
1926 }; // MatrixProgramming
1927 
1928 
1934 {
1935 public:
1936 
1939 
1942 
1944  int idx;
1945 }; // TimeDomainStageVar
1946 
1952 {
1953 public:
1954 
1957 
1960 
1963 
1966 
1969 }; // TimeDomainStageVariables
1970 
1971 
1977 {
1978 public:
1979 
1982 
1985 
1987  int idx;
1988 }; // TimeDomainStageCon
1989 
1995 {
1996 public:
1997 
2000 
2003 
2006 
2009 
2012 }; // TimeDomainStageConstraints
2013 
2014 
2020 {
2021 public:
2022 
2025 
2028 
2030  int idx;
2031 }; // TimeDomainStageObj
2032 
2038 {
2039 public:
2040 
2043 
2046 
2049 
2052 
2055 }; // TimeDomainStageObjectives
2056 
2057 
2063 {
2064 public:
2065 
2067  TimeDomainStage();
2068 
2070  ~TimeDomainStage();
2071 
2075  std::string name;
2076 
2079 
2082 
2085 }; // TimeDomainStage
2086 
2092 {
2093 public:
2094 
2096  TimeDomainStages();
2097 
2100 
2105 
2108 }; // Stages
2109 
2115 {
2116 public:
2117 
2120 
2123 
2127  double start;
2128 
2132  double horizon;
2133 }; // Interval
2134 
2140 {
2141 public:
2142 
2144  TimeDomain();
2145 
2147  ~TimeDomain();
2148 
2152 
2156 }; // TimeDomain
2157 
2175 {
2176 public:
2177 
2179  InstanceData();
2180 
2182  ~InstanceData();
2183 
2186 
2189 
2192 
2197 
2202 
2207 
2212 
2217 
2222 
2227 
2231  bool IsEqual(InstanceData *that);
2232 }; // class InstanceData
2233 
2234 
2263 {
2264 public:
2265 
2267  OSInstance();
2268 
2270  ~OSInstance();
2271 
2276 
2279 
2283  bool IsEqual(OSInstance *that);
2284 
2289 
2294 
2299 
2304 
2305 private:
2310  std::string m_sInstanceName;
2314  std::string m_sInstanceSource;
2318  std::string m_sInstanceDescription;
2322  std::string m_sInstanceCreator;
2326  std::string m_sInstanceLicence;
2327 
2328 
2333  bool m_bProcessVariables;
2334 
2338  int m_iVariableNumber;
2339 
2343  int m_iNumberOfIntegerVariables;
2344 
2348  int m_iNumberOfBinaryVariables;
2349 
2353  int m_iNumberOfSemiContinuousVariables;
2354 
2358  int m_iNumberOfSemiIntegerVariables;
2359 
2363  int m_iNumberOfStringVariables;
2364 
2368  std::string* m_msVariableNames;
2369 
2374  char* m_mcVariableTypes;
2375 
2379  double* m_mdVariableLowerBounds;
2380 
2384  double* m_mdVariableUpperBounds;
2385 
2386 
2391  bool m_bProcessObjectives;
2392 
2396  int m_iObjectiveNumber;
2397 
2401  int m_iObjectiveNumberNonlinear;
2402 
2406  std::string* m_msObjectiveNames;
2407 
2411  std::string* m_msMaxOrMins;
2412 
2416  int* m_miNumberOfObjCoef;
2417 
2421  double* m_mdObjectiveConstants;
2422 
2426  double* m_mdObjectiveWeights;
2427 
2432  SparseVector** m_mObjectiveCoefficients;
2433 
2437  bool m_bGetDenseObjectives;
2438 
2443  double** m_mmdDenseObjectiveCoefficients;
2444 
2445 
2450  bool m_bProcessConstraints;
2451 
2455  int m_iConstraintNumber;
2456 
2460  int m_iConstraintNumberNonlinear;
2461 
2465  std::string* m_msConstraintNames;
2466 
2470  double* m_mdConstraintLowerBounds;
2471 
2475  double* m_mdConstraintUpperBounds;
2476 
2481  double* m_mdConstraintConstants;
2482 
2487  char* m_mcConstraintTypes;
2488 
2489 
2495  bool m_bProcessLinearConstraintCoefficients;
2496 
2501  int m_iLinearConstraintCoefficientNumber;
2502 
2507  bool m_bColumnMajor;
2508 
2514  SparseMatrix* m_linearConstraintCoefficientsInColumnMajor;
2515 
2521  SparseMatrix* m_linearConstraintCoefficientsInRowMajor;
2522 
2523 
2528  int m_iNumberOfQuadraticRowIndexes;
2529 
2533  bool m_bQuadraticRowIndexesProcessed;
2534 
2538  int *m_miQuadRowIndexes;
2539 
2543  bool m_bProcessQuadraticTerms;
2544 
2549  int m_iQuadraticTermNumber;
2550 
2555  QuadraticTerms* m_quadraticTerms;
2556 
2559  bool m_bQTermsAdded;
2560 
2561 
2567  int m_iNumberOfNonlinearExpressionTreeIndexes;
2568 
2573  bool m_bNonlinearExpressionTreeIndexesProcessed;
2574 
2580  int *m_miNonlinearExpressionTreeIndexes;
2581 
2587  int m_iNumberOfNonlinearExpressionTreeModIndexes;
2588 
2593  bool m_bNonlinearExpressionTreeModIndexesProcessed;
2594 
2599  int *m_miNonlinearExpressionTreeModIndexes;
2600 
2601 
2606  bool m_binitForAlgDiff;
2607 
2612  unsigned int m_iNumberOfNonlinearVariables;
2613 
2617  bool m_bProcessNonlinearExpressions;
2618 
2622  int m_iNonlinearExpressionNumber;
2623 
2628  int* m_miNonlinearExpressionIndexes;
2629 
2633  bool m_bProcessExpressionTrees;
2634 
2638  bool m_bProcessExpressionTreesMod;
2639 
2644  double *m_mdConstraintFunctionValues;
2645 
2650  double *m_mdObjectiveFunctionValues;
2651 
2655  int m_iJacValueSize;
2656 
2660  int *m_miJacStart;
2661 
2665  int *m_miJacIndex;
2666 
2670  double *m_mdJacValue;
2671 
2676  int *m_miJacNumConTerms;
2677 
2681  SparseJacobianMatrix *m_sparseJacMatrix;
2682 
2687  int m_iHighestTaylorCoeffOrder;
2688 
2697  std::map<int, ScalarExpressionTree*> m_mapExpressionTrees;
2698 
2703  std::map<int, int> m_mapOSADFunRangeIndex;
2704 
2713  std::map<int, MatrixExpressionTree*> m_mapMatrixExpressionTrees;
2714 
2719  ScalarExpressionTree *m_LagrangianExpTree;
2720 
2724  bool m_bLagrangianExpTreeCreated;
2725 
2729  SparseHessianMatrix* m_LagrangianSparseHessian;
2730 
2735  bool m_bLagrangianSparseHessianCreated;
2736 
2740  std::map<int, int> m_mapAllNonlinearVariablesIndex;
2741 
2746  int *m_miNonLinearVarsReverseMap;
2747 
2752  bool m_bAllNonlinearVariablesIndex;
2753 
2761  std::map<int, ScalarExpressionTree*> m_mapExpressionTreesMod ;
2762 
2768  bool m_bOSADFunIsCreated;
2769 
2774  bool m_bCppADTapesBuilt;
2775 
2780  bool m_bCppADMustReTape;
2781 
2785  bool m_bDuplicateExpressionTreesMap;
2786 
2790  bool m_bNonLinearStructuresInitialized;
2791 
2795  bool m_bSparseJacobianCalculated;
2796 
2802  std::map<int, std::vector<OSnLNode*> > m_mapExpressionTreesInPostfix ;
2803 
2808  int m_iHighestOrderEvaluated;
2809 
2814  double **m_mmdObjGradient;
2815 
2816 
2821  std::vector<double> m_vdX;
2822 
2826  std::vector<double> m_vdYval;
2827 
2832  std::vector<bool> m_vbLagHessNonz;
2833 
2837  std::vector<double> m_vdYjacval;
2838 
2842  std::vector<double> m_vdw;
2843 
2847  std::vector<double> m_vdLambda;
2848 
2852  std::vector<double> m_vdDomainUnitVec;
2853 
2857  std::vector<double> m_vdRangeUnitVec;
2858 
2859 
2864  bool m_bProcessMatrices;
2865 
2869  int m_iMatrixNumber;
2870 
2875  ENUM_MATRIX_SYMMETRY* m_miMatrixSymmetry;
2876 
2881  ENUM_MATRIX_TYPE* m_miMatrixType;
2882 
2886  int* m_miMatrixNumberOfColumns;
2887 
2891  int* m_miMatrixNumberOfRows;
2892 
2896  std::string* m_msMatrixNames;
2897 
2905  OSMatrix** m_mMatrix;
2906 
2907 #if 0
2908 
2930  GeneralSparseMatrix** m_mExpandedMatricesInColumnMajor;
2931 
2935  GeneralSparseMatrix** m_mExpandedMatricesInRowMajor;
2936 
2942  ExpandedMatrixBlocks** m_mMatrixBlocksInColumnMajor;
2943 
2949  OSnLMNode *m_mMatrixTransformation;
2950 #endif
2951 
2956  int m_iMatrixVarNumber;
2957 
2961  int m_iMatrixObjNumber;
2962 
2966  int m_iMatrixConNumber;
2967 
2971  int m_iMatrixExpressionNumber;
2972 
2973 
2978  bool m_bProcessTimeDomain;
2979 
2983  bool m_bProcessTimeStages;
2984 
2988  bool m_bProcessTimeInterval;
2989 
2993  bool m_bFiniteTimeStages;
2994 
2998  int m_iNumberOfTimeStages;
2999 
3003  std::string m_sTimeDomainFormat;
3004 
3008  std::string* m_msTimeDomainStageNames;
3009 
3010 
3011 
3012 
3016  int* m_miTimeDomainStageVariableNumber;
3017 
3021  int** m_mmiTimeDomainStageVarList;
3022 
3026  int* m_miTimeDomainStageConstraintNumber;
3027 
3031  int** m_mmiTimeDomainStageConList;
3032 
3036  int* m_miTimeDomainStageObjectiveNumber;
3037 
3041  int** m_mmiTimeDomainStageObjList;
3042 
3043 
3050  bool processVariables();
3051 
3058  bool processObjectives();
3059 
3066  bool processConstraints();
3067 
3074  bool processLinearConstraintCoefficients();
3075 
3082  bool processMatrices();
3083 
3084 public:
3085 
3090  std::string getInstanceName();
3091 
3096  std::string getInstanceSource();
3097 
3103  std::string getInstanceDescription();
3104 
3109  std::string getInstanceCreator();
3110 
3116  std::string getInstanceLicence();
3117 
3118 
3124  int getVariableNumber();
3125 
3132  std::string* getVariableNames();
3133 
3141  //double* getVariableInitialValues();
3142 
3150  //std::string* getVariableInitialStringValues();
3151 
3163  char* getVariableTypes();
3164 
3170 
3176 
3182 
3188 
3194 
3201  double* getVariableLowerBounds();
3202 
3209  double* getVariableUpperBounds();
3210 
3216  int getObjectiveNumber();
3217 
3218 
3225  std::string* getObjectiveNames();
3226 
3233  std::string* getObjectiveMaxOrMins();
3234 
3235 
3245 
3252  double* getObjectiveConstants();
3253 
3260  double* getObjectiveWeights();
3261 
3273 
3280  double** getDenseObjectiveCoefficients();
3281 
3287  int getConstraintNumber();
3288 
3295  std::string* getConstraintNames();
3296 
3303  double* getConstraintLowerBounds();
3304 
3311  double *getConstraintUpperBounds();
3312 
3319  double *getConstraintConstants();
3320 
3334  char* getConstraintTypes();
3335 
3342 
3343 
3351 
3352 
3360 
3368 
3375 
3385 
3393  int* getQuadraticRowIndexes();
3394 
3401 
3402 
3403 /*********************************************************************
3404  * *
3405  * Here we have a number of methods for dealing with *
3406  * scalar-valued expression trees. *
3407  * Even though the tree can contain OSnLMNodes (e.g., to compute *
3408  * the trace of a matrix), the root of the tree is of type OSnLNode. *
3409  * *
3410  *********************************************************************/
3411 
3418 
3425 
3432 
3440 
3449  std::vector<ExprNode*> getNonlinearExpressionTreeInPostfix( int rowIdx);
3450 
3458  std::vector<ExprNode*> getNonlinearExpressionTreeModInPostfix( int rowIdx);
3459 
3466  std::vector<ExprNode*> getNonlinearExpressionTreeInPrefix( int rowIdx);
3467 
3475  std::string getNonlinearExpressionTreeInInfix( int rowIdx);
3476 
3477 
3485  std::vector<ExprNode*> getNonlinearExpressionTreeModInPrefix( int rowIdx);
3486 
3487 
3492 
3497 
3503  std::map<int, ScalarExpressionTree* > getAllNonlinearExpressionTrees();
3504 
3508  std::map<int, ScalarExpressionTree* > getAllNonlinearExpressionTreesMod();
3509 
3517 
3518 
3525 
3526 
3535 
3543 
3549  int getMatrixNumber();
3550 
3564 
3575 
3583 // int getNumberOfBlocksForMatrix(int n);
3584 
3592  int getNumberOfColumnsForMatrix(int n);
3593 
3601  int getNumberOfRowsForMatrix(int n);
3602 
3610  int getNumberOfValuesForMatrix(int n);
3611 
3619  std::string getMatrixName(int n);
3620 
3627  bool matrixHasBase(int n);
3628  bool matrixHasElements(int n);
3629  bool matrixHasTransformations(int n);
3630  bool matrixHasBlocks(int n);
3631  int getNumberOfElementConstructors(int n);
3633  int getNumberOfBlocksConstructors(int n);
3634 
3642  OSMatrix* getMatrix(int n);
3643 
3652 
3661 
3669 // SymmetricMatrixBlocks* getSymmetricMatrixBlocks(int n);
3670 
3682  GeneralSparseMatrix* getMatrixBlockInColumnMajorForm(int n, int columnIdx, int rowIdx);
3683 
3684 
3685 /***********************************************************************
3686  * *
3687  * Here we have a number of methods for dealing with *
3688  * matrix programming and matrix-valued expression trees. *
3689  * Even though the tree can contain OSnLNodes (e.g., to compute the *
3690  * scalar multiple of a matrix), the root of the tree is an OSnLMNode. *
3691  * *
3692  ***********************************************************************/
3693 
3700 
3707 
3714 
3721 
3728 
3735 
3742  std::vector<ExprNode*> getMatrixExpressionTreeInPostfix( int rowIdx);
3743 
3751  std::vector<ExprNode*> getMatrixExpressionTreeModInPostfix( int rowIdx);
3752 
3759  std::vector<ExprNode*> getMatrixExpressionTreeInPrefix( int rowIdx);
3760 
3768  std::string getMatrixExpressionTreeInInfix( int rowIdx);
3769 
3770 
3774  std::map<int, MatrixExpressionTree* > getAllMatrixExpressionTrees();
3775 
3776 
3780  std::map<int, MatrixExpressionTree* > getAllMatrixExpressionTreesMod();
3781 
3789 
3790 
3797 
3798 //===============================================
3799 
3805  std::string getTimeDomainFormat();
3806 
3813 
3819  std::string* getTimeDomainStageNames();
3820 
3827 
3828 
3835 
3842 
3848  int** getTimeDomainStageVarList();
3849 
3855  int** getTimeDomainStageConList();
3856 
3862  int** getTimeDomainStageObjList();
3863 
3869  double getTimeDomainIntervalStart();
3870 
3877 
3878 
3879 
3880  // the set() methods
3881 
3882 
3889  bool setInstanceName(std::string name);
3890 
3897  bool setInstanceSource(std::string source);
3898 
3905  bool setInstanceDescription(std::string description);
3906 
3913  bool setInstanceCreator(std::string fileCreator);
3914 
3921  bool setInstanceLicence(std::string licence);
3922 
3923 
3930  bool setVariableNumber(int number);
3931 
3947  bool addVariable(int index, std::string name, double lowerBound, double upperBound, char type);
3948 
3968  bool setVariables(int number, std::string* names, double* lowerBounds,
3969  double* upperBounds, char* types);
3970 
3971 
3978  bool setObjectiveNumber(int number);
3979 
3997  bool addObjective(int index, std::string name, std::string maxOrMin, double constant, double weight, SparseVector* objectiveCoefficients);
3998 
4014  bool setObjectives(int number, std::string *names, std::string *maxOrMins, double *constants, double *weights, SparseVector **objectitiveCoefficients);
4015 
4022  bool setConstraintNumber(int number);
4023 
4037  bool addConstraint(int index, std::string name, double lowerBound, double upperBound, double constant);
4038 
4052  bool setConstraints(int number, std::string* names, double* lowerBounds, double* upperBounds, double* constants);
4053 
4072  bool setLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor,
4073  double* values, int valuesBegin, int valuesEnd,
4074  int* indexes, int indexesBegin, int indexesEnd,
4075  int* starts, int startsBegin, int startsEnd);
4076 
4095  bool copyLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor,
4096  double* values, int valuesBegin, int valuesEnd,
4097  int* indexes, int indexesBegin, int indexesEnd,
4098  int* starts, int startsBegin, int startsEnd);
4099 
4108  bool setNumberOfQuadraticTerms(int nq);
4109 
4126  bool setQuadraticCoefficients(int number,
4127  int* rowIndexes, int* varOneIndexes, int* varTwoIndexes,
4128  double* coefficients, int begin, int end);
4129 
4130 
4145  int* rowIndexes, int* varOneIndexes, int* varTwoIndexes, double* coefficients);
4146 
4156  bool setNonlinearExpressions(int nexpr, Nl** root);
4157 
4164  bool setMatrixNumber(int number);
4165 
4188  bool addMatrix(int index, std::string name, int numberOfRows, int numberOfColumns,
4189  ENUM_MATRIX_SYMMETRY symmetry, ENUM_MATRIX_TYPE matrixType,
4190  unsigned int inumberOfChildren, MatrixNode **m_mChildren);
4191 
4192 
4199  bool setConeNumber(int number);
4200 
4227  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4228  std::string name, int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4229 
4256  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4257  std::string name, int numberOfComponents, int* components,
4258  int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4259 
4286  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4287  std::string name, int referenceIdx, int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4288 
4314  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4315  std::string name, std::string semidefiniteness, int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4316 
4343  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4344  std::string name, int distortionMatrixIdx, double normFactor, int axisDirection,
4345  int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4346 
4374  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4375  std::string name, int distortionMatrixIdx, double normFactor, int firstAxisDirection,
4376  int secondAxisDirection, int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4377 
4404  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4405  std::string name, int distortionMatrixIdx, double normFactor, int axisDirection, double pNorm,
4406  int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4407 
4438  bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType,
4439  std::string name, int maxDegree, int numberOfUB, double* ub, int numberOfLB, double* lb,
4440  int numberOfOtherIndexes = 0, int* otherIndexes = NULL);
4441 
4442 
4443  // methods to print the current model or parts of it
4444 
4449  std::string printModel( );
4450 
4458  std::string printModel( int rowIdx);
4459 
4460 
4461 
4462  // nonlinear API methods
4463 
4464 
4471 
4485  double calculateFunctionValue(int idx, double* x, bool new_x);
4486 
4501  double *calculateAllConstraintFunctionValues(double* x, double *objLambda, double *conLambda,
4502  bool new_x, int highestOrder);
4503 
4517  double *calculateAllConstraintFunctionValues(double* x, bool new_x);
4518 
4534  double *calculateAllObjectiveFunctionValues(double* x, double *objLambda, double *conLambda,
4535  bool new_x, int highestOrder);
4536 
4550  double *calculateAllObjectiveFunctionValues(double* x, bool new_x);
4551 
4552 
4567  SparseJacobianMatrix *calculateAllConstraintFunctionGradients(double* x, double *objLambda,
4568  double *conLambda, bool new_x, int highestOrder);
4569 
4570 
4586  SparseVector *calculateConstraintFunctionGradient(double* x, double *objLambda, double *conLambda,
4587  int idx, bool new_x, int highestOrder);
4588 
4602  SparseVector *calculateConstraintFunctionGradient(double* x, int idx, bool new_x );
4603 
4618  double **calculateAllObjectiveFunctionGradients(double* x, double *objLambda, double *conLambda,
4619  bool new_x, int highestOrder);
4620 
4636  double *calculateObjectiveFunctionGradient(double* x, double *objLambda, double *conLambda,
4637  int objIdx, bool new_x, int highestOrder);
4638 
4652  double *calculateObjectiveFunctionGradient(double* x, int objIdx, bool new_x );
4653 
4671  SparseHessianMatrix *calculateLagrangianHessian( double* x, double *objLambda, double *conLambda,
4672  bool new_x, int highestOrder);
4673 
4686  SparseHessianMatrix *calculateHessian( double* x, int idx, bool new_x);
4687 
4688 
4694 
4700 
4706 
4711  std::map<int, int> getAllNonlinearVariablesIndexMap( );
4712 
4718 
4725  bool addQTermsToExressionTree();
4726 
4734 
4740 
4746 
4747 #ifdef OS_HAS_CPPAD
4748 
4752  CppAD::ADFun<double> *Fad;
4753 #endif
4754 
4765  bool createOSADFun(std::vector<double> vdX );
4766 
4777  std::vector<double> forwardAD(int p, std::vector<double> vdX);
4778 
4789  std::vector<double> reverseAD(int p, std::vector<double> vdlambda);
4790 
4803  int getADSparsityHessian();
4804 
4824  bool getIterateResults(double *x, double *objLambda, double *conLambda,
4825  bool new_x, int highestOrder);
4826 
4827 
4828 
4841  bool getZeroOrderResults(double *x, double *objLambda, double *conLambda);
4842 
4855  bool getFirstOrderResults(double *x, double *objLambda, double *conLambda );
4856 
4869  bool getSecondOrderResults(double *x, double *objLambda, double *conLambda );
4870 
4871 
4881  bool initForAlgDiff();
4882 
4892  bool initObjGradients();
4893 
4894 
4900 
4901 
4905  bool setTimeDomain(std::string format);
4906 
4910  bool setTimeDomainStages(int number, std::string *names);
4911 
4918  bool setTimeDomainStageVariablesOrdered(int numberOfStages, int *numberOfVariables, int *startIdx);
4919 
4926  bool setTimeDomainStageVariablesUnordered(int numberOfStages, int *numberOfVariables, int **varIndex);
4927 
4933  bool setTimeDomainStageConstraintsOrdered(int numberOfStages, int *numberOfConstraints, int *startIdx);
4934 
4940  bool setTimeDomainStageConstraintsUnordered(int numberOfStages, int *numberOfConstraints, int **conIndex);
4941 
4947  bool setTimeDomainStageObjectivesOrdered(int numberOfStages, int *numberOfObjectives, int *startIdx);
4948 
4954  bool setTimeDomainStageObjectivesUnordered(int numberOfStages, int *numberOfObjectives, int **varIndex);
4955 
4959  bool setTimeDomainInterval(double start, double horizon);
4960 
4961 
4962 }; //class OSInstance
4963 
4964 #endif
4965 
Nl::IsEqual
bool IsEqual(Nl *that)
A function to check for the equality of two objects.
OSConfig.h
TimeDomainStage::TimeDomainStage
TimeDomainStage()
The TimeDomainStage class constructor.
OSInstance::getMatrixExpressionTree
MatrixExpressionTree * getMatrixExpressionTree(int rowIdx)
Get the matrix expression tree for a given row index.
InstanceData
The in-memory representation of the <instanceData> element.
Definition: OSInstance.h:2174
OSExpressionTree.h
MatrixExpression::shape
ENUM_NL_EXPR_SHAPE shape
shape holds the shape of the nonlinear expression (linear/quadratic/convex/general) (see further up i...
Definition: OSInstance.h:1826
TimeDomainStageVariables::numberOfVariables
int numberOfVariables
numberOfVariables gives the number of variables contained in this stage
Definition: OSInstance.h:1962
OSInstance::getNumberOfElementConstructors
int getNumberOfElementConstructors(int n)
RotatedQuadraticCone
The in-memory representation of a rotated quadratic cone.
Definition: OSInstance.h:951
CopositiveMatricesCone
The CopositiveMatricesCone Class.
Definition: OSInstance.h:1127
Variable::IsEqual
bool IsEqual(Variable *that)
A function to check for the equality of two objects.
NonnegativeCone::getConeInXML
virtual std::string getConeInXML()
Write a NonnegativeCone object in XML format.
QuadraticCoefficients::QuadraticCoefficients
QuadraticCoefficients()
The QuadraticCoefficients class constructor.
NonnegativeCone::deepCopyFrom
bool deepCopyFrom(NonnegativeCone *that)
A function to make a deep copy of an instance of this class.
MatrixVar::~MatrixVar
~MatrixVar()
The MatrixVar class destructor.
OSInstance::getNonlinearExpressionTreeModIndexes
int * getNonlinearExpressionTreeModIndexes()
Get all the nonlinear expression tree indexes, i.e., indexes of rows (objectives or constraints) that...
QuadraticCoefficients::qTerm
QuadraticTerm ** qTerm
qTerm is a pointer to an array of QuadraticTerm object pointers
Definition: OSInstance.h:397
OSInstance::duplicateExpressionTreesMap
void duplicateExpressionTreesMap()
duplicate the map of expression trees.
IntersectionCone::~IntersectionCone
~IntersectionCone()
The IntersectionCone class destructor.
ProductCone::IsEqual
bool IsEqual(ProductCone *that)
A function to check for the equality of two objects.
QuadraticTerms
a data structure for holding quadratic terms
Definition: OSGeneral.h:431
Cones::~Cones
~Cones()
The Cones class destructor.
DualCone::getConeName
virtual std::string getConeName()
MatrixVar::lbConeIdx
int lbConeIdx
lbConeIdx gives a cone that must contain matrixVar - lbMatrix
Definition: OSInstance.h:1602
Matrices::numberOfMatrices
int numberOfMatrices
numberOfMatrices is the number of <nl> elements in the <matrices> element.
Definition: OSInstance.h:496
OSInstance::getLinearConstraintCoefficientNumber
int getLinearConstraintCoefficientNumber()
Get number of specified (usually nonzero) linear constraint coefficient values.
MatrixConstraints
The in-memory representation of the <matrixConstraints> element.
Definition: OSInstance.h:1787
Nl::idx
int idx
idx holds the row index of the nonlinear expression
Definition: OSInstance.h:414
RotatedQuadraticCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:979
MatrixObj::constantMatrixIdx
int constantMatrixIdx
constantMatrixIdx gives a constant added to the matrixObj
Definition: OSInstance.h:1686
ENUM_NL_EXPR_SHAPE
ENUM_NL_EXPR_SHAPE
Definition: OSParameters.h:830
OSInstance::matrixHasBlocks
bool matrixHasBlocks(int n)
OrthantCone::OrthantCone
OrthantCone()
default constructor.
TimeDomainStageVar::~TimeDomainStageVar
~TimeDomainStageVar()
The TimeDomainStageVar class destructor.
OSInstance::getNonlinearExpressionTreeModInPostfix
std::vector< ExprNode * > getNonlinearExpressionTreeModInPostfix(int rowIdx)
Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added)...
MatrixVar::name
std::string name
an optional name to this matrixVar
Definition: OSInstance.h:1611
MatrixCon::~MatrixCon
~MatrixCon()
The MatrixCon class destructor.
OSInstance::setTimeDomainStageVariablesOrdered
bool setTimeDomainStageVariablesOrdered(int numberOfStages, int *numberOfVariables, int *startIdx)
This sets the variables associated with each time domain stage in temporal order.
MatrixObj::MatrixObj
MatrixObj()
The MatrixVar class constructor.
OSInstance::bVariablesModified
bool bVariablesModified
bVariablesModified is true if the variables data has been modified.
Definition: OSInstance.h:2288
OSInstance::bObjectivesModified
bool bObjectivesModified
bObjectivesModified is true if the objective function data has been modified.
Definition: OSInstance.h:2293
TimeDomainStageObj::idx
int idx
idx gives the index of this variable
Definition: OSInstance.h:2030
InstanceData::variables
Variables * variables
variables is a pointer to a Variables object
Definition: OSInstance.h:2185
OSInstance::getInstanceDescription
std::string getInstanceDescription()
Get instance description.
DualCone::~DualCone
~DualCone()
The DualCone class destructor.
MatrixObjectives::matrixObj
MatrixObj ** matrixObj
matrixObj is an array of pointers to the <matrixObj> children
Definition: OSInstance.h:1722
RotatedQuadraticCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSInstance::initForAlgDiff
bool initForAlgDiff()
This should be called by nonlinear solvers using callback functions.
QuadraticCone
The in-memory representation of a quadratic cone.
Definition: OSInstance.h:860
RotatedQuadraticCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:972
OSInstance::getLagrangianHessianSparsityPattern
SparseHessianMatrix * getLagrangianHessianSparsityPattern()
DualCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:1414
OSInstance::getMatrixExpressionTreeInPostfix
std::vector< ExprNode * > getMatrixExpressionTreeInPostfix(int rowIdx)
Get the postfix tokens for a given row index.
Variables::numberOfVariables
int numberOfVariables
numberOfVariables is the number of variables in the instance
Definition: OSInstance.h:94
MatrixVariables
The in-memory representation of the <matrixVariables> element.
Definition: OSInstance.h:1635
Constraints::IsEqual
bool IsEqual(Constraints *that)
A function to check for the equality of two objects.
OSInstance::getLagrangianExpTree
ScalarExpressionTree * getLagrangianExpTree()
OSInstance::getNonlinearExpressionTree
ScalarExpressionTree * getNonlinearExpressionTree(int rowIdx)
Get the expression tree for a given row index.
OSInstance::setTimeDomainStageObjectivesOrdered
bool setTimeDomainStageObjectivesOrdered(int numberOfStages, int *numberOfObjectives, int *startIdx)
This sets the objectives associated with each time domain stage in temporal order.
OSInstance::IsEqual
bool IsEqual(OSInstance *that)
A function to check for the equality of two objects.
OSInstance::OSInstance
OSInstance()
The OSInstance class constructor.
PolyhedralCone::deepCopyFrom
bool deepCopyFrom(PolyhedralCone *that)
A function to make a deep copy of an instance of this class.
OSInstance::getConstraintTypes
char * getConstraintTypes()
Get constraint types.
OSInstance::getNumberOfMatrixExpressions
int getNumberOfMatrixExpressions()
Get the number of matrix-valued expressions.
ObjCoef
The in-memory representation of the objective function <coef> element.
Definition: OSInstance.h:110
OSInstance::getMatrixSymmetry
ENUM_MATRIX_SYMMETRY getMatrixSymmetry(int n)
Get the matrix symmetry.
CopositiveMatricesCone::deepCopyFrom
bool deepCopyFrom(CopositiveMatricesCone *that)
A function to make a deep copy of an instance of this class.
ENUM_MATRIX_TYPE
ENUM_MATRIX_TYPE
An enum to track the many different types of values that a matrix can contain Note that these types a...
Definition: OSParameters.h:599
TimeDomainStageCon
The in-memory representation of the <con> element.
Definition: OSInstance.h:1976
QuadraticTerm::coef
double coef
coef is the coefficient of the quadratic term
Definition: OSInstance.h:366
TimeDomainStageCon::idx
int idx
idx gives the index of this constraint
Definition: OSInstance.h:1987
OSInstance::getMatrixType
ENUM_MATRIX_TYPE getMatrixType(int n)
Get the matrix type.
OSInstance::getLinearConstraintCoefficientMajor
bool getLinearConstraintCoefficientMajor()
Get whether the constraint coefficients is in column major (true) or row major (false).
OSInstance::getNumberOfValuesForMatrix
int getNumberOfValuesForMatrix(int n)
Get the number of (nonzero) values in the matrix.
GeneralFileHeader
a data structure that holds general information about files that conform to one of the OSxL schemas
Definition: OSGeneral.h:32
Cone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:562
OSInstance::getAllMatrixExpressionTrees
std::map< int, MatrixExpressionTree * > getAllMatrixExpressionTrees()
IntersectionCone
The in-memory representation of an intersection cone.
Definition: OSInstance.h:1324
CopositiveMatricesCone::getConeName
virtual std::string getConeName()
QuadraticCone::getConeInXML
virtual std::string getConeInXML()
Write a QuadraticCone object in XML format.
MatrixObj::numberOfColumns
int numberOfColumns
numberOfColumns gives the number of columns of this matrix
Definition: OSInstance.h:1668
OSInstance::setTimeDomainStages
bool setTimeDomainStages(int number, std::string *names)
This sets the number (and optionally names) of the time stages.
TimeDomainStageVariables::var
TimeDomainStageVar ** var
var is a pointer to an array of TimeDomainStageVar object pointers
Definition: OSInstance.h:1968
TimeDomainStage
The in-memory representation of the <stage> element.
Definition: OSInstance.h:2062
PolarCone::IsEqual
bool IsEqual(PolarCone *that)
A function to check for the equality of two objects.
Matrices::~Matrices
~Matrices()
The Matrices class destructor.
Objectives::~Objectives
~Objectives()
The Objectives class destructor.
OrthantCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
PolyhedralCone::referenceMatrixIdx
int referenceMatrixIdx
Polyhedral cones use a reference to a previously defined matrix for the extreme rays.
Definition: OSInstance.h:817
SemidefiniteCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:1060
Variable::lb
double lb
lb corresponds to the optional attribute that holds the variable lower bound.
Definition: OSInstance.h:56
MatrixVar::numberOfColumns
int numberOfColumns
numberOfColumns gives the number of columns of this matrix
Definition: OSInstance.h:1586
MatrixExpression::~MatrixExpression
~MatrixExpression()
The MatrixExpression class destructor.
CompletelyPositiveMatricesCone::CompletelyPositiveMatricesCone
CompletelyPositiveMatricesCone()
default constructor.
MatrixObj::name
std::string name
an optional name to this matrixObj
Definition: OSInstance.h:1689
TimeDomain
The in-memory representation of the <timeDomain> element.
Definition: OSInstance.h:2139
InstanceData::timeDomain
TimeDomain * timeDomain
timeDomain is a pointer to a TimeDomain object
Definition: OSInstance.h:2226
QuadraticCone::IsEqual
bool IsEqual(QuadraticCone *that)
A function to check for the equality of two objects.
OSInstance::matrixHasTransformations
bool matrixHasTransformations(int n)
OSInstance::getVariableNumber
int getVariableNumber()
Get number of variables.
TimeDomainStages::TimeDomainStages
TimeDomainStages()
The Stages class constructor.
MatrixExpression::matrixExpressionTree
MatrixExpressionTree * matrixExpressionTree
matrixExpressionTree contains the root of the MatrixExpressionTree
Definition: OSInstance.h:1829
OSInstance::getNonlinearExpressionTreeInPostfix
std::vector< ExprNode * > getNonlinearExpressionTreeInPostfix(int rowIdx)
Get the postfix tokens for a given row index.
OSInstance::getTimeDomainIntervalHorizon
double getTimeDomainIntervalHorizon()
Get the horizon for the time domain interval.
SemidefiniteCone::getConeInXML
virtual std::string getConeInXML()
Write a SemidefiniteCone object in XML format.
CopositiveMatricesCone::getConeInXML
virtual std::string getConeInXML()
Write a CopositiveMatricesCone object in XML format.
PolyhedralCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:807
OSInstance
The in-memory representation of an OSiL instance..
Definition: OSInstance.h:2262
TimeDomainStageVariables
The in-memory representation of the <variables> child of the <stage> element.
Definition: OSInstance.h:1951
OSInstance::getMatrixExpressions
MatrixExpression ** getMatrixExpressions()
Get the pointers to the roots of all matrix expression trees.
MatrixConstraints::matrixCon
MatrixCon ** matrixCon
matrixCon is an array of pointers to the <matrixCon> children
Definition: OSInstance.h:1801
Variables::Variables
Variables()
The Variables class constructor.
ExpandedMatrixBlocks
a sparse matrix data structure for matrices that can hold nonconstant values and have block structure...
Definition: OSMatrix.h:1768
OSInstance::getDenseObjectiveCoefficients
double ** getDenseObjectiveCoefficients()
getDenseObjectiveCoefficients.
MatrixVariables::matrixVar
MatrixVar ** matrixVar
matrixVar is an array of pointers to the <matrixVar> children
Definition: OSInstance.h:1642
LinearConstraintCoefficients::start
IntVector * start
a pointer to the start of each row or column stored in sparse format
Definition: OSInstance.h:306
TimeDomainStageObjectives::TimeDomainStageObjectives
TimeDomainStageObjectives()
The TimeDomainStageObjectives class constructor.
Constraints
The in-memory representation of the <constraints> element.
Definition: OSInstance.h:251
OrthantCone::ub
double * ub
For each dimension of the cone, give the upper and lower bounds The upper bound can be only zero or +...
Definition: OSInstance.h:733
Matrices
The in-memory representation of the <matrices> element.
Definition: OSInstance.h:482
QuadraticCoefficients::~QuadraticCoefficients
~QuadraticCoefficients()
The QuadraticCoefficients class destructor.
OSInstance::getTimeDomainStageConList
int ** getTimeDomainStageConList()
Get the list of constraints in each stage.
OSInstance::calculateFunctionValue
double calculateFunctionValue(int idx, double *x, bool new_x)
Calculate the function value for function (constraint or objective) indexed by idx.
MatrixVar::templateMatrixIdx
int templateMatrixIdx
templateMatrixIdx refers to a matrix that describes the locations in this matrixVar that are allowed ...
Definition: OSInstance.h:1591
OSInstance::getMatrixExpressionTreeInPrefix
std::vector< ExprNode * > getMatrixExpressionTreeInPrefix(int rowIdx)
Get the prefix tokens for a given row index.
PolarCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:1493
OSInstance::getSparseJacobianFromColumnMajor
bool getSparseJacobianFromColumnMajor()
MatrixCon::numberOfColumns
int numberOfColumns
numberOfColumns gives the number of columns of this matrix
Definition: OSInstance.h:1743
CopositiveMatricesCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixProgramming::matrixVariables
MatrixVariables * matrixVariables
a pointer to the matrixVariables object
Definition: OSInstance.h:1892
OSInstance::getObjectiveMaxOrMins
std::string * getObjectiveMaxOrMins()
Get objective maxOrMins.
OSInstance::calculateHessian
SparseHessianMatrix * calculateHessian(double *x, int idx, bool new_x)
Calculate the Hessian of a constraint or objective function.
OSInstance::getVariableTypes
char * getVariableTypes()
Get variable initial values.
NonnegativeCone
The NonnegativeCone Class.
Definition: OSInstance.h:609
MatrixVariables::MatrixVariables
MatrixVariables()
The MatrixVariables class constructor.
Cone::name
std::string name
The cone can have a name for easier identification.
Definition: OSInstance.h:559
QuadraticTerm::idx
int idx
idx is the index of the row in which the quadratic term appears
Definition: OSInstance.h:353
OSInstance::createOSADFun
bool createOSADFun(std::vector< double > vdX)
Create the a CppAD Function object: this is a function where the domain is the set of variables for t...
IntersectionCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixProgramming::MatrixProgramming
MatrixProgramming()
The MatrixProgramming class constructor.
MatrixCon::conReferenceMatrixIdx
int conReferenceMatrixIdx
conReferenceMatrixIdx allows some or all of the components of this matrixCon to be copied from constr...
Definition: OSInstance.h:1753
OSInstance::addVariable
bool addVariable(int index, std::string name, double lowerBound, double upperBound, char type)
add a variable.
QuadraticCone::deepCopyFrom
bool deepCopyFrom(QuadraticCone *that)
A function to make a deep copy of an instance of this class.
OSInstance::getNumberOfSemiIntegerVariables
int getNumberOfSemiIntegerVariables()
getNumberOfSemiIntegerVariables
Cone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:553
MatrixProgramming
The in-memory representation of the <matrixProgramming> element.
Definition: OSInstance.h:1882
SemidefiniteCone::getConeName
virtual std::string getConeName()
OSInstance::getAllNonlinearExpressionTrees
std::map< int, ScalarExpressionTree * > getAllNonlinearExpressionTrees()
OSInstance::calculateAllConstraintFunctionGradients
SparseJacobianMatrix * calculateAllConstraintFunctionGradients(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the gradient of all constraint functions.
IntersectionCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:1345
DualCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:1425
InstanceData::cones
Cones * cones
cones is a pointer to a Cones object
Definition: OSInstance.h:2216
OSInstance::addQTermsToExpressionTree
bool addQTermsToExpressionTree()
This method adds quadratic terms into the array of expression trees.
MatrixProgramming::IsEqual
bool IsEqual(MatrixProgramming *that)
A function to check for the equality of two objects.
TimeDomainStageObjectives::startIdx
int startIdx
startdIdx gives the number of the first objective contained in this stage
Definition: OSInstance.h:2051
SparseMatrix
a sparse matrix data structure
Definition: OSGeneral.h:223
Cones::deepCopyFrom
bool deepCopyFrom(Cones *that)
A function to make a deep copy of an instance of this class.
NonpositiveCone::IsEqual
bool IsEqual(NonpositiveCone *that)
A function to check for the equality of two objects.
TimeDomainStageConstraints::~TimeDomainStageConstraints
~TimeDomainStageConstraints()
The TimeDomainStageConstraints class destructor.
TimeDomainInterval::start
double start
start is the start of the planning period in the <interval> element.
Definition: OSInstance.h:2127
OSInstance::getTimeDomainStageNumberOfVariables
int * getTimeDomainStageNumberOfVariables()
Get the number of variables contained in each time stage.
OSInstance::copyLinearConstraintCoefficients
bool copyLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor, double *values, int valuesBegin, int valuesEnd, int *indexes, int indexesBegin, int indexesEnd, int *starts, int startsBegin, int startsEnd)
copy linear constraint coefficients: perform a deep copy of the sparse matrix
OSInstance::setTimeDomain
bool setTimeDomain(std::string format)
This sets the format of the time domain ("stages"/"interval"/"none")
MatrixVar::lbMatrixIdx
int lbMatrixIdx
lbMatrixIdx gives a lower bound for this matrixVar
Definition: OSInstance.h:1599
Constraints::~Constraints
~Constraints()
The Constraints class destructor.
OSInstance::getNonlinearExpressionTreeInInfix
std::string getNonlinearExpressionTreeInInfix(int rowIdx)
Get the infix representation for a given row (or objective function) index.
MatrixConstraints::~MatrixConstraints
~MatrixConstraints()
The MatrixConstraints class destructor.
MatrixExpressions::~MatrixExpressions
~MatrixExpressions()
The MatrixExpressions class destructor.
Cone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSInstance::getNumberOfSemiContinuousVariables
int getNumberOfSemiContinuousVariables()
getNumberOfSemiContinuousVariables
CompletelyPositiveMatricesCone
The CompletelyPositiveMatricesCone Class.
Definition: OSInstance.h:1186
LinearConstraintCoefficients::rowIdx
IntVector * rowIdx
a pointer of row indices if the problem is stored by column
Definition: OSInstance.h:309
OSInstance::getLinearConstraintCoefficientsInColumnMajor
SparseMatrix * getLinearConstraintCoefficientsInColumnMajor()
Get linear constraint coefficients in column major.
CompletelyPositiveMatricesCone::IsEqual
bool IsEqual(CompletelyPositiveMatricesCone *that)
A function to check for the equality of two objects.
MatrixProgramming::deepCopyFrom
bool deepCopyFrom(MatrixProgramming *that)
A function to make a deep copy of an instance of this class.
TimeDomainStageConstraints::startIdx
int startIdx
startdIdx gives the number of the first constraint contained in this stage
Definition: OSInstance.h:2008
OSInstance::getNonlinearExpressionTreeMod
ScalarExpressionTree * getNonlinearExpressionTreeMod(int rowIdx)
Get the expression tree for a given row index for the modified expression trees (quadratic terms adde...
TimeDomainInterval::horizon
double horizon
horizon is the end of the planning period in the <interval> element.
Definition: OSInstance.h:2132
QuadraticTerm::QuadraticTerm
QuadraticTerm()
The QuadraticTerm class constructor.
OSInstance::getMatrixCoefficientsInColumnMajor
GeneralSparseMatrix * getMatrixCoefficientsInColumnMajor(int n)
Get the (nonzero) elements of the matrix in column major form.
TimeDomainStageObj::TimeDomainStageObj
TimeDomainStageObj()
The TimeDomainStageObj class constructor.
Constraint::ub
double ub
ub is the upper bound on the constraint
Definition: OSInstance.h:238
SemidefiniteCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:1074
OSInstance::getQuadraticTerms
QuadraticTerms * getQuadraticTerms()
Get all the quadratic terms in the instance.
CompletelyPositiveMatricesCone::getConeInXML
virtual std::string getConeInXML()
Write a CompletelyPositiveMatricesCone object in XML format.
Objectives::obj
Objective ** obj
coef is pointer to an array of ObjCoef object pointers
Definition: OSInstance.h:205
DoubleVector
a double vector data structure
Definition: OSGeneral.h:609
OSInstance::getNumberOfNonlinearConstraints
int getNumberOfNonlinearConstraints()
OSnLMNode
The OSnLMNode Class for nonlinear expressions involving matrices.
Definition: OSnLNode.h:1760
MatrixCon::ubConeIdx
int ubConeIdx
ubConeIdx gives a cone that must contain ubMatrix - matrixCon
Definition: OSInstance.h:1765
IntersectionCone::IsEqual
bool IsEqual(IntersectionCone *that)
A function to check for the equality of two objects.
OSInstance::getTimeDomainStageNumberOfConstraints
int * getTimeDomainStageNumberOfConstraints()
Get the number of constraints contained in each time stage.
MatrixVar::MatrixVar
MatrixVar()
The MatrixVar class constructor.
MatrixProgramming::~MatrixProgramming
~MatrixProgramming()
The MatrixProgramming class destructor.
Objective::constant
double constant
constant is the constant term added to the objective function, 0 by default
Definition: OSInstance.h:162
DualCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:1413
OSInstance::setInstanceName
bool setInstanceName(std::string name)
set the instance name.
TimeDomainStage::constraints
TimeDomainStageConstraints * constraints
constraints is a pointer to a TimeDomainConstraints object
Definition: OSInstance.h:2081
TimeDomainStageVariables::startIdx
int startIdx
startdIdx gives the number of the first variable contained in this stage
Definition: OSInstance.h:1965
SemidefiniteCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:1067
PolarCone::getConeName
virtual std::string getConeName()
TimeDomainStageVar::idx
int idx
idx gives the index of this variable
Definition: OSInstance.h:1944
MatrixObj::orderConeIdx
int orderConeIdx
orderConeIdx gives a cone that expresses preferences during the optimization x is (weakly) preferred ...
Definition: OSInstance.h:1683
Objective::IsEqual
bool IsEqual(Objective *that)
A function to check for the equality of two objects.
OrthantCone::~OrthantCone
~OrthantCone()
default destructor.
ProductCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:1262
OSInstance::getConstraintConstants
double * getConstraintConstants()
Get constraint constants.
PolarCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:1487
DualCone::deepCopyFrom
bool deepCopyFrom(DualCone *that)
A function to make a deep copy of an instance of this class.
Variable::ub
double ub
ub corresponds to the optional attribute that holds the variable upper bound.
Definition: OSInstance.h:61
QuadraticCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:881
Variables
The in-memory representation of the variables element.
Definition: OSInstance.h:83
MatrixCon::MatrixCon
MatrixCon()
The MatrixCon class constructor.
OSInstance::setNumberOfQuadraticTerms
bool setNumberOfQuadraticTerms(int nq)
set the number of quadratic terms
MatrixExpression::m_bDeleteExpressionTree
bool m_bDeleteExpressionTree
if m_bDeleteExpressionTree is true during garbage collection, we should delete the osExpression tree ...
Definition: OSInstance.h:1836
OSInstance::getNumberOfNonlinearExpressions
int getNumberOfNonlinearExpressions()
Get number of nonlinear expressions.
OSInstance::getTimeDomainStageNumberOfObjectives
int * getTimeDomainStageNumberOfObjectives()
Get the number of objectives contained in each time stage.
MatrixObj::~MatrixObj
~MatrixObj()
The MatrixVar class destructor.
DualCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:1422
PolyhedralCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:814
DualCone::referenceConeIdx
int referenceConeIdx
Dual cones use a reference to another, previously defined cone.
Definition: OSInstance.h:1431
PolarCone::deepCopyFrom
bool deepCopyFrom(PolarCone *that)
A function to make a deep copy of an instance of this class.
OSInstance::getInstanceLicence
std::string getInstanceLicence()
Get instance licence.
ProductCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:1273
NonpositiveCone::getConeName
virtual std::string getConeName()
OSInstance::getConstraintUpperBounds
double * getConstraintUpperBounds()
Get constraint upper bounds.
OSInstance::setTimeDomainStageObjectivesUnordered
bool setTimeDomainStageObjectivesUnordered(int numberOfStages, int *numberOfObjectives, int **varIndex)
This sets the objectives associated with each time domain stage in arbitrary order.
Nl
The in-memory representation of the <nl> element.
Definition: OSInstance.h:410
OSInstance::getIterateResults
bool getIterateResults(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
end revised AD code
TimeDomainStageConstraints::con
TimeDomainStageCon ** con
con is a pointer to an array of TimeDomainStageCon object pointers
Definition: OSInstance.h:2011
TimeDomainStageObjectives::obj
TimeDomainStageObj ** obj
obj is a pointer to an array of TimeDomainStageObj object pointers
Definition: OSInstance.h:2054
NonpositiveCone::getConeInXML
virtual std::string getConeInXML()
Write a NonpositiveCone object in XML format.
RotatedQuadraticCone::deepCopyFrom
bool deepCopyFrom(RotatedQuadraticCone *that)
A function to make a deep copy of an instance of this class.
OSInstance::getVariableLowerBounds
double * getVariableLowerBounds()
Get variable lower bounds.
OSInstance::setVariableNumber
bool setVariableNumber(int number)
set the number of variables.
TimeDomainStageObjectives::~TimeDomainStageObjectives
~TimeDomainStageObjectives()
The TimeDomainStageObjectives class destructor.
TimeDomainStages::numberOfStages
int numberOfStages
numberOfStages is the number of stages in the <stages> element.
Definition: OSInstance.h:2104
InstanceData::objectives
Objectives * objectives
objectives is a pointer to a Objectives object
Definition: OSInstance.h:2188
GeneralSparseMatrix
a sparse matrix data structure for matrices that can hold nonconstant values
Definition: OSMatrix.h:1654
OSInstance::setQuadraticTermsInNonlinearExpressions
bool setQuadraticTermsInNonlinearExpressions(int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients)
set quadratic terms in nonlinearExpressions
QuadraticCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:885
Objective::name
std::string name
the name of the objective function
Definition: OSInstance.h:152
IntersectionCone::getConeName
virtual std::string getConeName()
QuadraticTerm::idxTwo
int idxTwo
idxTwo is the index of the second variable in the quadratic term
Definition: OSInstance.h:363
MatrixObj
The in-memory representation of the <matrixObj> element.
Definition: OSInstance.h:1661
QuadraticCone::normScaleFactor
double normScaleFactor
quadratic cones normally are of the form x0 >= x1^2 + x2^2 + ...
Definition: OSInstance.h:896
PolyhedralCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:808
OSInstance::getObjectiveConstants
double * getObjectiveConstants()
Get objective constants.
Nl::Nl
Nl()
default constructor.
TimeDomain::stages
TimeDomainStages * stages
stages is a pointer to a Stages object
Definition: OSInstance.h:2151
TimeDomainStageVar::TimeDomainStageVar
TimeDomainStageVar()
The TimeDomainStageVar class constructor.
Constraint::constant
double constant
constant is a value that is added to the constraint
Definition: OSInstance.h:232
LinearConstraintCoefficients::iNumberOfStartElements
int iNumberOfStartElements
iNumberOfStartElements counts the number of elements in the <start> section of <linearConstraintCoeff...
Definition: OSInstance.h:322
SemidefiniteCone::~SemidefiniteCone
~SemidefiniteCone()
The SemidefiniteCone class destructor.
OrthantCone::deepCopyFrom
bool deepCopyFrom(OrthantCone *that)
A function to make a deep copy of an instance of this class.
OSMatrix.h
MatrixCon::lbMatrixIdx
int lbMatrixIdx
lbMatrixIdx gives a lower bound for this matrixCon
Definition: OSInstance.h:1756
MatrixCon
The in-memory representation of the <matrixCon> element.
Definition: OSInstance.h:1736
NonlinearExpressions::NonlinearExpressions
NonlinearExpressions()
The NonlinearExpressions class constructor.
Matrices::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSInstance::getObjectiveNames
std::string * getObjectiveNames()
Get objective names.
OrthantCone::IsEqual
bool IsEqual(OrthantCone *that)
A function to check for the equality of two objects.
QuadraticCone::axisDirection
int axisDirection
The index of the first component can be changed Since there are possibly many dimensions,...
Definition: OSInstance.h:908
OrthantCone::getConeName
virtual std::string getConeName()
InstanceData::quadraticCoefficients
QuadraticCoefficients * quadraticCoefficients
quadraticCoefficients is a pointer to a QuadraticCoefficients object
Definition: OSInstance.h:2201
OSInstance::getZeroOrderResults
bool getZeroOrderResults(double *x, double *objLambda, double *conLambda)
Calculate function values.
Nl::m_bDeleteExpressionTree
bool m_bDeleteExpressionTree
m_bDeleteExpressionTree is true, if in garbage collection, we should delete the osExpression tree obj...
Definition: OSInstance.h:427
OSInstance::instanceData
InstanceData * instanceData
A pointer to an InstanceData object.
Definition: OSInstance.h:2278
OSInstance::setObjectiveNumber
bool setObjectiveNumber(int number)
set the number of objectives.
OSInstance::bConstraintsModified
bool bConstraintsModified
bConstraintsModified is true if the constraints data has been modified.
Definition: OSInstance.h:2298
ProductCone::getConeInXML
virtual std::string getConeInXML()
Write a ProductCone object in XML format.
MatrixObj::numberOfRows
int numberOfRows
numberOfRows gives the number of rows of this matrix
Definition: OSInstance.h:1665
MatrixVar::ubMatrixIdx
int ubMatrixIdx
ubMatrixIdx gives an upper bound for this matrixVar
Definition: OSInstance.h:1605
Cones::numberOfCones
int numberOfCones
numberOfCones is the number of <nl> elements in the <cones> element.
Definition: OSInstance.h:1546
PolyhedralCone
The in-memory representation of a polyhedral cone.
Definition: OSInstance.h:786
Constraints::con
Constraint ** con
con is pointer to an array of Constraint object pointers
Definition: OSInstance.h:268
OSMatrix
a data structure to represent a matrix object (derived from MatrixType)
Definition: OSMatrix.h:2185
InstanceData::matrices
Matrices * matrices
matrices is a pointer to a Matrices object
Definition: OSInstance.h:2211
OSInstance::getAllMatrixExpressionTreesMod
std::map< int, MatrixExpressionTree * > getAllMatrixExpressionTreesMod()
DualCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSInstance::addQTermsToExressionTree
bool addQTermsToExressionTree()
MatrixVar::varType
char varType
an optional variable type (C, B, I, D, J, S).
Definition: OSInstance.h:1616
OSInstance::getNumberOfRowsForMatrix
int getNumberOfRowsForMatrix(int n)
Get the number of rows in the matrix.
QuadraticCone::getConeName
virtual std::string getConeName()
OSInstance::setQuadraticCoefficients
bool setQuadraticCoefficients(int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients, int begin, int end)
set quadratic coefficients into the QuadraticCoefficients->qTerm data structure
LinearConstraintCoefficients::LinearConstraintCoefficients
LinearConstraintCoefficients()
The LinearConstraintCoefficients class constructor.
QuadraticCone::~QuadraticCone
~QuadraticCone()
The QuadraticCone class destructor.
TimeDomainStageVar
The in-memory representation of the element.
Definition: OSInstance.h:1933
OSInstance::getMatrixExpressionTreeInInfix
std::string getMatrixExpressionTreeInInfix(int rowIdx)
Get the infix representation for a given row (or objective function) index.
ObjCoef::value
double value
value is the value of the objective function coefficient corresponding to the variable with index idx
Definition: OSInstance.h:128
OSInstance::matrixHasBase
bool matrixHasBase(int n)
Several tools to parse the constructor list of a matrix.
RotatedQuadraticCone::distortionMatrixIdx
int distortionMatrixIdx
Definition: OSInstance.h:988
ENUM_MATRIX_SYMMETRY
ENUM_MATRIX_SYMMETRY
Definition: OSParameters.h:735
IntVector
an integer Vector data structure
Definition: OSGeneral.h:469
OSInstance::getNumberOfNonlinearObjectives
int getNumberOfNonlinearObjectives()
Variables::~Variables
~Variables()
The Variables class destructor.
LinearConstraintCoefficients::numberOfValues
int numberOfValues
numberOfValues is the number of nonzero elements stored in the <linearConstraintCoefficients> element
Definition: OSInstance.h:301
TimeDomainStage::objectives
TimeDomainStageObjectives * objectives
objectives is a pointer to a TimeDomainObjectives object
Definition: OSInstance.h:2084
QuadraticTerm
The in-memory representation of the <qTerm> element.
Definition: OSInstance.h:340
NonlinearExpressions::numberOfNonlinearExpressions
int numberOfNonlinearExpressions
numberOfNonlinearExpressions is the number of <nl> elements in the <nonlinearExpressions> element.
Definition: OSInstance.h:466
OSInstance::getObjectiveCoefficientNumbers
int * getObjectiveCoefficientNumbers()
Get objective coefficient number.
OSInstance::getObjectiveNumber
int getObjectiveNumber()
Get number of objectives.
NonnegativeCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixObj::templateMatrixIdx
int templateMatrixIdx
templateMatrixIdx refers to a matrix that describes the locations in this matrixObj that are allowed ...
Definition: OSInstance.h:1673
Cone
The in-memory representation of a generic cone Specific cone types are derived from this generic clas...
Definition: OSInstance.h:530
Objective::maxOrMin
std::string maxOrMin
declare the objective function to be a max or a min
Definition: OSInstance.h:157
MatrixVariables::IsEqual
bool IsEqual(MatrixVariables *that)
A function to check for the equality of two objects.
SemidefiniteCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:1059
OSInstance::getNumberOfTransformationConstructors
int getNumberOfTransformationConstructors(int n)
TimeDomainStageCon::~TimeDomainStageCon
~TimeDomainStageCon()
The TimeDomainStageCon class destructor.
MatrixExpressions::MatrixExpressions
MatrixExpressions()
The MatrixExpressions class constructor.
MatrixExpression::idx
int idx
idx holds the row index of the nonlinear expression
Definition: OSInstance.h:1820
ENUM_CONE_TYPE
ENUM_CONE_TYPE
Definition: OSParameters.h:865
QuadraticTerm::IsEqual
bool IsEqual(QuadraticTerm *that)
A function to check for the equality of two objects.
NonpositiveCone::NonpositiveCone
NonpositiveCone()
default constructor.
OSInstance::getSecondOrderResults
bool getSecondOrderResults(double *x, double *objLambda, double *conLambda)
Calculate second derivatives.
MatrixConstraints::numberOfMatrixCon
int numberOfMatrixCon
numberOfMatrixCon gives the number of <matrixCon> children
Definition: OSInstance.h:1798
OSInstance::addMatrix
bool addMatrix(int index, std::string name, int numberOfRows, int numberOfColumns, ENUM_MATRIX_SYMMETRY symmetry, ENUM_MATRIX_TYPE matrixType, unsigned int inumberOfChildren, MatrixNode **m_mChildren)
add a matrix.
NonnegativeCone::~NonnegativeCone
~NonnegativeCone()
default destructor.
TimeDomainStage::~TimeDomainStage
~TimeDomainStage()
The TimeDomainStage class destructor.
NonlinearExpressions::nl
Nl ** nl
nl is pointer to an array of Nl object pointers
Definition: OSInstance.h:469
MatrixExpressions::IsEqual
bool IsEqual(MatrixExpressions *that)
A function to check for the equality of two objects.
PolyhedralCone::~PolyhedralCone
~PolyhedralCone()
The PolyhedralCone class destructor.
RotatedQuadraticCone::IsEqual
bool IsEqual(RotatedQuadraticCone *that)
A function to check for the equality of two objects.
Objectives::numberOfObjectives
int numberOfObjectives
numberOfObjectives is the number of objective functions in the instance
Definition: OSInstance.h:201
OSInstance::getNumberOfNonlinearExpressionTreeIndexes
int getNumberOfNonlinearExpressionTreeIndexes()
Get the number of unique nonlinear expression tree indexes.
SparseHessianMatrix
The in-memory representation of a SparseHessianMatrix..
Definition: OSGeneral.h:376
Constraint::~Constraint
~Constraint()
The Constraint class destructor.
CopositiveMatricesCone::~CopositiveMatricesCone
~CopositiveMatricesCone()
default destructor.
Constraints::numberOfConstraints
int numberOfConstraints
numberOfConstraints is the number of constraints in the instance
Definition: OSInstance.h:264
ProductCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:1276
MatrixCon::ubMatrixIdx
int ubMatrixIdx
ubMatrixIdx gives an upper bound for this matrixCon
Definition: OSInstance.h:1762
OSInstance::getNumberOfMatrixConstraints
int getNumberOfMatrixConstraints()
Get the number of matrix constraints.
Nl::shape
ENUM_NL_EXPR_SHAPE shape
shape holds the shape of the nonlinear expression (linear/quadratic/convex/general) (see further up i...
Definition: OSInstance.h:420
DualCone::DualCone
DualCone()
The DualCone class constructor.
MatrixExpression::IsEqual
bool IsEqual(MatrixExpression *that)
A function to check for the equality of two objects.
Objective::~Objective
~Objective()
The Objective class destructor.
OSInstance::calculateObjectiveFunctionGradient
double * calculateObjectiveFunctionGradient(double *x, double *objLambda, double *conLambda, int objIdx, bool new_x, int highestOrder)
Calculate the gradient of the objective function indexed by objIdx.
OSInstance::printModel
std::string printModel()
Print the infix representation of the problem.
Objectives
The in-memory representation of the <objectives> element.
Definition: OSInstance.h:188
QuadraticCone::QuadraticCone
QuadraticCone()
The QuadraticCone class constructor.
OSInstance::setObjectives
bool setObjectives(int number, std::string *names, std::string *maxOrMins, double *constants, double *weights, SparseVector **objectitiveCoefficients)
set all the objectives related elements.
OSInstance::matrixHasElements
bool matrixHasElements(int n)
MatrixVariables::numberOfMatrixVar
int numberOfMatrixVar
numberOfMatrixVar gives the number of <matrixVar> children
Definition: OSInstance.h:1639
Objective::Objective
Objective()
The Objective class constructor.
OSInstance::setInstanceCreator
bool setInstanceCreator(std::string fileCreator)
set the instance creator.
QuadraticCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:874
RotatedQuadraticCone::normScaleFactor
double normScaleFactor
rotated quadratic cones normally are of the form x0x1 >= x2^2 + x3^2 + ...
Definition: OSInstance.h:987
TimeDomainStageObjectives
The in-memory representation of the <objectives> child of the <stage> element.
Definition: OSInstance.h:2037
MatrixExpressionTree
Used to hold the instance in memory.
Definition: OSExpressionTree.h:208
InstanceData::~InstanceData
~InstanceData()
The InstanceData class destructor.
OSInstance::getInstanceSource
std::string getInstanceSource()
Get instance source.
TimeDomainStage::name
std::string name
name corresponds to the optional attribute that holds the name of the stage; the default value is emp...
Definition: OSInstance.h:2075
MatrixObj::objReferenceMatrixIdx
int objReferenceMatrixIdx
objReferenceMatrixIdx allows some or all of the components of this matrixObj to be copied from object...
Definition: OSInstance.h:1678
Cone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:544
OSInstance::setInstanceDescription
bool setInstanceDescription(std::string description)
set the instance description.
IntersectionCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:1346
TimeDomain::TimeDomain
TimeDomain()
The TimeDomain class constructor.
PolarCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:1478
OSInstance::setTimeDomainStageVariablesUnordered
bool setTimeDomainStageVariablesUnordered(int numberOfStages, int *numberOfVariables, int **varIndex)
This sets the variables associated with each time domain stage in srbitrary order.
Cone::deepCopyFrom
bool deepCopyFrom(Cone *that)
A function to make a deep copy of an instance of this class.
MatrixConstraints::MatrixConstraints
MatrixConstraints()
The MatrixConstraints class constructor.
OSInstance::getNumberOfNonlinearExpressionTreeModIndexes
int getNumberOfNonlinearExpressionTreeModIndexes()
Get the number of unique nonlinear expression tree indexes after modifying the expression tree to con...
MatrixObjectives::MatrixObjectives
MatrixObjectives()
The MatrixObjectives class constructor.
OSInstance::getSparseJacobianFromRowMajor
bool getSparseJacobianFromRowMajor()
OSInstance::reverseAD
std::vector< double > reverseAD(int p, std::vector< double > vdlambda)
Perform an AD reverse sweep.
ProductCone::getConeName
virtual std::string getConeName()
OSInstance::initializeNonLinearStructures
bool initializeNonLinearStructures()
Initialize the data structures for the nonlinear API.
Constraints::Constraints
Constraints()
The Constraints class constructor.
MatrixVar::varReferenceMatrixIdx
int varReferenceMatrixIdx
varReferenceMatrixIdx allows some or all of the components of this matrix variable to be copied from ...
Definition: OSInstance.h:1596
OSInstance::getNumberOfStringVariables
int getNumberOfStringVariables()
getNumberOfStringVariables
Objective::coef
ObjCoef ** coef
coef is pointer to an array of ObjCoef object pointers
Definition: OSInstance.h:176
OSInstance::getInstanceCreator
std::string getInstanceCreator()
Get instance fileCreator.
OSInstance::setInstanceLicence
bool setInstanceLicence(std::string licence)
set the instance licence.
LinearConstraintCoefficients::value
DoubleVector * value
a pointer to the array of nonzero values being stored
Definition: OSInstance.h:315
OSInstance::calculateLagrangianHessian
SparseHessianMatrix * calculateLagrangianHessian(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the Hessian of the Lagrangian Expression Tree This method will build the CppAD expression t...
TimeDomainStageVariables::TimeDomainStageVariables
TimeDomainStageVariables()
The TimeDomainStageVariables class constructor.
OSInstance::setConstraintNumber
bool setConstraintNumber(int number)
set the number of constraints.
Cones::IsEqual
bool IsEqual(Cones *that)
A function to check for the equality of two objects.
PolarCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:1486
Cones::Cones
Cones()
The Cones class constructor.
MatrixNode
a generic class from which we derive matrix constructors (BaseMatrix, MatrixElements,...
Definition: OSMatrix.h:50
OSInstance::getTimeDomainIntervalStart
double getTimeDomainIntervalStart()
Get the start for the time domain interval.
OSInstance::getConstraintLowerBounds
double * getConstraintLowerBounds()
Get constraint lower bounds.
NonnegativeCone::IsEqual
bool IsEqual(NonnegativeCone *that)
A function to check for the equality of two objects.
Constraint::IsEqual
bool IsEqual(Constraint *that)
A function to check for the equality of two objects.
PolarCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:1479
Variable::type
char type
type corresponds to the attribute that holds the variable type: C (Continuous), B (binary),...
Definition: OSInstance.h:66
CompletelyPositiveMatricesCone::getConeName
virtual std::string getConeName()
OSInstance::setVariables
bool setVariables(int number, std::string *names, double *lowerBounds, double *upperBounds, char *types)
set all the variable related elements.
OSInstance::getNumberOfIntegerVariables
int getNumberOfIntegerVariables()
getNumberOfIntegerVariables
OSInstance::setConstraints
bool setConstraints(int number, std::string *names, double *lowerBounds, double *upperBounds, double *constants)
set all the constraint related elements.
PolyhedralCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:799
Objective::numberOfObjCoef
int numberOfObjCoef
numberOfObjCoef is the number of variables with a nonzero objective function coefficient
Definition: OSInstance.h:172
PolyhedralCone::IsEqual
bool IsEqual(PolyhedralCone *that)
A function to check for the equality of two objects.
MatrixVar::ubConeIdx
int ubConeIdx
ubConeIdx gives a cone that must contain ubMatrix - matrixVar
Definition: OSInstance.h:1608
OSInstance::getTimeDomainStageNames
std::string * getTimeDomainStageNames()
Get the names of the stages (NULL or empty string ("") if a stage has not been given a name.
OSInstance::getObjectiveCoefficients
SparseVector ** getObjectiveCoefficients()
Get objective coefficients.
InstanceData::constraints
Constraints * constraints
constraints is a pointer to a Constraints object
Definition: OSInstance.h:2191
TimeDomainStages::stage
TimeDomainStage ** stage
stage is pointer to an array of stage object pointers
Definition: OSInstance.h:2107
Cone::getConeName
virtual std::string getConeName()
OrthantCone::lb
double * lb
Definition: OSInstance.h:734
SemidefiniteCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:1071
SemidefiniteCone::SemidefiniteCone
SemidefiniteCone()
The SemidefiniteCone class constructor.
Cones::cone
Cone ** cone
cone is pointer to an array of Cone object pointers
Definition: OSInstance.h:1549
OSInstance::bUseExpTreeForFunEval
bool bUseExpTreeForFunEval
bUseExpTreeForFunEval is set to true if you wish to use the OS Expression Tree for function evaluatio...
Definition: OSInstance.h:4899
OSInstance::calculateAllObjectiveFunctionGradients
double ** calculateAllObjectiveFunctionGradients(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the gradient of all objective functions.
OSInstance::setNonlinearExpressions
bool setNonlinearExpressions(int nexpr, Nl **root)
set nonlinear expressions
OSInstance::setInstanceSource
bool setInstanceSource(std::string source)
set the instance source.
OrthantCone
The OrthantCone Class.
Definition: OSInstance.h:726
OSInstance::getFirstOrderResults
bool getFirstOrderResults(double *x, double *objLambda, double *conLambda)
Calculate first derivatives.
TimeDomainStageConstraints::TimeDomainStageConstraints
TimeDomainStageConstraints()
The TimeDomainStageConstraints class constructor.
RotatedQuadraticCone::secondAxisDirection
int secondAxisDirection
Definition: OSInstance.h:1000
OSInstance::getTimeDomainStageVarList
int ** getTimeDomainStageVarList()
Get the list of variables in each stage.
OSInstance::getQuadraticRowIndexes
int * getQuadraticRowIndexes()
Get the indexes of rows which have a quadratic term.
NonlinearExpressions::IsEqual
bool IsEqual(NonlinearExpressions *that)
A function to check for the equality of two objects.
Variables::IsEqual
bool IsEqual(Variables *that)
A function to check for the equality of two objects.
SparseVector
a sparse vector data structure
Definition: OSGeneral.h:122
Variables::var
Variable ** var
Here we define a pointer to an array of var pointers.
Definition: OSInstance.h:97
Variable::Variable
Variable()
The Variable class constructor.
MatrixCon::numberOfRows
int numberOfRows
numberOfRows gives the number of rows of this matrix
Definition: OSInstance.h:1740
MatrixVar
The in-memory representation of the <matrixVar> element.
Definition: OSInstance.h:1579
MatrixExpression
The in-memory representation of the <expr> element, which is like a nonlinear expression,...
Definition: OSInstance.h:1816
OSInstance::setLinearConstraintCoefficients
bool setLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor, double *values, int valuesBegin, int valuesEnd, int *indexes, int indexesBegin, int indexesEnd, int *starts, int startsBegin, int startsEnd)
set linear constraint coefficients
OSInstance::forwardAD
std::vector< double > forwardAD(int p, std::vector< double > vdX)
Perform an AD forward sweep.
OSInstance::getTimeDomainFormat
std::string getTimeDomainFormat()
Get the format of the time domain ("stages"/"interval")
InstanceData::InstanceData
InstanceData()
The InstanceData class constructor.
Cone::coneType
ENUM_CONE_TYPE coneType
The type of the cone.
Definition: OSInstance.h:556
TimeDomainStageObj
The in-memory representation of the <obj> element.
Definition: OSInstance.h:2019
TimeDomain::~TimeDomain
~TimeDomain()
The TimeDomain class destructor.
OSInstance::getMatrixNumber
int getMatrixNumber()
Get the number of matrices.
CopositiveMatricesCone::IsEqual
bool IsEqual(CopositiveMatricesCone *that)
A function to check for the equality of two objects.
TimeDomainStages::~TimeDomainStages
~TimeDomainStages()
The Stages class destructor.
OSInstance::getConstraintNames
std::string * getConstraintNames()
Get constraint names.
MatrixProgramming::matrixConstraints
MatrixConstraints * matrixConstraints
a pointer to the matrixConstraints object
Definition: OSInstance.h:1898
IntersectionCone::IntersectionCone
IntersectionCone()
The IntersectionCone class constructor.
OSInstance::instanceHeader
GeneralFileHeader * instanceHeader
the instanceHeader is implemented as a general file header object to allow sharing of classes between...
Definition: OSInstance.h:2275
MatrixCon::templateMatrixIdx
int templateMatrixIdx
templateMatrixIdx refers to a matrix that describes the locations in this matrixVar that are allowed ...
Definition: OSInstance.h:1748
RotatedQuadraticCone::getConeName
virtual std::string getConeName()
MatrixObjectives::~MatrixObjectives
~MatrixObjectives()
The MatrixObjectives class destructor.
CompletelyPositiveMatricesCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
IntersectionCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:1349
CopositiveMatricesCone::CopositiveMatricesCone
CopositiveMatricesCone()
default constructor.
TimeDomainStageCon::TimeDomainStageCon
TimeDomainStageCon()
The TimeDomainStageCon class constructor.
TimeDomainInterval::TimeDomainInterval
TimeDomainInterval()
The Interval class constructor.
OSInstance::getMatrixName
std::string getMatrixName(int n)
Get the name of the matrix.
OSInstance::~OSInstance
~OSInstance()
The OSInstance class destructor.
ObjCoef::~ObjCoef
~ObjCoef()
The ObjCoef class destructor.
DualCone
The in-memory representation of a dual cone.
Definition: OSInstance.h:1400
OSInstance::initObjGradients
bool initObjGradients()
This should be called by initForAlgDiff()
PolyhedralCone::getConeName
virtual std::string getConeName()
RotatedQuadraticCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:965
IntersectionCone::components
IntVector * components
the list of components contributing to the intersection each component contains a reference to a prev...
Definition: OSInstance.h:1357
OSInstance::getMatrixExpressionTreeModInPostfix
std::vector< ExprNode * > getMatrixExpressionTreeModInPostfix(int rowIdx)
Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added)...
TimeDomainInterval
Definition: OSInstance.h:2114
Variable
The in-memory representation of the variable element.
Definition: OSInstance.h:44
ProductCone
The in-memory representation of a product cone.
Definition: OSInstance.h:1248
ObjCoef::ObjCoef
ObjCoef()
The ObjCoef class constructor.
NonnegativeCone::NonnegativeCone
NonnegativeCone()
default constructor.
ProductCone::~ProductCone
~ProductCone()
The ProductCone class destructor.
RotatedQuadraticCone::RotatedQuadraticCone
RotatedQuadraticCone()
The RotatedQuadraticCone class constructor.
OSInstance::setTimeDomainStageConstraintsUnordered
bool setTimeDomainStageConstraintsUnordered(int numberOfStages, int *numberOfConstraints, int **conIndex)
This sets the constraints associated with each time domain stage in srbitrary order.
OSInstance::getNonlinearExpressions
Nl ** getNonlinearExpressions()
Get the pointers to the roots of all expression trees.
OSInstance::getMatrix
OSMatrix * getMatrix(int n)
Get the list of constructors of the matrix.
SemidefiniteCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Cone::Cone
Cone()
The Cone class constructor.
Matrices::IsEqual
bool IsEqual(Matrices *that)
A function to check for the equality of two objects.
ProductCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixExpressions::numberOfExpr
int numberOfExpr
numberOfExpr gives the number of expressions
Definition: OSInstance.h:1859
QuadraticCoefficients
The in-memory representation of the <quadraticCoefficients> element.
Definition: OSInstance.h:380
QuadraticTerm::idxOne
int idxOne
idxOne is the index of the first variable in the quadratic term
Definition: OSInstance.h:358
SemidefiniteCone::IsEqual
bool IsEqual(SemidefiniteCone *that)
A function to check for the equality of two objects.
ProductCone::ProductCone
ProductCone()
The ProductCone class constructor.
InstanceData::nonlinearExpressions
NonlinearExpressions * nonlinearExpressions
nonlinearExpressions is a pointer to a NonlinearExpressions object
Definition: OSInstance.h:2206
Constraint::lb
double lb
lb is the lower bound on the constraint
Definition: OSInstance.h:235
SemidefiniteCone
The in-memory representation of a cone of semidefinite matrices.
Definition: OSInstance.h:1046
IntersectionCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:1352
QuadraticCone::distortionMatrixIdx
int distortionMatrixIdx
Definition: OSInstance.h:897
OSGeneral.h
PolarCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSInstance::getNumberOfMatrixObjectives
int getNumberOfMatrixObjectives()
Get the number of matrix objectives.
Constraint::Constraint
Constraint()
The Constraint class constructor.
SemidefiniteCone::semidefiniteness
std::string semidefiniteness
we need to distinguish positive and negative semidefiniteness
Definition: OSInstance.h:1077
Cone::IsEqual
bool IsEqual(Cone *that)
A function to check for the equality of two objects.
PolyhedralCone::getConeInXML
virtual std::string getConeInXML()
Write a PolyhedralCone object in XML format.
RotatedQuadraticCone::getConeInXML
virtual std::string getConeInXML()
Write a RotatedQuadraticCone object in XML format.
OSInstance::bAMatrixModified
bool bAMatrixModified
bAMatrixModified is true if the A matrix data has been modified.
Definition: OSInstance.h:2303
LinearConstraintCoefficients::~LinearConstraintCoefficients
~LinearConstraintCoefficients()
The LinearConstraintCoefficients class destructor.
Cone::~Cone
virtual ~Cone()
The Cone class destructor.
MatrixExpression::MatrixExpression
MatrixExpression()
The MatrixExpression class constructor.
OSInstance::addCone
bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType, std::string name, int numberOfOtherIndexes=0, int *otherIndexes=NULL)
add a cone.
MatrixProgramming::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
TimeDomainStages
The in-memory representation of the <stages> element.
Definition: OSInstance.h:2091
OSInstance::addConstraint
bool addConstraint(int index, std::string name, double lowerBound, double upperBound, double constant)
add a constraint.
OSInstance::getNonlinearExpressionTreeIndexes
int * getNonlinearExpressionTreeIndexes()
Get all the nonlinear expression tree indexes, i.e., indexes of rows (objectives or constraints) that...
Matrices::deepCopyFrom
bool deepCopyFrom(Matrices *that)
A function to make a deep copy of an instance of this class.
CompletelyPositiveMatricesCone::~CompletelyPositiveMatricesCone
~CompletelyPositiveMatricesCone()
default destructor.
ObjCoef::IsEqual
bool IsEqual(ObjCoef *that)
A function to check for the equality of two objects.
QuadraticCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:873
InstanceData::linearConstraintCoefficients
LinearConstraintCoefficients * linearConstraintCoefficients
linearConstraintCoefficients is a pointer to a LinearConstraintCoefficients object
Definition: OSInstance.h:2196
PolyhedralCone::PolyhedralCone
PolyhedralCone()
The PolyhedralCone class constructor.
Matrices::Matrices
Matrices()
The Matrices class constructor.
NonpositiveCone::deepCopyFrom
bool deepCopyFrom(NonpositiveCone *that)
A function to make a deep copy of an instance of this class.
OSInstance::getADSparsityHessian
int getADSparsityHessian()
end revised AD code
TimeDomainStage::variables
TimeDomainStageVariables * variables
variables is a pointer to a TimeDomainVariables object
Definition: OSInstance.h:2078
QuadraticCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Nl::osExpressionTree
ScalarExpressionTree * osExpressionTree
osExpressionTree contains the root of the ScalarExpressionTree
Definition: OSInstance.h:430
Variable::name
std::string name
name corresponds to the optional attribute that holds the variable name, the default value is empty
Definition: OSInstance.h:71
NonlinearExpressions::~NonlinearExpressions
~NonlinearExpressions()
The NonlinearExpressions class destructor.
OrthantCone::getConeInXML
virtual std::string getConeInXML()
Write an OrthantCone object in XML format.
OSInstance::setTimeDomainStageConstraintsOrdered
bool setTimeDomainStageConstraintsOrdered(int numberOfStages, int *numberOfConstraints, int *startIdx)
This sets the constraints associated with each time domain stage in temporal order.
OSInstance::getNumberOfBlocksConstructors
int getNumberOfBlocksConstructors(int n)
OSInstance::getInstanceName
std::string getInstanceName()
Get instance name.
TimeDomainStageConstraints::numberOfConstraints
int numberOfConstraints
numberOfConstraints gives the number of constraints contained in this stage
Definition: OSInstance.h:2005
OSInstance::getMatrixExpressionTreeIndexes
int * getMatrixExpressionTreeIndexes()
Get all the matrix expression tree indexes, i.e.
OSInstance::getJacobianSparsityPattern
SparseJacobianMatrix * getJacobianSparsityPattern()
PolarCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:1490
Objective
The in-memory representation of the <obj> element.
Definition: OSInstance.h:141
Cones
The in-memory representation of the <cones> element.
Definition: OSInstance.h:1532
OSInstance::getConstraintNumber
int getConstraintNumber()
Get number of constraints.
OSInstance::getNumberOfQuadraticTerms
int getNumberOfQuadraticTerms()
Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.
ProductCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:1270
RotatedQuadraticCone::firstAxisDirection
int firstAxisDirection
The indices of the first two component can be changed Since there are possibly many dimensions,...
Definition: OSInstance.h:999
SemidefiniteCone::deepCopyFrom
bool deepCopyFrom(SemidefiniteCone *that)
A function to make a deep copy of an instance of this class.
PolyhedralCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Objectives::IsEqual
bool IsEqual(Objectives *that)
A function to check for the equality of two objects.
MatrixCon::IsEqual
bool IsEqual(MatrixCon *that)
A function to check for the equality of two objects.
RotatedQuadraticCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:973
Constraint
The in-memory representation of the <con> element.
Definition: OSInstance.h:218
MatrixProgramming::matrixObjectives
MatrixObjectives * matrixObjectives
a pointer to the matrixObjectives object
Definition: OSInstance.h:1895
MatrixObjectives
The in-memory representation of the <matrixObjectives> element.
Definition: OSInstance.h:1708
Objectives::Objectives
Objectives()
The Objectives class constructor.
Cone::numberOfOtherIndexes
int numberOfOtherIndexes
Cones can also be formed by Multidimensional tensors.
Definition: OSInstance.h:552
QuadraticCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:888
OSInstance::getTimeDomainStageObjList
int ** getTimeDomainStageObjList()
Get the list of objectives in each stage.
ObjCoef::idx
int idx
idx is the index of the variable corresponding to the coefficient
Definition: OSInstance.h:123
PolarCone::~PolarCone
~PolarCone()
The PolarCone class destructor.
MatrixCon::name
std::string name
an optional name to this MatrixCon
Definition: OSInstance.h:1768
DualCone::IsEqual
bool IsEqual(DualCone *that)
A function to check for the equality of two objects.
RotatedQuadraticCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:964
OSInstance::getNonlinearExpressionTreeInPrefix
std::vector< ExprNode * > getNonlinearExpressionTreeInPrefix(int rowIdx)
Get the prefix tokens for a given row index.
ProductCone::factors
IntVector * factors
the list of "factors" contributing to the product each factor contains a reference to a previously de...
Definition: OSInstance.h:1281
MatrixObjectives::IsEqual
bool IsEqual(MatrixObjectives *that)
A function to check for the equality of two objects.
PolyhedralCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:811
OSInstance::getNonlinearExpressionTreeModInPrefix
std::vector< ExprNode * > getNonlinearExpressionTreeModInPrefix(int rowIdx)
Get the prefix tokens for a given row index for the modified Expression Tree (quadratic terms added).
OSInstance::getAllNonlinearExpressionTreesMod
std::map< int, ScalarExpressionTree * > getAllNonlinearExpressionTreesMod()
QuadraticCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:882
IntersectionCone::deepCopyFrom
bool deepCopyFrom(IntersectionCone *that)
A function to make a deep copy of an instance of this class.
SemidefiniteCone::isPositiveSemiDefinite
bool isPositiveSemiDefinite
information about semidefiniteness is also tracked in a boolean variable
Definition: OSInstance.h:1080
NonpositiveCone::~NonpositiveCone
~NonpositiveCone()
default destructor.
OSInstance::setTimeDomainInterval
bool setTimeDomainInterval(double start, double horizon)
This sets the start and end of the time interval.
PolarCone
The in-memory representation of a polar cone.
Definition: OSInstance.h:1465
TimeDomainStageObjectives::numberOfObjectives
int numberOfObjectives
numberOfObjectives gives the number of objectives contained in this stage
Definition: OSInstance.h:2048
SemidefiniteCone::otherIndexes
int * otherIndexes
Definition: OSInstance.h:1068
OSInstance::getTimeDomainStageNumber
int getTimeDomainStageNumber()
Get the number of stages that make up the time domain.
QuadraticTerm::~QuadraticTerm
~QuadraticTerm()
The QuadraticTerm class destructor.
OSInstance::getLinearConstraintCoefficientsInRowMajor
SparseMatrix * getLinearConstraintCoefficientsInRowMajor()
Get linear constraint coefficients in row major.
OSInstance::calculateAllConstraintFunctionValues
double * calculateAllConstraintFunctionValues(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate all of the constraint function values.
NonpositiveCone::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSInstance::getNumberOfColumnsForMatrix
int getNumberOfColumnsForMatrix(int n)
Get the number of blocks in the matrix.
MatrixVar::numberOfRows
int numberOfRows
numberOfRows gives the number of rows of this matrix
Definition: OSInstance.h:1583
MatrixVar::IsEqual
bool IsEqual(MatrixVar *that)
A function to check for the equality of two objects.
QuadraticCoefficients::numberOfQuadraticTerms
int numberOfQuadraticTerms
numberOfQuadraticTerms is the number of quadratic terms in the <quadraticCoefficients> element.
Definition: OSInstance.h:393
ProductCone::deepCopyFrom
bool deepCopyFrom(ProductCone *that)
A function to make a deep copy of an instance of this class.
ProductCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:1261
TimeDomainInterval::~TimeDomainInterval
~TimeDomainInterval()
The Interval class destructor.
RotatedQuadraticCone::coneType
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Definition: OSInstance.h:976
TimeDomain::interval
TimeDomainInterval * interval
interval is a pointer to an Interval object
Definition: OSInstance.h:2155
NonlinearExpressions
The in-memory representation of the <nonlinearExpressions> element.
Definition: OSInstance.h:452
CompletelyPositiveMatricesCone::deepCopyFrom
bool deepCopyFrom(CompletelyPositiveMatricesCone *that)
A function to make a deep copy of an instance of this class.
OSInstance::calculateAllObjectiveFunctionValues
double * calculateAllObjectiveFunctionValues(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate all of the objective function values.
ProductCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:1269
TimeDomainStageObj::~TimeDomainStageObj
~TimeDomainStageObj()
The TimeDomainStageObj class destructor.
MatrixExpressions
The in-memory representation of the <matrixExpressions> element.
Definition: OSInstance.h:1855
OSInstance::getVariableNames
std::string * getVariableNames()
Get variable names.
OSInstance::addObjective
bool addObjective(int index, std::string name, std::string maxOrMin, double constant, double weight, SparseVector *objectiveCoefficients)
add an objective.
LinearConstraintCoefficients::IsEqual
bool IsEqual(LinearConstraintCoefficients *that)
A function to check for the equality of two objects.
DualCone::idx
int idx
cones are referenced by an (automatically created) index
Definition: OSInstance.h:1428
MatrixVariables::~MatrixVariables
~MatrixVariables()
The MatrixVariables class destructor.
MatrixCon::lbConeIdx
int lbConeIdx
lbConeIdx gives a cone that must contain matrixCon - lbMatrix
Definition: OSInstance.h:1759
ScalarExpressionTree
Used to hold part of the instance in memory.
Definition: OSExpressionTree.h:99
TimeDomainStageVariables::~TimeDomainStageVariables
~TimeDomainStageVariables()
The TimeDomainStageVariables class destructor.
LinearConstraintCoefficients
The in-memory representation of the <linearConstraintCoefficients> element.
Definition: OSInstance.h:288
OSInstance::getVariableUpperBounds
double * getVariableUpperBounds()
Get variable upper bounds.
OSInstance::getNumberOfMatrixExpressionTreeIndexes
int getNumberOfMatrixExpressionTreeIndexes()
Get the number of unique matrix expression tree indexes.
NonpositiveCone
The NonpositiveCone Class.
Definition: OSInstance.h:667
TimeDomainStageConstraints
The in-memory representation of the <constraints> child of the <stage> element.
Definition: OSInstance.h:1994
OSInstance::setConeNumber
bool setConeNumber(int number)
set the number of cones
OSInstance::getMatrixCoefficientsInRowMajor
GeneralSparseMatrix * getMatrixCoefficientsInRowMajor(int n)
Get the (nonzero) elements of the matrix in row major form.
IntersectionCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:1338
PolarCone::PolarCone
PolarCone()
The PolarCone class constructor.
PolarCone::referenceConeIdx
int referenceConeIdx
Polar cones use a reference to another, previously defined cone.
Definition: OSInstance.h:1496
OSParameters.h
OSInstance::getObjectiveWeights
double * getObjectiveWeights()
Get objective weights.
Cone::getConeInXML
virtual std::string getConeInXML()=0
Write a Cone object in XML format.
PolyhedralCone::numberOfColumns
int numberOfColumns
Definition: OSInstance.h:800
OSInstance::getAllNonlinearVariablesIndexMap
std::map< int, int > getAllNonlinearVariablesIndexMap()
SparseJacobianMatrix
a sparse Jacobian matrix data structure
Definition: OSGeneral.h:300
OSInstance::calculateConstraintFunctionGradient
SparseVector * calculateConstraintFunctionGradient(double *x, double *objLambda, double *conLambda, int idx, bool new_x, int highestOrder)
Calculate the gradient of the constraint function indexed by idx.
MatrixProgramming::matrixExpressions
MatrixExpressions * matrixExpressions
a pointer to the matrixExpressions object
Definition: OSInstance.h:1901
Constraint::name
std::string name
name is the name of the constraint
Definition: OSInstance.h:229
Objective::weight
double weight
weight is the weight applied to the given objective function, 1.0 by default
Definition: OSInstance.h:167
Variable::~Variable
~Variable()
The Variable class destructor.
InstanceData::matrixProgramming
MatrixProgramming * matrixProgramming
matrixProgramming is a pointer to a MatrixProgramming object
Definition: OSInstance.h:2221
OSInstance::getNumberOfMatrixVariables
int getNumberOfMatrixVariables()
Get the number of matrix variables.
RotatedQuadraticCone::~RotatedQuadraticCone
~RotatedQuadraticCone()
The RotatedQuadraticCone class destructor.
MatrixExpressions::expr
MatrixExpression ** expr
a pointer to an array of linear and nonlinear expressions that evaluate to matrices
Definition: OSInstance.h:1864
MatrixConstraints::IsEqual
bool IsEqual(MatrixConstraints *that)
A function to check for the equality of two objects.
Matrices::matrix
OSMatrix ** matrix
matrix is a pointer to an array of OSMatrix object pointers
Definition: OSInstance.h:499
OSInstance::setMatrixNumber
bool setMatrixNumber(int number)
set the number of matrices
DualCone::numberOfOtherIndexes
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Definition: OSInstance.h:1421
InstanceData::IsEqual
bool IsEqual(InstanceData *that)
A function to check for the equality of two objects.
Nl::~Nl
~Nl()
default destructor.
LinearConstraintCoefficients::colIdx
IntVector * colIdx
a pointer of column indices if the problem is stored by row
Definition: OSInstance.h:312
MatrixObjectives::numberOfMatrixObj
int numberOfMatrixObj
numberOfMatrixObj gives the number of <matrixObj> children
Definition: OSInstance.h:1719
MatrixObj::IsEqual
bool IsEqual(MatrixObj *that)
A function to check for the equality of two objects.
Cone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:543
NonnegativeCone::getConeName
virtual std::string getConeName()
OSInstance::getMatrixBlockInColumnMajorForm
GeneralSparseMatrix * getMatrixBlockInColumnMajorForm(int n, int columnIdx, int rowIdx)
Get the (nonzero) elements of the matrix in symmetric block form.
Cones::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
IntersectionCone::numberOfRows
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
Definition: OSInstance.h:1337
OSInstance::getNumberOfQuadraticRowIndexes
int getNumberOfQuadraticRowIndexes()
Get the number of rows which have a quadratic term.
QuadraticCoefficients::IsEqual
bool IsEqual(QuadraticCoefficients *that)
A function to check for the equality of two objects.
OSInstance::getNumberOfBinaryVariables
int getNumberOfBinaryVariables()
getNumberOfBinaryVariables
IntersectionCone::getConeInXML
virtual std::string getConeInXML()
Write an IntersectionCone object in XML format.
OSnLNode.h
This file defines the OSnLNode class along with its derived classes.