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:
1920 
1925 
1930 
1935 
1940 
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
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:3944
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.
Definition: OSMatrix.cpp:3668
bool deepCopyFrom(ConReferenceMatrixElement *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5828
bool display(int secondaryDim)
This method displays data structure in the matrix format.
Definition: OSMatrix.cpp:6625
ConReferenceMatrixElement * convertToConReferenceMatrixElement(int objref)
Definition: OSMatrix.cpp:6783
ConReferenceMatrixElement()
-------— Methods for class ConReferenceMatrixElement -------—
Definition: OSMatrix.cpp:5769
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:4164
double scalarMultiplier
to allow the base matrix to be scaled before it is attached to the target matrix
Definition: OSMatrix.h:1577
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:3875
bool matrixHasBase()
Several tools to parse the constructor list of a matrix.
Definition: OSMatrix.cpp:196
This file defines the OSnLNode class along with its derived classes.
virtual bool deepCopyFrom(VarReferenceMatrixValues *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:4589
LinearMatrixElementTerm ** varIdx
Definition: OSMatrix.h:417
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:4349
GeneralMatrixElements()
-------— Methods for class GeneralMatrixElements -------—
Definition: OSMatrix.cpp:5046
a data structure to represent row reference elements in a MatrixType object Each nonzero element is o...
Definition: OSMatrix.h:1177
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.
Definition: OSMatrix.cpp:2595
virtual bool IsEqual(MatrixNode *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:99
virtual std::string getNodeName()
Definition: OSMatrix.cpp:6317
bool IsEqual(MatrixType *that)
A function to check for the equality of two objects.
int numberOfEl
each type of value is stored as an array named &quot;el&quot;.
Definition: OSMatrix.h:327
a sparse matrix data structure for matrices that can hold nonconstant values
Definition: OSMatrix.h:1654
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:5856
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:4640
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
bool deepCopyFrom(MatrixTransformation *that)
A function to make a deep copy of an instance of this class.
virtual ConstantMatrixElements * cloneMatrixNode()
Definition: OSMatrix.cpp:4225
bool IsEqual(MatrixTransformation *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4097
int getNumberOfElementConstructors()
Definition: OSMatrix.cpp:237
bool IsEqual(GeneralMatrixValues *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:5231
bool printExpandedMatrix(bool rowMajor)
a utility routine to print the expanded matrix or block.
Definition: OSMatrix.cpp:1785
bool IsEqual(OSMatrixWithMatrixConIdx *that)
A function to check for the equality of two objects.
bool IsEqual(ConReferenceMatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:5619
VarReferenceMatrixElements()
-------— Methods for class VarReferenceMatrixElements -------—
Definition: OSMatrix.cpp:4369
virtual std::string getNodeName()=0
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:5325
bool deepCopyFrom(OSMatrixWithMatrixObjIdx *that)
A function to make a deep copy of an instance of this class.
bool IsEqual(GeneralMatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:5134
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:5866
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
virtual BaseMatrix * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:3979
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
Definition: OSMatrix.h:1775
a data structure to represent the nonzeros in a generalMatrix element
Definition: OSMatrix.h:639
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:5662
a data structure to represent the constant elements in a MatrixType object
Definition: OSMatrix.h:749
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:4630
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
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:4395
bool processBlockPartition()
A method to determine the block structure of a matrixType as defined by the &lt;blocks&gt; element or eleme...
Definition: OSMatrix.cpp:2142
LinearMatrixElement ** el
Definition: OSMatrix.h:605
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
virtual ObjReferenceMatrixElements * cloneMatrixNode()
Definition: OSMatrix.cpp:5379
int numberOfValues
numberOfValues records the number of entries in the arrays that make up the instance of nonzeros ...
Definition: OSMatrix.h:261
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
int numberOfColumns
Definition: OSMatrix.h:1905
bool deepCopyFrom(OSMatrixWithMatrixVarIdx *that)
A function to make a deep copy of an instance of this class.
ENUM_MATRIX_CONSTRUCTOR_TYPE
Definition: OSParameters.h:776
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:6335
bool IsEqual(ConstantMatrixValues *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4310
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:84
to represent the nonzeros in a constantMatrix element
Definition: OSMatrix.h:501
std::vector< MatrixNode * > getPrefixFromNodeTree()
ConReferenceMatrixElements()
-------— Methods for class ConReferenceMatrixElements -------—
Definition: OSMatrix.cpp:5524
bool display(int secondaryDim)
This method displays the data contained in the matrix.
Definition: OSMatrix.cpp:6506
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 an entry in a conReferenceMatrix element, which consists of a constrain...
Definition: OSMatrix.h:453
std::vector< ExpandedMatrixBlocks * > ExpandedMatrixByBlocks
Definition: OSMatrix.h:1913
a data structure to represent the linear expressions in a LinearMatrixElement object ...
Definition: OSMatrix.h:602
a data structure to represent the nonzeroes of a matrix by transformation from other (previously defi...
Definition: OSMatrix.h:1358
MatrixNode()
default constructor
Definition: OSMatrix.cpp:40
ENUM_MATRIX_TYPE vType
vType holds the type of values found in the value array.
Definition: OSMatrix.h:1714
virtual OSMatrix * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:3708
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, depending on the matrixType, of constant matrix elements, variable references, linear or nonlinear expressions, or objective and constraint references (possibly mixed).
Definition: OSMatrix.cpp:2269
virtual ~MatrixConstructor()
destructor
Definition: OSMatrix.cpp:152
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool rowMajor
To indicate whether the matrix elements are stored in row major form or column major form...
Definition: OSMatrix.h:255
GeneralSparseMatrix * convertToOtherMajor(bool isColumnMajor)
A method to convert a matrix to the other major.
Definition: OSMatrix.cpp:1914
ScalarExpressionTree * convertToGeneralMatrixElement(double val)
Definition: OSMatrix.cpp:6670
OSMatrixWithMatrixConIdx()
-------— Methods for class OSMatrixWithMatrixConIdx -------—
Definition: OSMatrix.cpp:3859
OSMatrix()
-------— Methods for class OSMatrix -------—
Definition: OSMatrix.cpp:2968
ObjReferenceMatrixValues * value
The objective references (indexes of core objectives) of the elements.
Definition: OSMatrix.h:1095
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
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ENUM_MATRIX_TYPE type
To track the type of values present in the matrix or block.
Definition: OSMatrix.h:1902
int m_iRowPartitionSize
m_iRowPartitionSize gives the size of the m_miRowPartition array, which is one more than the number o...
Definition: OSMatrix.h:1924
int blockNumber
blockNumber gives the number of blocks (which is the size of the blockRows and blockColumns arrays)...
Definition: OSMatrix.h:1793
bool deepCopyFrom(MixedRowReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:6113
a data structure to represent the nonzeroes of a matrix in a blockwise fashion. Each block can be giv...
Definition: OSMatrix.h:1449
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:4951
LinearMatrixValues()
-------— Methods for class LinearMatrixValues -------—
Definition: OSMatrix.cpp:4761
a data structure to represent a MatrixBlock object (derived from MatrixType)
Definition: OSMatrix.h:2500
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
Definition: OSMatrix.h:321
int targetMatrixFirstRow
to pinpoint the position of the upper left corner of the base matrix within the target matrix ...
Definition: OSMatrix.h:1552
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:6196
VarReferenceMatrixValues * value
The variable references (indexes of core variables) of the elements.
Definition: OSMatrix.h:839
virtual ~MatrixElements()
Definition: OSMatrix.cpp:2849
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:6322
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:4174
virtual std::string getNodeName()
Definition: OSMatrix.cpp:4169
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:4412
The OSnLMNode Class for nonlinear expressions involving matrices.
Definition: OSnLNode.h:1760
std::vector< MatrixNode * > postOrderMatrixNodeTraversal(std::vector< MatrixNode * > *postfixVector)
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
MatrixBlock()
-------— Methods for class MatrixBlock -------—
Definition: OSMatrix.cpp:6295
virtual OSMatrixWithMatrixObjIdx * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:3851
virtual OSMatrixWithMatrixConIdx * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:3901
bool IsEqual(LinearMatrixElement *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4910
bool deepCopyFrom(ConstantMatrixElements *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:4279
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:3934
this class extends OSMatrix for use, e.g., in the matrixVar section of OSoL and OSrL ...
Definition: OSMatrix.h:2336
bool IsEqual(ObjReferenceMatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:5386
MatrixTransformation()
-------— Methods for class MatrixTransformation -------—
Definition: OSMatrix.cpp:4034
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:5567
bool deepCopyFrom(LinearMatrixElementTerm *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5037
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...
Definition: OSMatrix.cpp:5122
int baseMatrixStartCol
Definition: OSMatrix.h:1560
virtual ConReferenceMatrixElements * cloneMatrixNode()
Definition: OSMatrix.cpp:5612
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:6108
int blockColIdx
Definition: OSMatrix.h:2504
virtual std::string getNodeName()
Definition: OSMatrix.cpp:5861
bool isBlockDiagonal()
a method to determine whether the collection is blockDiagonal
Definition: OSMatrix.cpp:6608
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:5873
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...
Definition: OSMatrix.cpp:4454
a data structure to represent a MatrixType object (from which we derive OSMatrix and MatrixBlock) ...
Definition: OSMatrix.h:1889
ENUM_CONREFERENCE_VALUETYPE valueType
Several different types of values can be derived from a problem constraint.
Definition: OSMatrix.h:466
virtual GeneralMatrixElements * cloneMatrixNode()
Definition: OSMatrix.cpp:5127
int * blockRows
blockRows holds an integer array of the row to which a block belongs.
Definition: OSMatrix.h:1823
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:3825
bool IsEqual(OSMatrixWithMatrixObjIdx *that)
A function to check for the equality of two objects.
ENUM_MATRIX_SYMMETRY
Definition: OSParameters.h:735
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...
Definition: OSMatrix.cpp:5374
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:6312
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:4508
bool deepCopyFrom(MatrixBlock *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:6385
virtual VarReferenceMatrixElements * cloneMatrixNode()
Definition: OSMatrix.cpp:4459
virtual std::string getNodeName()
Definition: OSMatrix.cpp:4059
int * blockColumns
blockColumns holds an integer array of the column to which a block belongs.
Definition: OSMatrix.h:1831
bool isRowMajor
isRowMajor holds whether the (nonzero) values holding the data are stored by columnrow.
Definition: OSMatrix.h:1787
bool m_bHaveColumnPartition
m_bHaveColumnPartition tracks whether the column partition has been determined from the constructor l...
Definition: OSMatrix.h:1944
virtual std::string getMatrixNodeInXML()=0
Definition: OSMatrix.cpp:89
GeneralSparseMatrix * getMatrixCoefficientsInRowMajor()
Definition: OSMatrix.cpp:1028
virtual MatrixBlock * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:6368
bool deepCopyFrom(LinearMatrixElement *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:4956
ENUM_NL_EXPR_SHAPE shape
shape can be used to specify linearity etc.
Definition: OSMatrix.h:1370
MatrixElements()
-------— Methods for class MatrixElements -------—
Definition: OSMatrix.cpp:2838
bool m_bHaveRowPartition
m_bHaveRowPartition tracks whether the row partition has been determined from the constructor list an...
Definition: OSMatrix.h:1939
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...
Definition: OSMatrix.cpp:6054
ObjReferenceMatrixElements()
-------— Methods for class ObjReferenceMatrixElements -------—
Definition: OSMatrix.cpp:5289
virtual MatrixBlocks * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:6246
bool deepCopyFrom(OSMatrixWithMatrixConIdx *that)
A function to make a deep copy of an instance of this class.
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:4071
LinearMatrixElements()
-------— Methods for class LinearMatrixElements -------—
Definition: OSMatrix.cpp:4604
Used to hold part of the instance in memory.
int * m_miRowPartition
m_miRowPartition is the partition vector of the matrix rows into blocks
Definition: OSMatrix.h:1919
ConstantMatrixValues()
-------— Methods for class ConstantMatrixValues -------—
Definition: OSMatrix.cpp:4286
this class extends OSMatrix for use, e.g., in the matrixCon section of OSoL and OSrL ...
Definition: OSMatrix.h:2445
bool deepCopyFrom(ConReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5667
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
A concrete class that is used to store a specific type of matrix values, references to variable index...
Definition: OSMatrix.h:563
a data structure to represent a term in a linearMatrix element A term has the form c*x_{k}...
Definition: OSMatrix.h:373
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...
Definition: OSMatrix.cpp:94
int rowOffsetSize
These two parameters give the size of the rowOffset and colOffset arrays, respectively.
Definition: OSMatrix.h:1814
MatrixConstructor()
constructor
Definition: OSMatrix.cpp:145
virtual ~MatrixType()
Definition: OSMatrix.cpp:184
ConReferenceMatrixValues * value
The constraint references (indexes of core constraints and value types) of the elements.
Definition: OSMatrix.h:1181
to represent the nonzeros in an objReferenceMatrix element
Definition: OSMatrix.h:675
bool getRowMajor()
Returns whether the matrix is stored row-wise or column-wise.
Definition: OSMatrix.cpp:2880
a data structure to represent objective reference elements in a MatrixType object Each nonzero elemen...
Definition: OSMatrix.h:1091
a data structure to represent a point of departure for constructing a matrix by modifying parts of a ...
Definition: OSMatrix.h:1536
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:5315
std::vector< MatrixNode * > preOrderMatrixNodeTraversal(std::vector< MatrixNode * > *prefixVector)
bool deepCopyFrom(GeneralMatrixElements *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5181
virtual MatrixNode * cloneMatrixNode()=0
virtual bool deepCopyFrom(LinearMatrixValues *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:4852
bool IsEqual(OSMatrix *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:3715
bool IsEqual(MatrixBlocks *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:6253
a data structure to describe one step in the construction of a matrix. To facilitate parsing of compl...
Definition: OSMatrix.h:209
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...
Definition: OSMatrix.cpp:3974
IntVector * index
The index array of the (nonzero) elements.
Definition: OSMatrix.h:269
OSMatrix * baseMatrix
a pointer to the base matrix
Definition: OSMatrix.h:1547
bool IsEqual(LinearMatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4707
int conReference
contains a reference to a row of the problem (objective if negative, constraint otherwise) ...
Definition: OSMatrix.h:460
virtual std::string getNodeName()
Definition: OSMatrix.cpp:4400
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:5082
virtual std::string getNodeName()
Definition: OSMatrix.cpp:4635
ConReferenceMatrixValues()
-------— Methods for class ConReferenceMatrixValues -------—
Definition: OSMatrix.cpp:5674
MixedRowReferenceMatrixElements()
-------— Methods for class MixedRowReferenceMatrixElements -------—
Definition: OSMatrix.cpp:5838
virtual ENUM_MATRIX_TYPE getMatrixType()=0
bool IsEqual(MixedRowReferenceMatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:6066
OSnLMNode * transformation
A transformation is essentially an expression tree that evaluates to a matrix.
Definition: OSMatrix.h:1364
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:3949
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
virtual ~MatrixElementValues()
Definition: OSMatrix.cpp:2952
bool IsEqual(BaseMatrix *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:3986
a data structure to represent the nonzeros in a conReferenceMatrix element
Definition: OSMatrix.h:711
ConstantMatrixElements()
-------— Methods for class ConstantMatrixElements -------—
Definition: OSMatrix.cpp:4138
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:6207
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...
Definition: OSMatrix.cpp:6225
GeneralSparseMatrix * getMatrixCoefficientsInColumnMajor()
Definition: OSMatrix.cpp:275
int * index
index holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
Definition: OSMatrix.h:1708
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:3774
a data structure to represent the nonzero values in a generalMatrix element
Definition: OSMatrix.h:1005
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:5560
int * m_miColumnPartition
m_miColumnPartition is the partition vector of the matrix columns into blocks
Definition: OSMatrix.h:1929
int getRowPartitionSize()
get the size of the row partition of a matrix
Definition: OSMatrix.cpp:2101
int * el
Each el is a reference to a constraint defined in the &lt;constraints&gt; section of the OSiL file...
Definition: OSMatrix.h:569
bool IsEqual(ConstantMatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4232
virtual bool deepCopyFrom(GeneralMatrixValues *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5272
GeneralSparseMatrix()
Default constructor.
Definition: OSMatrix.cpp:6393
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:5176
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
bool IsEqual(MatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:2897
virtual ~MatrixNode()
destructor
Definition: OSMatrix.cpp:50
virtual bool deepCopyFrom(MatrixElementValues *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:2959
virtual bool deepCopyFrom(ObjReferenceMatrixValues *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5510
~GeneralSparseMatrix()
Default destructor.
Definition: OSMatrix.cpp:6428
unsigned int inumberOfChildren
inumberOfChildren is the number of MatrixNode child elements For the matrix types (OSMatrix and Matri...
Definition: OSMatrix.h:70
OSMatrixWithMatrixVarIdx()
-------— Methods for class OSMatrixWithMatrixVarIdx -------—
Definition: OSMatrix.cpp:3757
bool deepCopyFrom(OSMatrix *that)
A function to make a deep copy of an instance of this class.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:5505
LinearMatrixElement()
-------— Methods for class LinearMatrixElement -------—
Definition: OSMatrix.cpp:4869
virtual MixedRowReferenceMatrixElements * cloneMatrixNode()
Definition: OSMatrix.cpp:6059
VarReferenceMatrixValues()
-------— Methods for class VarReferenceMatrixValues -------—
Definition: OSMatrix.cpp:4520
bool deepCopyFrom(ObjReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5433
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...
Definition: OSMatrix.cpp:4695
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:5032
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:4847
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:4274
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...
Definition: OSMatrix.cpp:3411
bool b_deleteStartArray
b_deleteStartArray is true if we delete the start array in garbage collection — set to true by defaul...
Definition: OSMatrix.h:1662
int idx
Definition: OSMatrix.h:2188
ExpandedMatrixBlocks()
Default constructor.
Definition: OSMatrix.cpp:6513
bool b_deleteValueArray
b_deleteValueArray is true if we delete the value array in garbage collection — set to true by defaul...
Definition: OSMatrix.h:1674
int blockRowIdx
Definition: OSMatrix.h:2503
virtual std::string getNodeName()
Definition: OSMatrix.cpp:6191
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:4181
a data structure to represent row reference elements in a MatrixType object Each nonzero element refe...
Definition: OSMatrix.h:1264
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
Definition: OSMatrix.h:248
ScalarExpressionTree ** el
Definition: OSMatrix.h:642
bool deepCopyFrom(MatrixBlocks *that)
A function to make a deep copy of an instance of this class.
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
bool isBlockDiagonal()
A method to check whether a matrix is block-diagonal.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:5428
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool matrixHasElements()
Definition: OSMatrix.cpp:202
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
GeneralSparseMatrix ** blocks
blocks holds the blocks that make up the matrix.
Definition: OSMatrix.h:1838
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:3683
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:4054
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
virtual std::string getNodeName()
Definition: OSMatrix.cpp:5320
a data structure to represent variable reference elements in a MatrixType object Each nonzero element...
Definition: OSMatrix.h:835
virtual MatrixTransformation * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:4090
bool IsEqual(LinearMatrixValues *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4807
ObjReferenceMatrixValues()
-------— Methods for class ObjReferenceMatrixValues -------—
Definition: OSMatrix.cpp:5440
virtual std::string getNodeName()
Definition: OSMatrix.cpp:3939
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
int getColumnPartitionSize()
get the size of the column partition of a matrix
Definition: OSMatrix.cpp:2121
OSMatrixWithMatrixObjIdx()
-------— Methods for class OSMatrixWithMatrixObjIdx -------—
Definition: OSMatrix.cpp:3808
virtual std::string getNodeName()
Definition: OSMatrix.cpp:5555
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:5089
ENUM_NL_EXPR_SHAPE
Definition: OSParameters.h:830
bool deepCopyFrom(MatrixNode *that)
A function to make a deep copy of an instance of this class.
bool IsEqual(LinearMatrixElementTerm *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4994
double value
This element contains the value.
Definition: OSMatrix.h:469
bool IsEqual(ObjReferenceMatrixValues *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:5466
virtual bool expandElements(bool rowMajor)
A method to expand a matrix or block The result is a GeneralSparseMatrix object of constant matrix el...
Definition: OSMatrix.cpp:6363
bool baseTranspose
to allow the base matrix to be transposed before it is attached to the target matrix ...
Definition: OSMatrix.h:1572
virtual std::string getNodeName()
Definition: OSMatrix.cpp:3015
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:4405
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
A method to check whether a matrix or block is diagonal.
Definition: OSMatrix.cpp:191
OSMatrix * createConstructorTreeFromPrefix(std::vector< MatrixNode * > mtxConstructorVec)
Definition: OSMatrix.cpp:2987
bool IsEqual(VarReferenceMatrixValues *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4545
int baseMatrixIdx
the index of the base matrix
Definition: OSMatrix.h:1542
int getNumberOfTransformationConstructors()
Definition: OSMatrix.cpp:253
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:4749
virtual bool deepCopyFrom(ConReferenceMatrixValues *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:5755
int numberOfRows
Definition: OSMatrix.h:1904
virtual bool expandElements(bool rowMajor)
A method to expand a matrix or block The result is a GeneralSparseMatrix object of constant matrix el...
Definition: OSMatrix.cpp:1780
virtual bool processBlocks(bool rowMajor, ENUM_MATRIX_SYMMETRY symmetry)
A method to process a matrixType into a block structure defined by the &lt;blocks&gt; element or elements...
Definition: OSMatrix.cpp:2304
int * getRowPartition()
get the row partition of the matrix
Definition: OSMatrix.cpp:2111
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...
Definition: OSMatrix.cpp:5607
bool matrixHasTransformations()
Definition: OSMatrix.cpp:217
IntVector * rowOffset
An array listing the top row of each block within the larger matrix.
Definition: OSMatrix.h:1461
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:6186
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:5332
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:6380
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:3020
bool deepCopyFrom(MatrixType *that)
A function to make a deep copy of an instance of this class.
bool IsEqual(OSMatrixWithMatrixVarIdx *that)
A function to check for the equality of two objects.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:5823
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:3010
int valueSize
valueSize is the dimension of the index and value arrays
Definition: OSMatrix.h:1696
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixElementValues()
-------— Methods for class MatrixElementValues -------—
Definition: OSMatrix.cpp:2944
virtual LinearMatrixElements * cloneMatrixNode()
Definition: OSMatrix.cpp:4700
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
a data structure to represent the nonzero values in a linearMatrix element
Definition: OSMatrix.h:917
bool deepCopyFrom(LinearMatrixElements *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:4754
ENUM_MATRIX_CONSTRUCTOR_TYPE nType
nType is a unique integer assigned to each type of matrix node (see OSParameters.h) ...
Definition: OSMatrix.h:64
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
virtual OSMatrixWithMatrixVarIdx * cloneMatrixNode()
The implementation of the virtual functions.
Definition: OSMatrix.cpp:3800
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:4584
virtual std::string getMatrixNodeInXML()
Definition: OSMatrix.cpp:4647
virtual ENUM_MATRIX_TYPE getMatrixType()
Definition: OSMatrix.cpp:4064
ENUM_CONREFERENCE_VALUETYPE
An enum to track the type of value contained in a reference to a constraint.
Definition: OSParameters.h:703
bool IsEqual(ConReferenceMatrixElement *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:5785
virtual std::string getNodeName()
Definition: OSMatrix.cpp:5077
LinearMatrixElement * convertToLinearMatrixElement(double val)
Some methods to convert one type of matrix element into another.
Definition: OSMatrix.cpp:6635
~ExpandedMatrixBlocks()
Default destructor.
Definition: OSMatrix.cpp:6539
LinearMatrixElementTerm()
-------— Methods for class LinearMatrixElementTerm -------—
Definition: OSMatrix.cpp:4978
The OSnLNode Class for nonlinear expressions.
Definition: OSnLNode.h:179
ConstantMatrixValues * value
The value array of the (nonzero) constant elements.
Definition: OSMatrix.h:753
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool isDiagonal()
a method to determine whether the matrix is diagonal
Definition: OSMatrix.cpp:6483
this class extends OSMatrix for use, e.g., in the matrixObj section of OSoL and OSrL ...
Definition: OSMatrix.h:2391
bool IsEqual(MatrixBlock *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:6375
ConReferenceMatrixValues * value
The row references (indexes of core rows plus value type) of the elements.
Definition: OSMatrix.h:1275
ConReferenceMatrixElement ** el
el contains the indices of the matrix constraints along with the valueType.
Definition: OSMatrix.h:717
bool b_deleteIndexArray
b_deleteIndexArray is true if we delete the index array in garbage collection — set to true by defaul...
Definition: OSMatrix.h:1668
std::vector< MatrixNode * > getPostfixFromNodeTree()
bool deepCopyFrom(VarReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:4513
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...
Definition: OSMatrix.cpp:4220
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:5072
int startSize
startSize is the dimension of the starts array
Definition: OSMatrix.h:1691
GeneralSparseMatrix * getMatrixBlockInColumnMajorForm(int columnIdx, int rowIdx)
Definition: OSMatrix.cpp:2261
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Definition: OSMatrix.cpp:5750
int baseMatrixEndCol
Definition: OSMatrix.h:1567
ENUM_MATRIX_SYMMETRY symmetry
To track the type of symmetry present in the matrix or block.
Definition: OSMatrix.h:1896
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
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...
Definition: OSMatrix.cpp:6358
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
Definition: OSMatrix.cpp:5550
IntVector * start
A vector listing the row or column starts.
Definition: OSMatrix.h:266
int targetMatrixFirstCol
Definition: OSMatrix.h:1553
a data structure to represent a matrix object (derived from MatrixType)
Definition: OSMatrix.h:2185
int getNumberOfBlocksConstructors()
Definition: OSMatrix.cpp:264
BaseMatrix()
Standard constructor and destructor methods.
Definition: OSMatrix.cpp:3909
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, depending on the matrixType, of constant matrix elements, variable references, linear or nonlinear expressions, or objective and constraint references (possibly mixed).
Definition: OSMatrix.cpp:2807
MatrixBlocks()
-------— Methods for class MatrixBlocks -------—
Definition: OSMatrix.cpp:6120
bool deepCopyFrom(ConstantMatrixValues *that)
A function to make a deep copy of an instance of this class.
Definition: OSMatrix.cpp:4354
a data structure to represent an expression in a linearMatrix element A LinearMatrixElement is a (fin...
Definition: OSMatrix.h:411
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool IsEqual(ConReferenceMatrixValues *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:5711
std::string name
Definition: OSMatrix.h:2189
GeneralSparseMatrix * getBlock(int rowIdx, int colIdx)
a method to retrieve a particular block from a collection
Definition: OSMatrix.cpp:6595
bool matrixHasBlocks()
Definition: OSMatrix.cpp:227
bool IsEqual(VarReferenceMatrixElements *that)
A function to check for the equality of two objects.
Definition: OSMatrix.cpp:4466
int m_iColumnPartitionSize
m_iColumnPartitionSize gives the size of the m_miColumnPartition array, which is one more than the nu...
Definition: OSMatrix.h:1934
GeneralMatrixValues * value
The values are general nonlinear expressions.
Definition: OSMatrix.h:1011
GeneralMatrixValues()
-------— Methods for class GeneralMatrixValues -------—
Definition: OSMatrix.cpp:5188
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...
Definition: OSMatrix.cpp:4085
GeneralSparseMatrix * ExpandedMatrixInColumnMajorForm
Definition: OSMatrix.h:1912
MatrixType()
-------— Methods for class MatrixType -------—
Definition: OSMatrix.cpp:163
virtual bool expandElements(bool rowMajor)
A method to process a matrixType into a specific block structure.
Definition: OSMatrix.cpp:3031
int * colOffset
colOffset gives the column offsets of the block decomposition It does not have to correspond to the c...
Definition: OSMatrix.h:1809
int * getColumnPartition()
get the column partition of the matrix
Definition: OSMatrix.cpp:2131