OS  2.10.1
OSMatrix.h
Go to the documentation of this file.
1 /* $Id: OSMatrix.h 3172 2010-02-05 04:59:24Z Gassmann $ */
15 #ifndef OSMATRIX_H
16 #define OSMATRIX_H
17 
18 #include "OSConfig.h"
19 #include "OSParameters.h"
20 #include "OSnLNode.h"
21 #include "OSExpressionTree.h"
22 
23 #include <string>
24 #include <vector>
25 
26 
27 /*********************************************************************************
28  *
29  * This file contains a number of classes to represent a matrix
30  * This construct is new to OS starting June 2014 (trunk version 4811)
31  *
32  *********************************************************************************/
33 
40 class OSnLNode;
41 class OSnLMNode;
43 
44 
51 {
52 public:
59 
65 
70  unsigned int inumberOfChildren;
71 
77 
79  MatrixNode();
80 
82  virtual ~MatrixNode();
83 
88 
92  virtual ENUM_MATRIX_TYPE getMatrixType() = 0;
93 
97  virtual std::string getNodeName() = 0;
98 
107  virtual std::string getMatrixNodeInXML() = 0;
108 
117  std::vector<MatrixNode*> getPrefixFromNodeTree();
118 
119  /*
120  * <p>
121  * Called by getPrefixFromNodeTree().
122  * This method calls itself recursively and
123  * generates a vector of pointers to MatrixNode in prefix
124  * </p>
125  * @param a pointer prefixVector to a vector of pointers of MatrixNodes
126  * @return a vector of pointers to MatrixNode in prefix.
127  */
128  std::vector<MatrixNode*> preOrderMatrixNodeTraversal( std::vector<MatrixNode*> *prefixVector);
129 
138  std::vector<MatrixNode*> getPostfixFromNodeTree();
139 
149  std::vector<MatrixNode*> postOrderMatrixNodeTraversal( std::vector<MatrixNode*> *postfixVector);
150 
158  virtual MatrixNode *cloneMatrixNode() = 0;
159 
171  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols) = 0;
172 
176  virtual bool IsEqual(MatrixNode *that);
177 
186  bool setRandom(double density, bool conformant, int iMin, int iMax);
187 
193  bool deepCopyFrom(MatrixNode *that);
194 };//end MatrixNode
195 
196 
210 {
211 public:
214 
216  virtual ~MatrixConstructor();
217 
222  //bool IsEqual(MatrixConstructor *that);
223 
232  //bool setRandom(double density, bool conformant, int iMin, int iMax);
233 
239  //bool deepCopyFrom(MatrixConstructor *that);
240 };//class MatrixConstructor
241 
242 
249 {
250 public:
255  bool rowMajor;
256 
262 
267 
270 
271 
272  MatrixElements();
273  virtual ~MatrixElements();
274 
278  bool getRowMajor();
279 
288  //virtual std::string getMatrixElementsInXML() = 0;
289 
293  bool IsEqual(MatrixElements *that);
294 
295 #if 0
296 
304  bool setRandom(double density, bool conformant, int iMin, int iMax);
305 
311  bool deepCopyFrom(MatrixElements *that);
312 #endif
313 };//class MatrixElements
314 
315 
322 {
323 public:
328 
330  virtual ~MatrixElementValues();
331 
340  //virtual std::string getMatrixValuesInXML() = 0;
341 
346  //bool IsEqual(MatrixElementValues *that);
347 
356  //bool setRandom(double density, bool conformant, int iMin, int iMax);
357 
363  virtual bool deepCopyFrom(MatrixElementValues *that);
364 };//class MatrixElementValues
365 
366 // ------------------ concrete classes start here ------------------------------
367 
374 {
375 public:
376  int idx;
377  double coef;
378 
381 
385  bool IsEqual(LinearMatrixElementTerm *that);
386 
395  bool setRandom(double density, bool conformant, int iMin, int iMax);
396 
403 };//class LinearMatrixElementTerm
404 
412 {
413 public:
415  double constant;
416 
418 
421 
425  bool IsEqual(LinearMatrixElement *that);
426 
435  bool setRandom(double density, bool conformant, int iMin, int iMax);
436 
442  bool deepCopyFrom(LinearMatrixElement *that);
443 };//class LinearMatrixElement
444 
445 
454 {
455 public:
461 
467 
469  double value;
470 
473 
478 
487  bool setRandom(double density, bool conformant, int iMin, int iMax);
488 
495 };//class ConReferenceMatrixElement
496 
497 
502 {
503 public:
504  double *el;
505 
508 
512  //virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType();
513 
517  //virtual ENUM_MATRIX_TYPE getMatrixType();
518 
522  //virtual std::string getNodeName();
523 
532  //virtual std::string getMatrixValuesInXML();
533 
538  bool IsEqual(ConstantMatrixValues *that);
539 
548  bool setRandom(double density, bool conformant, int iMin, int iMax);
549 
556 };//class ConstantMatrixValues
557 
558 
564 {
565 public:
569  int *el;
570 
573 
578  bool IsEqual(VarReferenceMatrixValues *that);
579 
588  bool setRandom(double density, bool conformant, int iMin, int iMax);
589 
595  virtual bool deepCopyFrom(VarReferenceMatrixValues *that);
596 };//class VarReferenceMatrixValues
597 
598 
603 {
604 public:
606 
609 
614  bool IsEqual(LinearMatrixValues *that);
615 
625  bool setRandom(double density, bool conformant, int iMin, int iMax);
626 
632  virtual bool deepCopyFrom(LinearMatrixValues *that);
633 };//class LinearMatrixValues
634 
635 
640 {
641 public:
643 
646 
651  bool IsEqual(GeneralMatrixValues *that);
652 
661  bool setRandom(double density, bool conformant, int iMin, int iMax);
662 
668  virtual bool deepCopyFrom(GeneralMatrixValues *that);
669 };//class GeneralMatrixValues
670 
671 
676 {
677 public:
678  int *el;
679 
682 
687  bool IsEqual(ObjReferenceMatrixValues *that);
688 
697  bool setRandom(double density, bool conformant, int iMin, int iMax);
698 
704  virtual bool deepCopyFrom(ObjReferenceMatrixValues *that);
705 };//class ObjReferenceMatrixValues
706 
707 
712 {
713 public:
718 
721 
725  bool IsEqual(ConReferenceMatrixValues *that);
726 
735  bool setRandom(double density, bool conformant, int iMin, int iMax);
736 
742  virtual bool deepCopyFrom(ConReferenceMatrixValues *that);
743 };//class ConReferenceMatrixValues
744 
745 
750 {
751 public:
754 
757 
758 
763 
767  virtual std::string getNodeName();
768 
773 
782  virtual std::string getMatrixNodeInXML();
783 
795  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
796 
805 
810  bool IsEqual(ConstantMatrixElements *that);
811 
820  bool setRandom(double density, bool conformant, int iMin, int iMax);
821 
828 };//class ConstantMatrixElements
829 
830 
836 {
837 public:
840 
843 
848 
853 
857  virtual std::string getNodeName();
866  virtual std::string getMatrixNodeInXML();
867 
879  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
880 
889 
894 
903  bool setRandom(double density, bool conformant, int iMin, int iMax);
904 
911 };//class VarReferenceMatrixElements
912 
913 
918 {
919 public:
926 
929 
930 
935 
940 
944  virtual std::string getNodeName();
953  virtual std::string getMatrixNodeInXML();
954 
966  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
967 
976 
981  bool IsEqual(LinearMatrixElements *that);
982 
991  bool setRandom(double density, bool conformant, int iMin, int iMax);
992 
999 };//class LinearMatrixElements
1000 
1001 
1006 {
1007 public:
1012 
1015 
1016 
1021 
1025  virtual ENUM_MATRIX_TYPE getMatrixType();
1026 
1030  virtual std::string getNodeName();
1039  virtual std::string getMatrixNodeInXML();
1040 
1052  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
1053 
1062 
1066  bool IsEqual(GeneralMatrixElements *that);
1067 
1076  bool setRandom(double density, bool conformant, int iMin, int iMax);
1077 
1083  bool deepCopyFrom(GeneralMatrixElements *that);
1084 };//class GeneralMatrixElements
1085 
1086 
1092 {
1093 public:
1096 
1099 
1100 
1105 
1109  virtual ENUM_MATRIX_TYPE getMatrixType();
1110 
1114  virtual std::string getNodeName();
1115 
1124  virtual std::string getMatrixNodeInXML();
1125 
1137  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
1138 
1147 
1152  bool IsEqual(ObjReferenceMatrixElements *that);
1153 
1162  bool setRandom(double density, bool conformant, int iMin, int iMax);
1163 
1170 };//class ObjReferenceMatrixElements
1171 
1172 
1178 {
1179 public:
1182 
1185 
1186 
1191 
1195  virtual ENUM_MATRIX_TYPE getMatrixType();
1196 
1200  virtual std::string getNodeName();
1201 
1210  virtual std::string getMatrixNodeInXML();
1211 
1223  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
1224 
1233 
1238  bool IsEqual(ConReferenceMatrixElements *that);
1239 
1248  bool setRandom(double density, bool conformant, int iMin, int iMax);
1249 
1256 };//class ConReferenceMatrixElements
1257 
1258 
1265 {
1266 public:
1276 
1279 
1280 
1285 
1289  virtual ENUM_MATRIX_TYPE getMatrixType();
1290 
1294  virtual std::string getNodeName();
1295 
1306  virtual std::string getMatrixNodeInXML();
1307 
1319  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
1320 
1329 
1334 
1343  bool setRandom(double density, bool conformant, int iMin, int iMax);
1344 
1351 };//class MixedRowReferenceMatrixElements
1352 
1353 
1359 {
1360 public:
1365 
1371 
1374 
1379 
1383  virtual std::string getNodeName();
1384 
1385 
1389  virtual ENUM_MATRIX_TYPE getMatrixType();
1390 
1399  virtual std::string getMatrixNodeInXML();
1400 
1410  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
1411 
1417 
1422  bool IsEqual(MatrixTransformation *that);
1423 
1432  bool setRandom(double density, bool conformant, int iMin, int iMax);
1433 
1439  bool deepCopyFrom(MatrixTransformation *that);
1440 };//class MatrixTransformation
1441 
1442 //class MatrixBlock; //forward declaration
1443 
1450 {
1451 public:
1457 
1462 
1463  MatrixBlocks();
1464  ~MatrixBlocks();
1465 
1470 
1474  virtual std::string getNodeName();
1475 
1479  virtual ENUM_MATRIX_TYPE getMatrixType();
1480 
1489  virtual std::string getMatrixNodeInXML();
1490 
1500  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols) ;
1501 
1506  virtual MatrixBlocks *cloneMatrixNode();
1507 
1511  bool IsEqual(MatrixBlocks *that);
1512 
1521  bool setRandom(double density, bool conformant, int iMin, int iMax);
1522 
1528  bool deepCopyFrom(MatrixBlocks *that);
1529 };//class MatrixBlocks
1530 
1531 
1537 {
1538 public:
1543 
1548 
1554 
1561 
1568 
1573 
1578 
1580  BaseMatrix();
1581  ~BaseMatrix();
1582 
1587 
1591  virtual std::string getNodeName();
1592 
1596  virtual ENUM_MATRIX_TYPE getMatrixType();
1597 
1606  virtual std::string getMatrixNodeInXML();
1607 
1617  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols) ;
1618 
1623  virtual BaseMatrix *cloneMatrixNode();
1624 
1628  bool IsEqual(BaseMatrix *that);
1629 
1630 #if 0
1631 
1639  bool setRandom(double density, bool conformant, int iMin, int iMax);
1640 
1646  bool deepCopyFrom(BaseMatrix *that);
1647 #endif
1648 };//class BaseMatrix
1649 
1650 
1655 {
1656 public:
1657 
1663 
1669 
1675 
1681 
1687 
1692 
1697 
1702  int* start;
1703 
1708  int* index;
1709 
1715 
1724 
1729 
1739  GeneralSparseMatrix(bool isColumnMajor, int startSize, int valueSize, ENUM_MATRIX_TYPE type);
1740 
1746 
1752  bool display(int secondaryDim);
1753 
1758  bool isDiagonal();
1759 }; //GeneralSparseMatrix
1760 
1761 
1769 {
1770 public:
1776 
1782 
1788 
1794 
1802 
1810 
1816 
1824 
1832 
1839 
1845 
1854  ExpandedMatrixBlocks(bool isColumnMajor_, int startSize, int valueSize);
1855 
1861 
1867  bool display(int secondaryDim);
1868 
1875  GeneralSparseMatrix* getBlock(int rowIdx, int colIdx);
1876 
1881  bool isBlockDiagonal();
1882 }; //ExpandedMatrixBlocks
1883 
1884 
1889 class MatrixType : public MatrixNode
1890 {
1891 public:
1897 
1903 
1906 
1913  std::vector<ExpandedMatrixBlocks*> ExpandedMatrixByBlocks;
1914 
1915 private:
1919  int* m_miRowPartition;
1920 
1924  int m_iRowPartitionSize;
1925 
1929  int* m_miColumnPartition;
1930 
1934  int m_iColumnPartitionSize;
1935 
1939  bool m_bHaveRowPartition;
1940 
1944  bool m_bHaveColumnPartition;
1945 
1946 public:
1947  MatrixType();
1948  virtual ~MatrixType();
1949 
1950 
1954  //virtual bool isDiagonal();
1955 
1965  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols) ;
1966 
1970  bool matrixHasBase();
1971  bool matrixHasElements();
1972  bool matrixHasTransformations();
1973  bool matrixHasBlocks();
1974  int getNumberOfElementConstructors();
1975  int getNumberOfTransformationConstructors();
1976  int getNumberOfBlocksConstructors();
1977 
1978  GeneralSparseMatrix* getMatrixCoefficientsInColumnMajor();
1979  GeneralSparseMatrix* getMatrixCoefficientsInRowMajor();
1980  GeneralSparseMatrix* getMatrixBlockInColumnMajorForm(int columnIdx, int rowIdx);
1981 
1988  bool printExpandedMatrix(bool rowMajor);
1989 
1997  int getRowPartitionSize();
1998 
2005  int* getRowPartition();
2006 
2014  int getColumnPartitionSize();
2015 
2022  int* getColumnPartition();
2023 
2024 
2034  virtual bool expandElements(bool rowMajor);
2035 
2043  GeneralSparseMatrix* convertToOtherMajor(bool isColumnMajor);
2044 
2057  bool processBlockPartition();
2058 
2073  virtual bool processBlocks(bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry);
2074 
2091  virtual bool processBlocks(int* rowOffset, int rowOffsetSize, int* colOffset,
2092  int colOffsetSize, bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry);
2093 
2112  GeneralSparseMatrix* extractBlock(int firstrow, int firstcol, int lastrow, int lastcol,
2113  bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry);
2114 
2136  ExpandedMatrixBlocks* getBlocks(int* rowPartition, int rowPartitionSize,
2137  int* colPartition, int colPartitionSize,
2138  bool rowMajor, bool appendToBlockArray);
2139 
2152  ExpandedMatrixBlocks* disassembleMatrix(int* rowPartition, int rowPartitionSize,
2153  int* colPartition, int colPartitionSize,
2154  bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry);
2155 
2159  bool IsEqual(MatrixType *that);
2160 
2169  bool setRandom(double density, bool conformant, int iMin, int iMax);
2170 
2177  bool deepCopyFrom(MatrixType *that);
2178 };// class MatrixType
2179 
2180 
2185 class OSMatrix : public MatrixType
2186 {
2187 public:
2188  int idx;
2189  std::string name;
2190 
2191 public:
2192  OSMatrix();
2193  ~OSMatrix();
2194 
2205  OSMatrix* createConstructorTreeFromPrefix(std::vector<MatrixNode*> mtxConstructorVec);
2206 
2211 
2215  virtual std::string getNodeName();
2216 
2220  virtual ENUM_MATRIX_TYPE getMatrixType();
2221 
2236  //virtual bool processBlocks(int* rowOffset, int* colOffset,
2237  // bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry);
2238 
2248  virtual bool expandElements(bool rowMajor);
2249 
2259  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols) ;
2260 
2264  bool isBlockDiagonal();
2265 
2285  bool setMatrix(std::string name, int numberOfRows, int numberOfColumns,
2287  unsigned int inumberOfChildren, MatrixNode **m_mChildren);
2288 
2289 
2298  virtual std::string getMatrixNodeInXML();
2299 
2304  virtual OSMatrix *cloneMatrixNode();
2305 
2310  bool IsEqual(OSMatrix *that);
2311 
2321  bool setRandom(double density, bool conformant, int iMin, int iMax);
2322 
2328  bool deepCopyFrom(OSMatrix *that);
2329 };// class OSMatrix
2330 
2331 
2337 {
2338 public:
2340 
2341 public:
2344 
2353  virtual std::string getMatrixNodeInXML();
2354 
2360 
2365  bool IsEqual(OSMatrixWithMatrixVarIdx *that);
2366 
2376  bool setRandom(double density, bool conformant, int iMin, int iMax);
2377 
2384 };// class OSMatrixWithMatrixVarIdx
2385 
2386 
2392 {
2393 public:
2395 
2396 public:
2399 
2408  virtual std::string getMatrixNodeInXML();
2409 
2415 
2420  bool IsEqual(OSMatrixWithMatrixObjIdx *that);
2421 
2431  bool setRandom(double density, bool conformant, int iMin, int iMax);
2432 
2439 };// class OSMatrixWithMatrixObjIdx
2440 
2446 {
2447 public:
2449 
2450 public:
2453 
2462  virtual std::string getMatrixNodeInXML();
2463 
2469 
2474  bool IsEqual(OSMatrixWithMatrixConIdx *that);
2475 
2485  bool setRandom(double density, bool conformant, int iMin, int iMax);
2486 
2493 };// class OSMatrixWithMatrixConIdx
2494 
2495 
2500 class MatrixBlock : public MatrixType
2501 {
2502 public:
2505 
2506  MatrixBlock();
2507  ~MatrixBlock();
2508 
2513 
2517  virtual std::string getNodeName();
2518 
2519 
2523  virtual ENUM_MATRIX_TYPE getMatrixType();
2524 
2533  virtual std::string getMatrixNodeInXML();
2534 
2544  virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols);
2545 
2555  virtual bool expandElements(bool rowMajor);
2556 
2561  virtual MatrixBlock *cloneMatrixNode();
2562 
2567  bool IsEqual(MatrixBlock *that);
2568 
2578  bool setRandom(double density, bool conformant, int iMin, int iMax);
2579 
2585  bool deepCopyFrom(MatrixBlock *that);
2586 };// class MatrixBlock
2587 
2588 
2595 ScalarExpressionTree* convertToGeneralMatrixElement(int refIdx, bool varRef); // varref or objref
2599 #endif
virtual ENUM_MATRIX_TYPE getMatrixType()=0
int baseMatrixIdx
the index of the base matrix
Definition: OSMatrix.h:1542
int * index
index holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
Definition: OSMatrix.h:1708
ScalarExpressionTree ** el
Definition: OSMatrix.h:642
double value
This element contains the value.
Definition: OSMatrix.h:469
ENUM_CONREFERENCE_VALUETYPE valueType
Several different types of values can be derived from a problem constraint.
Definition: OSMatrix.h:466
bool deepCopyFrom(MatrixNode *that)
A function to make a deep copy of an instance of this class.
int numberOfEl
each type of value is stored as an array named "el".
Definition: OSMatrix.h:327
int idx
Definition: OSMatrix.h:2188
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
Definition: OSMatrix.h:248
The OSnLMNode Class for nonlinear expressions involving matrices.
Definition: OSnLNode.h:1760
double scalarMultiplier
to allow the base matrix to be scaled before it is attached to the target matrix
Definition: OSMatrix.h:1577
int conReference
contains a reference to a row of the problem (objective if negative, constraint otherwise) ...
Definition: OSMatrix.h:460
a data structure to represent a MatrixType object (from which we derive OSMatrix and MatrixBlock) ...
Definition: OSMatrix.h:1889
virtual ~MatrixNode()
destructor
ConstantMatrixValues * value
The value array of the (nonzero) constant elements.
Definition: OSMatrix.h:753
int * el
Each el is a reference to a constraint defined in the <constraints> section of the OSiL file...
Definition: OSMatrix.h:569
MatrixElementValues * value
value holds a general array of value elements in the matrix, which could be constants, linear expressions, general nonlinear expressions, variable, constraint or objective references, etc.
Definition: OSMatrix.h:1723
int rowOffsetSize
These two parameters give the size of the rowOffset and colOffset arrays, respectively.
Definition: OSMatrix.h:1814
a sparse matrix data structure for matrices that can hold nonconstant values
Definition: OSMatrix.h:1654
bool isRowMajor
isRowMajor holds whether the (nonzero) values holding the data are stored by columnrow.
Definition: OSMatrix.h:1787
int baseMatrixStartRow
to select the position of the upper left corner of the portion of the base matrix that is to be selec...
Definition: OSMatrix.h:1559
int * start
start holds an integer array of start elements in the matrix, which points to the start of a column (...
Definition: OSMatrix.h:1702
IntVector * index
The index array of the (nonzero) elements.
Definition: OSMatrix.h:269
a data structure to represent the linear expressions in a LinearMatrixElement object ...
Definition: OSMatrix.h:602
ConReferenceMatrixElement * convertToConReferenceMatrixElement(int objref)
IntVector * start
A vector listing the row or column starts.
Definition: OSMatrix.h:266
ScalarExpressionTree * convertToGeneralMatrixElement(double val)
to represent the nonzeros in an objReferenceMatrix element
Definition: OSMatrix.h:675
VarReferenceMatrixValues * value
The variable references (indexes of core variables) of the elements.
Definition: OSMatrix.h:839
MatrixNode()
default constructor
ENUM_MATRIX_SYMMETRY
Definition: OSParameters.h:735
int baseMatrixEndCol
Definition: OSMatrix.h:1567
to represent the nonzeros in a constantMatrix element
Definition: OSMatrix.h:501
A concrete class that is used to store a specific type of matrix values, references to variable index...
Definition: OSMatrix.h:563
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
Definition: OSMatrix.h:321
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)=0
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor...
int targetMatrixFirstCol
Definition: OSMatrix.h:1553
ENUM_MATRIX_SYMMETRY symmetry
To track the type of symmetry present in the matrix or block.
Definition: OSMatrix.h:1896
ENUM_NL_EXPR_SHAPE shape
shape can be used to specify linearity etc.
Definition: OSMatrix.h:1370
int baseMatrixStartCol
Definition: OSMatrix.h:1560
ENUM_NL_EXPR_SHAPE
Definition: OSParameters.h:830
ConReferenceMatrixValues * value
The row references (indexes of core rows plus value type) of the elements.
Definition: OSMatrix.h:1275
this class extends OSMatrix for use, e.g., in the matrixObj section of OSoL and OSrL ...
Definition: OSMatrix.h:2391
ENUM_MATRIX_TYPE vType
vType holds the type of values found in the value array.
Definition: OSMatrix.h:1714
ENUM_CONREFERENCE_VALUETYPE
An enum to track the type of value contained in a reference to a constraint.
Definition: OSParameters.h:703
bool b_deleteIndexArray
b_deleteIndexArray is true if we delete the index array in garbage collection — set to true by defa...
Definition: OSMatrix.h:1668
int * rowOffset
rowOffset gives the row offsets of the block decomposition It does not have to correspond to the row ...
Definition: OSMatrix.h:1801
a data structure to represent the nonzero values in a linearMatrix element
Definition: OSMatrix.h:917
std::vector< MatrixNode * > getPrefixFromNodeTree()
int startSize
startSize is the dimension of the starts array
Definition: OSMatrix.h:1691
this class extends OSMatrix for use, e.g., in the matrixVar section of OSoL and OSrL ...
Definition: OSMatrix.h:2336
a data structure to represent row reference elements in a MatrixType object Each nonzero element refe...
Definition: OSMatrix.h:1264
int numberOfValues
numberOfValues records the number of entries in the arrays that make up the instance of nonzeros ...
Definition: OSMatrix.h:261
GeneralSparseMatrix * ExpandedMatrixInRowMajorForm
The matrix can be held in expanded form by rows or by columns and in a number of ways stored by block...
Definition: OSMatrix.h:1911
OSMatrix * baseMatrix
a pointer to the base matrix
Definition: OSMatrix.h:1547
LinearMatrixElementTerm ** varIdx
Definition: OSMatrix.h:417
ConReferenceMatrixValues * value
The constraint references (indexes of core constraints and value types) of the elements.
Definition: OSMatrix.h:1181
LinearMatrixElement ** el
Definition: OSMatrix.h:605
int blockColIdx
Definition: OSMatrix.h:2504
ObjReferenceMatrixValues * value
The objective references (indexes of core objectives) of the elements.
Definition: OSMatrix.h:1095
int valueSize
valueSize is the dimension of the index and value arrays
Definition: OSMatrix.h:1696
Used to hold part of the instance in memory.
virtual std::string getNodeName()=0
LinearMatrixValues * value
The values are expressions of the form a_0 + a_1 x_{i_1} * a_2 x_{i_2} + ...
Definition: OSMatrix.h:925
a data structure to represent row reference elements in a MatrixType object Each nonzero element is o...
Definition: OSMatrix.h:1177
int numberOfRows
Definition: OSMatrix.h:1904
std::vector< MatrixNode * > postOrderMatrixNodeTraversal(std::vector< MatrixNode *> *postfixVector)
ENUM_MATRIX_TYPE vType
vType holds the type of all (nonzero) values in the collection of blocks contained in this set of blo...
Definition: OSMatrix.h:1781
this class extends OSMatrix for use, e.g., in the matrixCon section of OSoL and OSrL ...
Definition: OSMatrix.h:2445
a data structure to represent the nonzeroes of a matrix in a blockwise fashion.
Definition: OSMatrix.h:1449
int * blockRows
blockRows holds an integer array of the row to which a block belongs.
Definition: OSMatrix.h:1823
unsigned int inumberOfChildren
inumberOfChildren is the number of MatrixNode child elements For the matrix types (OSMatrix and Matri...
Definition: OSMatrix.h:70
int blockNumber
blockNumber gives the number of blocks (which is the size of the blockRows and blockColumns arrays)...
Definition: OSMatrix.h:1793
GeneralSparseMatrix * ExpandedMatrixInColumnMajorForm
Definition: OSMatrix.h:1912
int baseMatrixEndRow
to select the position of the lower right corner of the portion of the base matrix that is to be sele...
Definition: OSMatrix.h:1566
MatrixNode ** m_mChildren
m_mChildren holds all the children, that is, nodes used in the definition or construction of the curr...
Definition: OSMatrix.h:76
OSnLMNode * transformation
A transformation is essentially an expression tree that evaluates to a matrix.
Definition: OSMatrix.h:1364
a data structure to represent the constant elements in a MatrixType object
Definition: OSMatrix.h:749
a data structure to represent the nonzeros in a conReferenceMatrix element
Definition: OSMatrix.h:711
a data structure to represent variable reference elements in a MatrixType object Each nonzero element...
Definition: OSMatrix.h:835
a data structure to represent a point of departure for constructing a matrix by modifying parts of a ...
Definition: OSMatrix.h:1536
a data structure to represent the nonzeros in a generalMatrix element
Definition: OSMatrix.h:639
a data structure to represent an expression in a linearMatrix element A LinearMatrixElement is a (fin...
Definition: OSMatrix.h:411
a data structure to represent an entry in a conReferenceMatrix element, which consists of a constrain...
Definition: OSMatrix.h:453
virtual bool IsEqual(MatrixNode *that)
A function to check for the equality of two objects.
ENUM_MATRIX_SYMMETRY symmetry
To track the type of symmetry present in the matrix or block.
Definition: OSMatrix.h:1686
an integer Vector data structure
Definition: OSGeneral.h:469
a generic class from which we derive matrix constructors (BaseMatrix, MatrixElements, MatrixTransformation and MatrixBlocks) as well as matrix types (OSMatrix and MatrixBlock).
Definition: OSMatrix.h:50
std::vector< ExpandedMatrixBlocks * > ExpandedMatrixByBlocks
Definition: OSMatrix.h:1913
a data structure to represent objective reference elements in a MatrixType object Each nonzero elemen...
Definition: OSMatrix.h:1091
ENUM_MATRIX_TYPE matrixType
matrixType tracks the type of elements contained in this MatrixNode, which may be useful in solver se...
Definition: OSMatrix.h:58
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
int numberOfColumns
Definition: OSMatrix.h:1905
virtual std::string getMatrixNodeInXML()=0
a sparse matrix data structure for matrices that can hold nonconstant values and have block structure...
Definition: OSMatrix.h:1768
bool isRowMajor
isRowMajor holds whether the matrix is stored by row.
Definition: OSMatrix.h:1680
a data structure to represent the nonzeroes of a matrix by transformation from other (previously defi...
Definition: OSMatrix.h:1358
ENUM_MATRIX_CONSTRUCTOR_TYPE
Definition: OSParameters.h:776
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
This file defines the OSnLNode class along with its derived classes.
int * colOffset
colOffset gives the column offsets of the block decomposition It does not have to correspond to the c...
Definition: OSMatrix.h:1809
LinearMatrixElement * convertToLinearMatrixElement(double val)
Some methods to convert one type of matrix element into another.
std::string name
Definition: OSMatrix.h:2189
bool b_deleteValueArray
b_deleteValueArray is true if we delete the value array in garbage collection — set to true by defa...
Definition: OSMatrix.h:1674
bool rowMajor
To indicate whether the matrix elements are stored in row major form or column major form...
Definition: OSMatrix.h:255
int * blockColumns
blockColumns holds an integer array of the column to which a block belongs.
Definition: OSMatrix.h:1831
IntVector * rowOffset
An array listing the top row of each block within the larger matrix.
Definition: OSMatrix.h:1461
bool b_deleteStartArray
b_deleteStartArray is true if we delete the start array in garbage collection — set to true by defa...
Definition: OSMatrix.h:1662
IntVector * colOffset
An array listing the leftmost column of each block within the larger matrix It is assumed that the bl...
Definition: OSMatrix.h:1456
GeneralMatrixValues * value
The values are general nonlinear expressions.
Definition: OSMatrix.h:1011
a data structure to represent the nonzero values in a generalMatrix element
Definition: OSMatrix.h:1005
a data structure to represent a MatrixBlock object (derived from MatrixType)
Definition: OSMatrix.h:2500
ENUM_MATRIX_TYPE type
To track the type of values present in the matrix or block.
Definition: OSMatrix.h:1902
std::vector< MatrixNode * > getPostfixFromNodeTree()
a data structure to represent a matrix object (derived from MatrixType)
Definition: OSMatrix.h:2185
std::vector< MatrixNode * > preOrderMatrixNodeTraversal(std::vector< MatrixNode *> *prefixVector)
bool baseTranspose
to allow the base matrix to be transposed before it is attached to the target matrix ...
Definition: OSMatrix.h:1572
a data structure to describe one step in the construction of a matrix.
Definition: OSMatrix.h:209
a data structure to represent a term in a linearMatrix element A term has the form c*x_{k}...
Definition: OSMatrix.h:373
ENUM_MATRIX_CONSTRUCTOR_TYPE nType
nType is a unique integer assigned to each type of matrix node (see OSParameters.h) ...
Definition: OSMatrix.h:64
GeneralSparseMatrix ** blocks
blocks holds the blocks that make up the matrix.
Definition: OSMatrix.h:1838
int blockRowIdx
Definition: OSMatrix.h:2503
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
Definition: OSMatrix.h:1775
ConReferenceMatrixElement ** el
el contains the indices of the matrix constraints along with the valueType.
Definition: OSMatrix.h:717
virtual MatrixNode * cloneMatrixNode()=0
int targetMatrixFirstRow
to pinpoint the position of the upper left corner of the base matrix within the target matrix ...
Definition: OSMatrix.h:1552
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:179