OS  2.10.2
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();
1977 
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
GeneralSparseMatrix::b_deleteIndexArray
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
OSMatrix::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
ObjReferenceMatrixValues::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSConfig.h
OSMatrixWithMatrixConIdx::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSExpressionTree.h
LinearMatrixElementTerm
a data structure to represent a term in a linearMatrix element A term has the form c*x_{k},...
Definition: OSMatrix.h:373
OSMatrixWithMatrixObjIdx::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
MatrixNode::getPrefixFromNodeTree
std::vector< MatrixNode * > getPrefixFromNodeTree()
BaseMatrix
a data structure to represent a point of departure for constructing a matrix by modifying parts of a ...
Definition: OSMatrix.h:1536
MatrixType::numberOfColumns
int numberOfColumns
Definition: OSMatrix.h:1905
MatrixBlock::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSMatrixWithMatrixConIdx::IsEqual
bool IsEqual(OSMatrixWithMatrixConIdx *that)
A function to check for the equality of two objects.
ConReferenceMatrixElement::~ConReferenceMatrixElement
~ConReferenceMatrixElement()
LinearMatrixElements::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
MatrixTransformation::IsEqual
bool IsEqual(MatrixTransformation *that)
A function to check for the equality of two objects.
ConstantMatrixElements::ConstantMatrixElements
ConstantMatrixElements()
GeneralMatrixElements::cloneMatrixNode
virtual GeneralMatrixElements * cloneMatrixNode()
ConReferenceMatrixElements
a data structure to represent row reference elements in a MatrixType object Each nonzero element is o...
Definition: OSMatrix.h:1177
BaseMatrix::baseTranspose
bool baseTranspose
to allow the base matrix to be transposed before it is attached to the target matrix
Definition: OSMatrix.h:1572
MatrixConstructor
a data structure to describe one step in the construction of a matrix. To facilitate parsing of compl...
Definition: OSMatrix.h:209
ConstantMatrixValues::IsEqual
bool IsEqual(ConstantMatrixValues *that)
A function to check for the equality of two objects.
MixedRowReferenceMatrixElements::~MixedRowReferenceMatrixElements
~MixedRowReferenceMatrixElements()
ENUM_NL_EXPR_SHAPE
ENUM_NL_EXPR_SHAPE
Definition: OSParameters.h:830
OSMatrix::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OSMatrixWithMatrixObjIdx::cloneMatrixNode
virtual OSMatrixWithMatrixObjIdx * cloneMatrixNode()
The implementation of the virtual functions.
OSMatrixWithMatrixObjIdx
this class extends OSMatrix for use, e.g., in the matrixObj section of OSoL and OSrL
Definition: OSMatrix.h:2391
MixedRowReferenceMatrixElements::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
ConReferenceMatrixElements::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
ConReferenceMatrixElements::IsEqual
bool IsEqual(ConReferenceMatrixElements *that)
A function to check for the equality of two objects.
GeneralSparseMatrix::b_deleteValueArray
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
OSMatrixWithMatrixVarIdx::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ConReferenceMatrixValues::deepCopyFrom
virtual bool deepCopyFrom(ConReferenceMatrixValues *that)
A function to make a deep copy of an instance of this class.
ExpandedMatrixBlocks::vType
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
MatrixType::getMatrixCoefficientsInColumnMajor
GeneralSparseMatrix * getMatrixCoefficientsInColumnMajor()
MatrixBlock::deepCopyFrom
bool deepCopyFrom(MatrixBlock *that)
A function to make a deep copy of an instance of this class.
OSMatrixWithMatrixConIdx::cloneMatrixNode
virtual OSMatrixWithMatrixConIdx * cloneMatrixNode()
The implementation of the virtual functions.
OSMatrix::getNodeName
virtual std::string getNodeName()
MatrixElements::MatrixElements
MatrixElements()
MatrixBlocks::deepCopyFrom
bool deepCopyFrom(MatrixBlocks *that)
A function to make a deep copy of an instance of this class.
MixedRowReferenceMatrixElements::value
ConReferenceMatrixValues * value
The row references (indexes of core rows plus value type) of the elements.
Definition: OSMatrix.h:1275
OSMatrixWithMatrixVarIdx::matrixVarIdx
int matrixVarIdx
Definition: OSMatrix.h:2339
MatrixBlocks::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
LinearMatrixElements::cloneMatrixNode
virtual LinearMatrixElements * cloneMatrixNode()
ObjReferenceMatrixValues::deepCopyFrom
virtual bool deepCopyFrom(ObjReferenceMatrixValues *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
LinearMatrixElements::~LinearMatrixElements
~LinearMatrixElements()
ExpandedMatrixBlocks::colOffset
int * colOffset
colOffset gives the column offsets of the block decomposition It does not have to correspond to the c...
Definition: OSMatrix.h:1809
LinearMatrixElementTerm::IsEqual
bool IsEqual(LinearMatrixElementTerm *that)
A function to check for the equality of two objects.
OSMatrixWithMatrixVarIdx::cloneMatrixNode
virtual OSMatrixWithMatrixVarIdx * cloneMatrixNode()
The implementation of the virtual functions.
OSMatrixWithMatrixVarIdx::OSMatrixWithMatrixVarIdx
OSMatrixWithMatrixVarIdx()
GeneralMatrixElements::~GeneralMatrixElements
~GeneralMatrixElements()
ConstantMatrixValues::el
double * el
Definition: OSMatrix.h:504
OSMatrix::idx
int idx
Definition: OSMatrix.h:2188
MatrixType::type
ENUM_MATRIX_TYPE type
To track the type of values present in the matrix or block.
Definition: OSMatrix.h:1902
LinearMatrixElementTerm::~LinearMatrixElementTerm
~LinearMatrixElementTerm()
MatrixBlock::IsEqual
bool IsEqual(MatrixBlock *that)
A function to check for the equality of two objects.
ObjReferenceMatrixElements::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
BaseMatrix::targetMatrixFirstRow
int targetMatrixFirstRow
to pinpoint the position of the upper left corner of the base matrix within the target matrix
Definition: OSMatrix.h:1552
ConReferenceMatrixElement::ConReferenceMatrixElement
ConReferenceMatrixElement()
MatrixBlock::MatrixBlock
MatrixBlock()
MatrixType::getNumberOfElementConstructors
int getNumberOfElementConstructors()
ExpandedMatrixBlocks
a sparse matrix data structure for matrices that can hold nonconstant values and have block structure...
Definition: OSMatrix.h:1768
ConReferenceMatrixValues::el
ConReferenceMatrixElement ** el
el contains the indices of the matrix constraints along with the valueType.
Definition: OSMatrix.h:717
MatrixBlock::blockColIdx
int blockColIdx
Definition: OSMatrix.h:2504
ConstantMatrixValues::deepCopyFrom
bool deepCopyFrom(ConstantMatrixValues *that)
A function to make a deep copy of an instance of this class.
MatrixNode::preOrderMatrixNodeTraversal
std::vector< MatrixNode * > preOrderMatrixNodeTraversal(std::vector< MatrixNode * > *prefixVector)
LinearMatrixElements::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
LinearMatrixElement::constant
double constant
Definition: OSMatrix.h:415
VarReferenceMatrixValues::~VarReferenceMatrixValues
~VarReferenceMatrixValues()
VarReferenceMatrixElements::value
VarReferenceMatrixValues * value
The variable references (indexes of core variables) of the elements.
Definition: OSMatrix.h:839
LinearMatrixElements::getNodeName
virtual std::string getNodeName()
MatrixType::getRowPartition
int * getRowPartition()
get the row partition of the matrix
ConstantMatrixElements::IsEqual
bool IsEqual(ConstantMatrixElements *that)
A function to check for the equality of two objects.
MatrixBlocks
a data structure to represent the nonzeroes of a matrix in a blockwise fashion. Each block can be giv...
Definition: OSMatrix.h:1449
MatrixBlocks::colOffset
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
MatrixNode::m_mChildren
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
ObjReferenceMatrixElements::ObjReferenceMatrixElements
ObjReferenceMatrixElements()
BaseMatrix::baseMatrixIdx
int baseMatrixIdx
the index of the base matrix
Definition: OSMatrix.h:1542
ObjReferenceMatrixElements::~ObjReferenceMatrixElements
~ObjReferenceMatrixElements()
OSMatrixWithMatrixVarIdx
this class extends OSMatrix for use, e.g., in the matrixVar section of OSoL and OSrL
Definition: OSMatrix.h:2336
LinearMatrixElement::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixTransformation::cloneMatrixNode
virtual MatrixTransformation * cloneMatrixNode()
The implementation of the virtual functions.
MatrixTransformation
a data structure to represent the nonzeroes of a matrix by transformation from other (previously defi...
Definition: OSMatrix.h:1358
MixedRowReferenceMatrixElements::getNodeName
virtual std::string getNodeName()
ConReferenceMatrixElement::value
double value
This element contains the value.
Definition: OSMatrix.h:469
ConReferenceMatrixElements::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
ObjReferenceMatrixValues
to represent the nonzeros in an objReferenceMatrix element
Definition: OSMatrix.h:675
OSMatrix::name
std::string name
Definition: OSMatrix.h:2189
MatrixElementValues
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
Definition: OSMatrix.h:321
MatrixBlock::cloneMatrixNode
virtual MatrixBlock * cloneMatrixNode()
The implementation of the virtual functions.
MatrixElementValues::~MatrixElementValues
virtual ~MatrixElementValues()
MatrixType::symmetry
ENUM_MATRIX_SYMMETRY symmetry
To track the type of symmetry present in the matrix or block.
Definition: OSMatrix.h:1896
LinearMatrixElementTerm::coef
double coef
Definition: OSMatrix.h:377
ObjReferenceMatrixValues::ObjReferenceMatrixValues
ObjReferenceMatrixValues()
GeneralSparseMatrix::isRowMajor
bool isRowMajor
isRowMajor holds whether the matrix is stored by row.
Definition: OSMatrix.h:1680
VarReferenceMatrixValues
A concrete class that is used to store a specific type of matrix values, references to variable index...
Definition: OSMatrix.h:563
LinearMatrixElement::numberOfVarIdx
int numberOfVarIdx
Definition: OSMatrix.h:414
MatrixElements::getRowMajor
bool getRowMajor()
Returns whether the matrix is stored row-wise or column-wise.
MatrixType::matrixHasBase
bool matrixHasBase()
Several tools to parse the constructor list of a matrix.
MatrixBlocks::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
ObjReferenceMatrixElements::IsEqual
bool IsEqual(ObjReferenceMatrixElements *that)
A function to check for the equality of two objects.
LinearMatrixElement
a data structure to represent an expression in a linearMatrix element A LinearMatrixElement is a (fin...
Definition: OSMatrix.h:411
LinearMatrixElement::IsEqual
bool IsEqual(LinearMatrixElement *that)
A function to check for the equality of two objects.
MatrixBlocks::rowOffset
IntVector * rowOffset
An array listing the top row of each block within the larger matrix.
Definition: OSMatrix.h:1461
ConReferenceMatrixElements::cloneMatrixNode
virtual ConReferenceMatrixElements * cloneMatrixNode()
MatrixType::matrixHasTransformations
bool matrixHasTransformations()
OSMatrix::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
ObjReferenceMatrixElements::cloneMatrixNode
virtual ObjReferenceMatrixElements * cloneMatrixNode()
MatrixBlocks::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
OSnLMNode
The OSnLMNode Class for nonlinear expressions involving matrices.
Definition: OSnLNode.h:1760
GeneralMatrixElements::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
GeneralSparseMatrix::symmetry
ENUM_MATRIX_SYMMETRY symmetry
To track the type of symmetry present in the matrix or block.
Definition: OSMatrix.h:1686
LinearMatrixElementTerm::idx
int idx
Definition: OSMatrix.h:376
MatrixBlocks::cloneMatrixNode
virtual MatrixBlocks * cloneMatrixNode()
The implementation of the virtual functions.
OSMatrix::IsEqual
bool IsEqual(OSMatrix *that)
A function to check for the equality of two objects.
GeneralMatrixValues::GeneralMatrixValues
GeneralMatrixValues()
BaseMatrix::scalarMultiplier
double scalarMultiplier
to allow the base matrix to be scaled before it is attached to the target matrix
Definition: OSMatrix.h:1577
MatrixNode::inumberOfChildren
unsigned int inumberOfChildren
inumberOfChildren is the number of MatrixNode child elements For the matrix types (OSMatrix and Matri...
Definition: OSMatrix.h:70
GeneralSparseMatrix::b_deleteStartArray
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
GeneralSparseMatrix::startSize
int startSize
startSize is the dimension of the starts array
Definition: OSMatrix.h:1691
OSMatrix::deepCopyFrom
bool deepCopyFrom(OSMatrix *that)
A function to make a deep copy of an instance of this class.
LinearMatrixValues::LinearMatrixValues
LinearMatrixValues()
MatrixTransformation::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
ConstantMatrixValues::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixNode::matrixType
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
ConstantMatrixValues::ConstantMatrixValues
ConstantMatrixValues()
MatrixTransformation::MatrixTransformation
MatrixTransformation()
MatrixNode::cloneMatrixNode
virtual MatrixNode * cloneMatrixNode()=0
OSMatrix::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
MatrixType::MatrixType
MatrixType()
MatrixNode::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
MatrixElementValues::MatrixElementValues
MatrixElementValues()
MatrixType::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
LinearMatrixElements::LinearMatrixElements
LinearMatrixElements()
OSMatrix::~OSMatrix
~OSMatrix()
MatrixConstructor::MatrixConstructor
MatrixConstructor()
constructor
MatrixType::ExpandedMatrixInRowMajorForm
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
convertToConReferenceMatrixElement
ConReferenceMatrixElement * convertToConReferenceMatrixElement(int objref)
MatrixNode::IsEqual
virtual bool IsEqual(MatrixNode *that)
A function to check for the equality of two objects.
BaseMatrix::~BaseMatrix
~BaseMatrix()
BaseMatrix::baseMatrixEndCol
int baseMatrixEndCol
Definition: OSMatrix.h:1567
MatrixType::expandElements
virtual bool expandElements(bool rowMajor)
A method to expand a matrix or block The result is a GeneralSparseMatrix object of constant matrix el...
LinearMatrixElements::value
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
LinearMatrixValues::el
LinearMatrixElement ** el
Definition: OSMatrix.h:605
BaseMatrix::baseMatrixStartCol
int baseMatrixStartCol
Definition: OSMatrix.h:1560
VarReferenceMatrixElements::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
LinearMatrixElement::~LinearMatrixElement
~LinearMatrixElement()
GeneralMatrixValues::deepCopyFrom
virtual bool deepCopyFrom(GeneralMatrixValues *that)
A function to make a deep copy of an instance of this class.
ExpandedMatrixBlocks::isRowMajor
bool isRowMajor
isRowMajor holds whether the (nonzero) values holding the data are stored by columnrow.
Definition: OSMatrix.h:1787
MatrixBlock::expandElements
virtual bool expandElements(bool rowMajor)
A method to expand a matrix or block The result is a GeneralSparseMatrix object of constant matrix el...
GeneralSparseMatrix
a sparse matrix data structure for matrices that can hold nonconstant values
Definition: OSMatrix.h:1654
MatrixType::getBlocks
ExpandedMatrixBlocks * getBlocks(int *rowPartition, int rowPartitionSize, int *colPartition, int colPartitionSize, bool rowMajor, bool appendToBlockArray)
A method to extract a block from a larger matrix The result is a sparse matrix object,...
MatrixElements::index
IntVector * index
The index array of the (nonzero) elements.
Definition: OSMatrix.h:269
MatrixType::getColumnPartitionSize
int getColumnPartitionSize()
get the size of the column partition of a matrix
VarReferenceMatrixElements::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
BaseMatrix::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
ObjReferenceMatrixElements::getNodeName
virtual std::string getNodeName()
ConReferenceMatrixElements::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
MatrixType::getMatrixBlockInColumnMajorForm
GeneralSparseMatrix * getMatrixBlockInColumnMajorForm(int columnIdx, int rowIdx)
MatrixElements::numberOfValues
int numberOfValues
numberOfValues records the number of entries in the arrays that make up the instance of nonzeros
Definition: OSMatrix.h:261
MatrixType::IsEqual
bool IsEqual(MatrixType *that)
A function to check for the equality of two objects.
BaseMatrix::IsEqual
bool IsEqual(BaseMatrix *that)
A function to check for the equality of two objects.
ConstantMatrixElements
a data structure to represent the constant elements in a MatrixType object
Definition: OSMatrix.h:749
OSMatrixWithMatrixVarIdx::~OSMatrixWithMatrixVarIdx
~OSMatrixWithMatrixVarIdx()
MatrixElementValues::numberOfEl
int numberOfEl
each type of value is stored as an array named "el".
Definition: OSMatrix.h:327
GeneralMatrixElements::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
OSMatrixWithMatrixConIdx::OSMatrixWithMatrixConIdx
OSMatrixWithMatrixConIdx()
ExpandedMatrixBlocks::blocks
GeneralSparseMatrix ** blocks
blocks holds the blocks that make up the matrix.
Definition: OSMatrix.h:1838
OSMatrixWithMatrixObjIdx::deepCopyFrom
bool deepCopyFrom(OSMatrixWithMatrixObjIdx *that)
A function to make a deep copy of an instance of this class.
MixedRowReferenceMatrixElements::cloneMatrixNode
virtual MixedRowReferenceMatrixElements * cloneMatrixNode()
GeneralSparseMatrix::display
bool display(int secondaryDim)
This method displays the data contained in the matrix.
BaseMatrix::baseMatrix
OSMatrix * baseMatrix
a pointer to the base matrix
Definition: OSMatrix.h:1547
MatrixType::getNumberOfBlocksConstructors
int getNumberOfBlocksConstructors()
ObjReferenceMatrixElements::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
ExpandedMatrixBlocks::~ExpandedMatrixBlocks
~ExpandedMatrixBlocks()
Default destructor.
GeneralMatrixValues
a data structure to represent the nonzeros in a generalMatrix element
Definition: OSMatrix.h:639
LinearMatrixElement::varIdx
LinearMatrixElementTerm ** varIdx
Definition: OSMatrix.h:417
VarReferenceMatrixElements::deepCopyFrom
bool deepCopyFrom(VarReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
ConReferenceMatrixElement::deepCopyFrom
bool deepCopyFrom(ConReferenceMatrixElement *that)
A function to make a deep copy of an instance of this class.
MatrixBlocks::MatrixBlocks
MatrixBlocks()
VarReferenceMatrixElements
a data structure to represent variable reference elements in a MatrixType object Each nonzero element...
Definition: OSMatrix.h:835
BaseMatrix::cloneMatrixNode
virtual BaseMatrix * cloneMatrixNode()
The implementation of the virtual functions.
MatrixTransformation::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
MatrixElements::~MatrixElements
virtual ~MatrixElements()
OSMatrix
a data structure to represent a matrix object (derived from MatrixType)
Definition: OSMatrix.h:2185
LinearMatrixElement::deepCopyFrom
bool deepCopyFrom(LinearMatrixElement *that)
A function to make a deep copy of an instance of this class.
ConstantMatrixElements::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
MatrixType::matrixHasBlocks
bool matrixHasBlocks()
LinearMatrixValues::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ConstantMatrixElements::~ConstantMatrixElements
~ConstantMatrixElements()
MatrixBlocks::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
OSMatrixWithMatrixVarIdx::deepCopyFrom
bool deepCopyFrom(OSMatrixWithMatrixVarIdx *that)
A function to make a deep copy of an instance of this class.
BaseMatrix::getNodeName
virtual std::string getNodeName()
MatrixConstructor::~MatrixConstructor
virtual ~MatrixConstructor()
destructor
ExpandedMatrixBlocks::blockColumns
int * blockColumns
blockColumns holds an integer array of the column to which a block belongs.
Definition: OSMatrix.h:1831
ConReferenceMatrixValues::~ConReferenceMatrixValues
~ConReferenceMatrixValues()
ENUM_MATRIX_SYMMETRY
ENUM_MATRIX_SYMMETRY
Definition: OSParameters.h:735
IntVector
an integer Vector data structure
Definition: OSGeneral.h:469
OSMatrixWithMatrixConIdx
this class extends OSMatrix for use, e.g., in the matrixCon section of OSoL and OSrL
Definition: OSMatrix.h:2445
MixedRowReferenceMatrixElements
a data structure to represent row reference elements in a MatrixType object Each nonzero element refe...
Definition: OSMatrix.h:1264
GeneralSparseMatrix::vType
ENUM_MATRIX_TYPE vType
vType holds the type of values found in the value array.
Definition: OSMatrix.h:1714
OSMatrixWithMatrixVarIdx::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
GeneralMatrixElements::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
ObjReferenceMatrixValues::el
int * el
Definition: OSMatrix.h:678
ENUM_MATRIX_CONSTRUCTOR_TYPE
ENUM_MATRIX_CONSTRUCTOR_TYPE
Definition: OSParameters.h:776
ConReferenceMatrixElements::value
ConReferenceMatrixValues * value
The constraint references (indexes of core constraints and value types) of the elements.
Definition: OSMatrix.h:1181
MatrixNode::MatrixNode
MatrixNode()
default constructor
MatrixType::~MatrixType
virtual ~MatrixType()
LinearMatrixElements::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
GeneralMatrixElements::value
GeneralMatrixValues * value
The values are general nonlinear expressions.
Definition: OSMatrix.h:1011
ObjReferenceMatrixElements::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixType::getColumnPartition
int * getColumnPartition()
get the column partition of the matrix
ConstantMatrixElements::deepCopyFrom
bool deepCopyFrom(ConstantMatrixElements *that)
A function to make a deep copy of an instance of this class.
ConstantMatrixElements::cloneMatrixNode
virtual ConstantMatrixElements * cloneMatrixNode()
MixedRowReferenceMatrixElements::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
MatrixTransformation::transformation
OSnLMNode * transformation
A transformation is essentially an expression tree that evaluates to a matrix.
Definition: OSMatrix.h:1364
OSnLNode
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:179
BaseMatrix::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
GeneralMatrixValues::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ExpandedMatrixBlocks::blockNumber
int blockNumber
blockNumber gives the number of blocks (which is the size of the blockRows and blockColumns arrays).
Definition: OSMatrix.h:1793
ConReferenceMatrixValues::IsEqual
bool IsEqual(ConReferenceMatrixValues *that)
A function to check for the equality of two objects.
MatrixBlock::~MatrixBlock
~MatrixBlock()
OSMatrix::expandElements
virtual bool expandElements(bool rowMajor)
A method to process a matrixType into a specific block structure.
ExpandedMatrixBlocks::isBlockDiagonal
bool isBlockDiagonal()
a method to determine whether the collection is blockDiagonal
ExpandedMatrixBlocks::getBlock
GeneralSparseMatrix * getBlock(int rowIdx, int colIdx)
a method to retrieve a particular block from a collection
OSMatrixWithMatrixObjIdx::IsEqual
bool IsEqual(OSMatrixWithMatrixObjIdx *that)
A function to check for the equality of two objects.
ConReferenceMatrixElement::IsEqual
bool IsEqual(ConReferenceMatrixElement *that)
A function to check for the equality of two objects.
MatrixType::getMatrixCoefficientsInRowMajor
GeneralSparseMatrix * getMatrixCoefficientsInRowMajor()
MatrixNode::nType
ENUM_MATRIX_CONSTRUCTOR_TYPE nType
nType is a unique integer assigned to each type of matrix node (see OSParameters.h)
Definition: OSMatrix.h:64
ObjReferenceMatrixElements
a data structure to represent objective reference elements in a MatrixType object Each nonzero elemen...
Definition: OSMatrix.h:1091
OSMatrixWithMatrixConIdx::matrixConIdx
int matrixConIdx
Definition: OSMatrix.h:2448
BaseMatrix::BaseMatrix
BaseMatrix()
Standard constructor and destructor methods.
ConReferenceMatrixElement::conReference
int conReference
contains a reference to a row of the problem (objective if negative, constraint otherwise)
Definition: OSMatrix.h:460
VarReferenceMatrixElements::cloneMatrixNode
virtual VarReferenceMatrixElements * cloneMatrixNode()
MatrixType::getRowPartitionSize
int getRowPartitionSize()
get the size of the row partition of a matrix
LinearMatrixElement::LinearMatrixElement
LinearMatrixElement()
ExpandedMatrixBlocks::display
bool display(int secondaryDim)
This method displays data structure in the matrix format.
ConReferenceMatrixElements::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
ENUM_CONREFERENCE_VALUETYPE
ENUM_CONREFERENCE_VALUETYPE
An enum to track the type of value contained in a reference to a constraint.
Definition: OSParameters.h:703
MatrixType::numberOfRows
int numberOfRows
Definition: OSMatrix.h:1904
ConReferenceMatrixValues
a data structure to represent the nonzeros in a conReferenceMatrix element
Definition: OSMatrix.h:711
MatrixType::convertToOtherMajor
GeneralSparseMatrix * convertToOtherMajor(bool isColumnMajor)
A method to convert a matrix to the other major.
GeneralSparseMatrix::GeneralSparseMatrix
GeneralSparseMatrix()
Default constructor.
MatrixNode::getPostfixFromNodeTree
std::vector< MatrixNode * > getPostfixFromNodeTree()
convertToLinearMatrixElement
LinearMatrixElement * convertToLinearMatrixElement(double val)
Some methods to convert one type of matrix element into another.
MatrixNode
a generic class from which we derive matrix constructors (BaseMatrix, MatrixElements,...
Definition: OSMatrix.h:50
VarReferenceMatrixElements::~VarReferenceMatrixElements
~VarReferenceMatrixElements()
MixedRowReferenceMatrixElements::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
MatrixBlock::getNodeName
virtual std::string getNodeName()
GeneralMatrixElements::GeneralMatrixElements
GeneralMatrixElements()
MatrixType::disassembleMatrix
ExpandedMatrixBlocks * disassembleMatrix(int *rowPartition, int rowPartitionSize, int *colPartition, int colPartitionSize, bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry)
A method to disassemble a MatrixType into individual blocks of specific structure.
OSMatrix::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
ExpandedMatrixBlocks::colOffsetSize
int colOffsetSize
Definition: OSMatrix.h:1815
GeneralSparseMatrix::start
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
LinearMatrixElements::IsEqual
bool IsEqual(LinearMatrixElements *that)
A function to check for the equality of two objects.
VarReferenceMatrixValues::el
int * el
Each el is a reference to a constraint defined in the <constraints> section of the OSiL file.
Definition: OSMatrix.h:569
ObjReferenceMatrixElements::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
ConstantMatrixElements::getNodeName
virtual std::string getNodeName()
MatrixBlocks::~MatrixBlocks
~MatrixBlocks()
OSMatrixWithMatrixVarIdx::IsEqual
bool IsEqual(OSMatrixWithMatrixVarIdx *that)
A function to check for the equality of two objects.
MatrixType::ExpandedMatrixByBlocks
std::vector< ExpandedMatrixBlocks * > ExpandedMatrixByBlocks
Definition: OSMatrix.h:1913
BaseMatrix::baseMatrixEndRow
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
BaseMatrix::targetMatrixFirstCol
int targetMatrixFirstCol
Definition: OSMatrix.h:1553
MixedRowReferenceMatrixElements::IsEqual
bool IsEqual(MixedRowReferenceMatrixElements *that)
A function to check for the equality of two objects.
MatrixType::printExpandedMatrix
bool printExpandedMatrix(bool rowMajor)
a utility routine to print the expanded matrix or block.
MatrixNode::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()=0
GeneralSparseMatrix::~GeneralSparseMatrix
~GeneralSparseMatrix()
Default destructor.
LinearMatrixValues::~LinearMatrixValues
~LinearMatrixValues()
OSMatrixWithMatrixObjIdx::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixBlock::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
ConstantMatrixElements::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
OSMatrixWithMatrixConIdx::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
MatrixType::processBlockPartition
bool processBlockPartition()
A method to determine the block structure of a matrixType as defined by the <blocks> element or eleme...
MatrixTransformation::shape
ENUM_NL_EXPR_SHAPE shape
shape can be used to specify linearity etc.
Definition: OSMatrix.h:1370
MatrixTransformation::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixBlock::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
MatrixBlocks::IsEqual
bool IsEqual(MatrixBlocks *that)
A function to check for the equality of two objects.
MatrixNode::postOrderMatrixNodeTraversal
std::vector< MatrixNode * > postOrderMatrixNodeTraversal(std::vector< MatrixNode * > *postfixVector)
ConReferenceMatrixElements::getNodeName
virtual std::string getNodeName()
MatrixTransformation::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
GeneralSparseMatrix::valueSize
int valueSize
valueSize is the dimension of the index and value arrays
Definition: OSMatrix.h:1696
LinearMatrixElements::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
OSMatrixWithMatrixObjIdx::OSMatrixWithMatrixObjIdx
OSMatrixWithMatrixObjIdx()
ExpandedMatrixBlocks::bDeleteArrays
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
Definition: OSMatrix.h:1775
LinearMatrixElements::deepCopyFrom
bool deepCopyFrom(LinearMatrixElements *that)
A function to make a deep copy of an instance of this class.
ObjReferenceMatrixElements::deepCopyFrom
bool deepCopyFrom(ObjReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
BaseMatrix::baseMatrixStartRow
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
ConReferenceMatrixElements::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MixedRowReferenceMatrixElements::deepCopyFrom
bool deepCopyFrom(MixedRowReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
MatrixTransformation::deepCopyFrom
bool deepCopyFrom(MatrixTransformation *that)
A function to make a deep copy of an instance of this class.
MatrixType::ExpandedMatrixInColumnMajorForm
GeneralSparseMatrix * ExpandedMatrixInColumnMajorForm
Definition: OSMatrix.h:1912
GeneralMatrixElements::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
LinearMatrixValues::IsEqual
bool IsEqual(LinearMatrixValues *that)
A function to check for the equality of two objects.
OSMatrixWithMatrixObjIdx::matrixObjIdx
int matrixObjIdx
Definition: OSMatrix.h:2394
MixedRowReferenceMatrixElements::MixedRowReferenceMatrixElements
MixedRowReferenceMatrixElements()
MatrixType::extractBlock
GeneralSparseMatrix * extractBlock(int firstrow, int firstcol, int lastrow, int lastcol, bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry)
A method to extract a block from a larger matrix The result is a sparse matrix object,...
MatrixBlock::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
LinearMatrixElementTerm::deepCopyFrom
bool deepCopyFrom(LinearMatrixElementTerm *that)
A function to make a deep copy of an instance of this class.
GeneralMatrixElements::IsEqual
bool IsEqual(GeneralMatrixElements *that)
A function to check for the equality of two objects.
MatrixType::getNumberOfTransformationConstructors
int getNumberOfTransformationConstructors()
MatrixType::deepCopyFrom
bool deepCopyFrom(MatrixType *that)
A function to make a deep copy of an instance of this class.
MatrixType
a data structure to represent a MatrixType object (from which we derive OSMatrix and MatrixBlock)
Definition: OSMatrix.h:1889
MatrixBlock
a data structure to represent a MatrixBlock object (derived from MatrixType)
Definition: OSMatrix.h:2500
MatrixElements::IsEqual
bool IsEqual(MatrixElements *that)
A function to check for the equality of two objects.
MatrixTransformation::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
OSMatrixWithMatrixObjIdx::~OSMatrixWithMatrixObjIdx
~OSMatrixWithMatrixObjIdx()
convertToGeneralMatrixElement
ScalarExpressionTree * convertToGeneralMatrixElement(double val)
ObjReferenceMatrixValues::~ObjReferenceMatrixValues
~ObjReferenceMatrixValues()
MatrixType::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
A method to check whether a matrix or block is diagonal.
LinearMatrixValues::deepCopyFrom
virtual bool deepCopyFrom(LinearMatrixValues *that)
A function to make a deep copy of an instance of this class.
OSMatrix::cloneMatrixNode
virtual OSMatrix * cloneMatrixNode()
The implementation of the virtual functions.
ConstantMatrixValues
to represent the nonzeros in a constantMatrix element
Definition: OSMatrix.h:501
VarReferenceMatrixValues::IsEqual
bool IsEqual(VarReferenceMatrixValues *that)
A function to check for the equality of two objects.
VarReferenceMatrixElements::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
LinearMatrixElementTerm::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
LinearMatrixElements::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
MatrixElementValues::deepCopyFrom
virtual bool deepCopyFrom(MatrixElementValues *that)
A function to check for the equality of two objects.
ConstantMatrixElements::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ConReferenceMatrixElement::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MixedRowReferenceMatrixElements::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixBlocks::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
MatrixBlock::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
LinearMatrixElementTerm::LinearMatrixElementTerm
LinearMatrixElementTerm()
MatrixBlock::blockRowIdx
int blockRowIdx
Definition: OSMatrix.h:2503
LinearMatrixElements
a data structure to represent the nonzero values in a linearMatrix element
Definition: OSMatrix.h:917
GeneralSparseMatrix::index
int * index
index holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
Definition: OSMatrix.h:1708
MatrixNode::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixNode::deepCopyFrom
bool deepCopyFrom(MatrixNode *that)
A function to make a deep copy of an instance of this class.
ConReferenceMatrixElements::~ConReferenceMatrixElements
~ConReferenceMatrixElements()
ObjReferenceMatrixElements::value
ObjReferenceMatrixValues * value
The objective references (indexes of core objectives) of the elements.
Definition: OSMatrix.h:1095
MatrixNode::getNodeName
virtual std::string getNodeName()=0
MatrixElements::start
IntVector * start
A vector listing the row or column starts.
Definition: OSMatrix.h:266
GeneralSparseMatrix::isDiagonal
bool isDiagonal()
a method to determine whether the matrix is diagonal
MatrixType::matrixHasElements
bool matrixHasElements()
VarReferenceMatrixValues::VarReferenceMatrixValues
VarReferenceMatrixValues()
OSMatrix::setMatrix
bool setMatrix(std::string name, int numberOfRows, int numberOfColumns, ENUM_MATRIX_SYMMETRY symmetry, ENUM_MATRIX_TYPE matrixType, unsigned int inumberOfChildren, MatrixNode **m_mChildren)
add values to this matrix.
MatrixNode::~MatrixNode
virtual ~MatrixNode()
destructor
ConReferenceMatrixElement::valueType
ENUM_CONREFERENCE_VALUETYPE valueType
Several different types of values can be derived from a problem constraint.
Definition: OSMatrix.h:466
MatrixElements::rowMajor
bool rowMajor
To indicate whether the matrix elements are stored in row major form or column major form.
Definition: OSMatrix.h:255
ConReferenceMatrixValues::ConReferenceMatrixValues
ConReferenceMatrixValues()
OSMatrix::isBlockDiagonal
bool isBlockDiagonal()
A method to check whether a matrix is block-diagonal.
ConstantMatrixElements::value
ConstantMatrixValues * value
The value array of the (nonzero) constant elements.
Definition: OSMatrix.h:753
ConstantMatrixValues::~ConstantMatrixValues
~ConstantMatrixValues()
VarReferenceMatrixValues::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
BaseMatrix::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
LinearMatrixValues
a data structure to represent the linear expressions in a LinearMatrixElement object
Definition: OSMatrix.h:602
MixedRowReferenceMatrixElements::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
VarReferenceMatrixElements::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ConstantMatrixElements::getNodeType
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
OSMatrix::createConstructorTreeFromPrefix
OSMatrix * createConstructorTreeFromPrefix(std::vector< MatrixNode * > mtxConstructorVec)
MatrixTransformation::~MatrixTransformation
~MatrixTransformation()
ObjReferenceMatrixValues::IsEqual
bool IsEqual(ObjReferenceMatrixValues *that)
A function to check for the equality of two objects.
ObjReferenceMatrixElements::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
ConReferenceMatrixValues::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ExpandedMatrixBlocks::rowOffsetSize
int rowOffsetSize
These two parameters give the size of the rowOffset and colOffset arrays, respectively.
Definition: OSMatrix.h:1814
GeneralMatrixElements::getNodeName
virtual std::string getNodeName()
MatrixType::processBlocks
virtual bool processBlocks(bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry)
A method to process a matrixType into a block structure defined by the <blocks> element or elements.
ExpandedMatrixBlocks::ExpandedMatrixBlocks
ExpandedMatrixBlocks()
Default constructor.
GeneralSparseMatrix::value
MatrixElementValues * value
value holds a general array of value elements in the matrix, which could be constants,...
Definition: OSMatrix.h:1723
ScalarExpressionTree
Used to hold part of the instance in memory.
Definition: OSExpressionTree.h:99
ConstantMatrixElements::alignsOnBlockBoundary
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor.
ConReferenceMatrixElements::ConReferenceMatrixElements
ConReferenceMatrixElements()
ExpandedMatrixBlocks::rowOffset
int * rowOffset
rowOffset gives the row offsets of the block decomposition It does not have to correspond to the row ...
Definition: OSMatrix.h:1801
OSParameters.h
GeneralMatrixValues::~GeneralMatrixValues
~GeneralMatrixValues()
OSMatrixWithMatrixConIdx::~OSMatrixWithMatrixConIdx
~OSMatrixWithMatrixConIdx()
ConReferenceMatrixElements::deepCopyFrom
bool deepCopyFrom(ConReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
VarReferenceMatrixElements::VarReferenceMatrixElements
VarReferenceMatrixElements()
MatrixElements
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
Definition: OSMatrix.h:248
GeneralMatrixElements::deepCopyFrom
bool deepCopyFrom(GeneralMatrixElements *that)
A function to make a deep copy of an instance of this class.
ConReferenceMatrixElement
a data structure to represent an entry in a conReferenceMatrix element, which consists of a constrain...
Definition: OSMatrix.h:453
VarReferenceMatrixElements::getNodeName
virtual std::string getNodeName()
VarReferenceMatrixElements::getMatrixType
virtual ENUM_MATRIX_TYPE getMatrixType()
ExpandedMatrixBlocks::blockRows
int * blockRows
blockRows holds an integer array of the row to which a block belongs.
Definition: OSMatrix.h:1823
VarReferenceMatrixValues::deepCopyFrom
virtual bool deepCopyFrom(VarReferenceMatrixValues *that)
A function to make a deep copy of an instance of this class.
VarReferenceMatrixElements::IsEqual
bool IsEqual(VarReferenceMatrixElements *that)
A function to check for the equality of two objects.
OSMatrix::OSMatrix
OSMatrix()
MatrixNode::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()=0
GeneralMatrixValues::el
ScalarExpressionTree ** el
Definition: OSMatrix.h:642
MatrixNode::alignsOnBlockBoundary
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.
MatrixTransformation::getNodeName
virtual std::string getNodeName()
GeneralMatrixElements::setRandom
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
GeneralMatrixElements
a data structure to represent the nonzero values in a generalMatrix element
Definition: OSMatrix.h:1005
BaseMatrix::getMatrixNodeInXML
virtual std::string getMatrixNodeInXML()
MatrixBlocks::getNodeName
virtual std::string getNodeName()
OSMatrixWithMatrixConIdx::deepCopyFrom
bool deepCopyFrom(OSMatrixWithMatrixConIdx *that)
A function to make a deep copy of an instance of this class.
OSnLNode.h
This file defines the OSnLNode class along with its derived classes.
GeneralMatrixValues::IsEqual
bool IsEqual(GeneralMatrixValues *that)
A function to check for the equality of two objects.