19 #include "OSParameters.h"
186 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
304 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
395 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
435 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
487 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
548 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
588 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
625 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
661 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
697 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
735 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
820 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
903 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
991 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1076 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1162 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1248 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1343 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1432 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1521 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1639 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1752 bool display(
int secondaryDim);
1867 bool display(
int secondaryDim);
2091 virtual bool processBlocks(
int* rowOffset,
int rowOffsetSize,
int* colOffset,
2137 int* colPartition,
int colPartitionSize,
2138 bool rowMajor,
bool appendToBlockArray);
2153 int* colPartition,
int colPartitionSize,
2169 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
2321 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
2376 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
2431 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
2485 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
2578 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
virtual ENUM_MATRIX_TYPE getMatrixType()
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.
bool deepCopyFrom(ConReferenceMatrixElement *that)
A function to make a deep copy of an instance of this class.
bool display(int secondaryDim)
This method displays data structure in the matrix format.
ConReferenceMatrixElement * convertToConReferenceMatrixElement(int objref)
ConReferenceMatrixElement()
-------— Methods for class ConReferenceMatrixElement -------—
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
double scalarMultiplier
to allow the base matrix to be scaled before it is attached to the target matrix
virtual std::string getMatrixNodeInXML()
bool matrixHasBase()
Several tools to parse the constructor list of a matrix.
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.
LinearMatrixElementTerm ** varIdx
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
GeneralMatrixElements()
-------— Methods for class GeneralMatrixElements -------—
a data structure to represent row reference elements in a MatrixType object Each nonzero element is o...
~ObjReferenceMatrixValues()
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.
virtual bool IsEqual(MatrixNode *that)
A function to check for the equality of two objects.
virtual std::string getNodeName()
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 "el".
a sparse matrix data structure for matrices that can hold nonconstant values
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
virtual ENUM_MATRIX_TYPE getMatrixType()
int * start
start holds an integer array of start elements in the matrix, which points to the start of a column (...
virtual ConstantMatrixElements * cloneMatrixNode()
int getNumberOfElementConstructors()
bool IsEqual(GeneralMatrixValues *that)
A function to check for the equality of two objects.
bool printExpandedMatrix(bool rowMajor)
a utility routine to print the expanded matrix or block.
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.
VarReferenceMatrixElements()
-------— Methods for class VarReferenceMatrixElements -------—
virtual std::string getNodeName()=0
virtual ENUM_MATRIX_TYPE getMatrixType()
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.
virtual ENUM_MATRIX_TYPE getMatrixType()
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.
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
a data structure to represent the nonzeros in a generalMatrix element
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
a data structure to represent the constant elements in a MatrixType object
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
ENUM_MATRIX_TYPE vType
vType holds the type of all (nonzero) values in the collection of blocks contained in this set of blo...
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
~MixedRowReferenceMatrixElements()
bool processBlockPartition()
A method to determine the block structure of a matrixType as defined by the <blocks> element or eleme...
LinearMatrixElement ** el
ENUM_MATRIX_TYPE
An enum to track the many different types of values that a matrix can contain Note that these types a...
virtual ObjReferenceMatrixElements * cloneMatrixNode()
int numberOfValues
numberOfValues records the number of entries in the arrays that make up the instance of nonzeros ...
MatrixNode ** m_mChildren
m_mChildren holds all the children, that is, nodes used in the definition or construction of the curr...
bool deepCopyFrom(OSMatrixWithMatrixVarIdx *that)
A function to make a deep copy of an instance of this class.
ENUM_MATRIX_CONSTRUCTOR_TYPE
virtual std::string getMatrixNodeInXML()
bool IsEqual(ConstantMatrixValues *that)
A function to check for the equality of two objects.
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
to represent the nonzeros in a constantMatrix element
std::vector< MatrixNode * > getPrefixFromNodeTree()
ConReferenceMatrixElements()
-------— Methods for class ConReferenceMatrixElements -------—
bool display(int secondaryDim)
This method displays the data contained in the matrix.
int * rowOffset
rowOffset gives the row offsets of the block decomposition It does not have to correspond to the row ...
a data structure to represent an entry in a conReferenceMatrix element, which consists of a constrain...
std::vector< ExpandedMatrixBlocks * > ExpandedMatrixByBlocks
a data structure to represent the linear expressions in a LinearMatrixElement object ...
MatrixNode()
default constructor
ENUM_MATRIX_TYPE vType
vType holds the type of values found in the value array.
virtual OSMatrix * cloneMatrixNode()
The implementation of the virtual functions.
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).
virtual ~MatrixConstructor()
destructor
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...
~ConReferenceMatrixElement()
GeneralSparseMatrix * convertToOtherMajor(bool isColumnMajor)
A method to convert a matrix to the other major.
ScalarExpressionTree * convertToGeneralMatrixElement(double val)
OSMatrixWithMatrixConIdx()
-------— Methods for class OSMatrixWithMatrixConIdx -------—
OSMatrix()
-------— Methods for class OSMatrix -------—
ObjReferenceMatrixValues * value
The objective references (indexes of core objectives) of the elements.
~OSMatrixWithMatrixConIdx()
int baseMatrixStartRow
to select the position of the upper left corner of the portion of the base matrix that is to be selec...
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.
int m_iRowPartitionSize
m_iRowPartitionSize gives the size of the m_miRowPartition array, which is one more than the number o...
int blockNumber
blockNumber gives the number of blocks (which is the size of the blockRows and blockColumns arrays)...
bool deepCopyFrom(MixedRowReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
a data structure to represent the nonzeroes of a matrix in a blockwise fashion. Each block can be giv...
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
LinearMatrixValues()
-------— Methods for class LinearMatrixValues -------—
a data structure to represent a MatrixBlock object (derived from MatrixType)
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
int targetMatrixFirstRow
to pinpoint the position of the upper left corner of the base matrix within the target matrix ...
virtual ENUM_MATRIX_TYPE getMatrixType()
VarReferenceMatrixValues * value
The variable references (indexes of core variables) of the elements.
virtual ~MatrixElements()
virtual ENUM_MATRIX_TYPE getMatrixType()
virtual ENUM_MATRIX_TYPE getMatrixType()
virtual std::string getNodeName()
virtual std::string getMatrixNodeInXML()
The OSnLMNode Class for nonlinear expressions involving matrices.
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).
MatrixBlock()
-------— Methods for class MatrixBlock -------—
virtual OSMatrixWithMatrixObjIdx * cloneMatrixNode()
The implementation of the virtual functions.
virtual OSMatrixWithMatrixConIdx * cloneMatrixNode()
The implementation of the virtual functions.
bool IsEqual(LinearMatrixElement *that)
A function to check for the equality of two objects.
bool deepCopyFrom(ConstantMatrixElements *that)
A function to make a deep copy of an instance of this class.
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
this class extends OSMatrix for use, e.g., in the matrixVar section of OSoL and OSrL ...
bool IsEqual(ObjReferenceMatrixElements *that)
A function to check for the equality of two objects.
virtual std::string getMatrixNodeInXML()
bool deepCopyFrom(LinearMatrixElementTerm *that)
A function to make a deep copy of an instance of this class.
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...
virtual ConReferenceMatrixElements * cloneMatrixNode()
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
virtual std::string getNodeName()
bool isBlockDiagonal()
a method to determine whether the collection is blockDiagonal
virtual std::string getMatrixNodeInXML()
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...
a data structure to represent a MatrixType object (from which we derive OSMatrix and MatrixBlock) ...
ENUM_CONREFERENCE_VALUETYPE valueType
Several different types of values can be derived from a problem constraint.
virtual GeneralMatrixElements * cloneMatrixNode()
int * blockRows
blockRows holds an integer array of the row to which a block belongs.
virtual std::string getMatrixNodeInXML()
bool IsEqual(OSMatrixWithMatrixObjIdx *that)
A function to check for the equality of two objects.
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...
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool deepCopyFrom(MatrixBlock *that)
A function to make a deep copy of an instance of this class.
virtual VarReferenceMatrixElements * cloneMatrixNode()
~LinearMatrixElementTerm()
int * blockColumns
blockColumns holds an integer array of the column to which a block belongs.
bool isRowMajor
isRowMajor holds whether the (nonzero) values holding the data are stored by columnrow.
bool m_bHaveColumnPartition
m_bHaveColumnPartition tracks whether the column partition has been determined from the constructor l...
virtual std::string getMatrixNodeInXML()=0
GeneralSparseMatrix * getMatrixCoefficientsInRowMajor()
virtual MatrixBlock * cloneMatrixNode()
The implementation of the virtual functions.
bool deepCopyFrom(LinearMatrixElement *that)
A function to make a deep copy of an instance of this class.
~ConReferenceMatrixValues()
MatrixElements()
-------— Methods for class MatrixElements -------—
bool m_bHaveRowPartition
m_bHaveRowPartition tracks whether the row partition has been determined from the constructor list an...
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...
ObjReferenceMatrixElements()
-------— Methods for class ObjReferenceMatrixElements -------—
virtual MatrixBlocks * cloneMatrixNode()
The implementation of the virtual functions.
bool deepCopyFrom(OSMatrixWithMatrixConIdx *that)
A function to make a deep copy of an instance of this class.
LinearMatrixElements()
-------— Methods for class LinearMatrixElements -------—
Used to hold part of the instance in memory.
int * m_miRowPartition
m_miRowPartition is the partition vector of the matrix rows into blocks
ConstantMatrixValues()
-------— Methods for class ConstantMatrixValues -------—
this class extends OSMatrix for use, e.g., in the matrixCon section of OSoL and OSrL ...
bool deepCopyFrom(ConReferenceMatrixElements *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.
A concrete class that is used to store a specific type of matrix values, references to variable index...
a data structure to represent a term in a linearMatrix element A term has the form c*x_{k}...
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)=0
Check whether a submatrix aligns with the block partition of a matrix or block or other constructor...
int rowOffsetSize
These two parameters give the size of the rowOffset and colOffset arrays, respectively.
MatrixConstructor()
constructor
ConReferenceMatrixValues * value
The constraint references (indexes of core constraints and value types) of the elements.
to represent the nonzeros in an objReferenceMatrix element
bool getRowMajor()
Returns whether the matrix is stored row-wise or column-wise.
a data structure to represent objective reference elements in a MatrixType object Each nonzero elemen...
a data structure to represent a point of departure for constructing a matrix by modifying parts of a ...
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
~OSMatrixWithMatrixVarIdx()
std::vector< MatrixNode * > preOrderMatrixNodeTraversal(std::vector< MatrixNode * > *prefixVector)
~ConstantMatrixElements()
bool deepCopyFrom(GeneralMatrixElements *that)
A function to make a deep copy of an instance of this class.
virtual MatrixNode * cloneMatrixNode()=0
virtual bool deepCopyFrom(LinearMatrixValues *that)
A function to make a deep copy of an instance of this class.
bool IsEqual(OSMatrix *that)
A function to check for the equality of two objects.
bool IsEqual(MatrixBlocks *that)
A function to check for the equality of two objects.
a data structure to describe one step in the construction of a matrix. To facilitate parsing of compl...
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...
IntVector * index
The index array of the (nonzero) elements.
OSMatrix * baseMatrix
a pointer to the base matrix
bool IsEqual(LinearMatrixElements *that)
A function to check for the equality of two objects.
int conReference
contains a reference to a row of the problem (objective if negative, constraint otherwise) ...
virtual std::string getNodeName()
virtual ENUM_MATRIX_TYPE getMatrixType()
virtual std::string getNodeName()
ConReferenceMatrixValues()
-------— Methods for class ConReferenceMatrixValues -------—
MixedRowReferenceMatrixElements()
-------— Methods for class MixedRowReferenceMatrixElements -------—
virtual ENUM_MATRIX_TYPE getMatrixType()=0
bool IsEqual(MixedRowReferenceMatrixElements *that)
A function to check for the equality of two objects.
~ObjReferenceMatrixElements()
virtual std::string getMatrixNodeInXML()
IntVector * colOffset
An array listing the leftmost column of each block within the larger matrix It is assumed that the bl...
virtual ~MatrixElementValues()
bool IsEqual(BaseMatrix *that)
A function to check for the equality of two objects.
a data structure to represent the nonzeros in a conReferenceMatrix element
ConstantMatrixElements()
-------— Methods for class ConstantMatrixElements -------—
virtual std::string getMatrixNodeInXML()
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 * getMatrixCoefficientsInColumnMajor()
int * index
index holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
virtual std::string getMatrixNodeInXML()
a data structure to represent the nonzero values in a generalMatrix element
virtual ENUM_MATRIX_TYPE getMatrixType()
int * m_miColumnPartition
m_miColumnPartition is the partition vector of the matrix columns into blocks
int getRowPartitionSize()
get the size of the row partition of a matrix
int * el
Each el is a reference to a constraint defined in the <constraints> section of the OSiL file...
bool IsEqual(ConstantMatrixElements *that)
A function to check for the equality of two objects.
virtual bool deepCopyFrom(GeneralMatrixValues *that)
A function to make a deep copy of an instance of this class.
GeneralSparseMatrix()
Default constructor.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int baseMatrixEndRow
to select the position of the lower right corner of the portion of the base matrix that is to be sele...
bool IsEqual(MatrixElements *that)
A function to check for the equality of two objects.
virtual ~MatrixNode()
destructor
virtual bool deepCopyFrom(MatrixElementValues *that)
A function to check for the equality of two objects.
virtual bool deepCopyFrom(ObjReferenceMatrixValues *that)
A function to make a deep copy of an instance of this class.
~GeneralSparseMatrix()
Default destructor.
unsigned int inumberOfChildren
inumberOfChildren is the number of MatrixNode child elements For the matrix types (OSMatrix and Matri...
OSMatrixWithMatrixVarIdx()
-------— Methods for class OSMatrixWithMatrixVarIdx -------—
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.
LinearMatrixElement()
-------— Methods for class LinearMatrixElement -------—
virtual MixedRowReferenceMatrixElements * cloneMatrixNode()
VarReferenceMatrixValues()
-------— Methods for class VarReferenceMatrixValues -------—
bool deepCopyFrom(ObjReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
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...
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
~VarReferenceMatrixValues()
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
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...
bool b_deleteStartArray
b_deleteStartArray is true if we delete the start array in garbage collection — set to true by defaul...
ExpandedMatrixBlocks()
Default constructor.
bool b_deleteValueArray
b_deleteValueArray is true if we delete the value array in garbage collection — set to true by defaul...
virtual std::string getNodeName()
virtual std::string getMatrixNodeInXML()
a data structure to represent row reference elements in a MatrixType object Each nonzero element refe...
an abstract class to help represent the elements in a MatrixType object From this we derive concrete ...
ScalarExpressionTree ** el
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.
an integer Vector data structure
bool isBlockDiagonal()
A method to check whether a matrix is block-diagonal.
~OSMatrixWithMatrixObjIdx()
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
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.
virtual std::string getMatrixNodeInXML()
GeneralSparseMatrix * ExpandedMatrixInRowMajorForm
The matrix can be held in expanded form by rows or by columns and in a number of ways stored by block...
virtual std::string getNodeName()
a data structure to represent variable reference elements in a MatrixType object Each nonzero element...
bool IsEqual(LinearMatrixValues *that)
A function to check for the equality of two objects.
ObjReferenceMatrixValues()
-------— Methods for class ObjReferenceMatrixValues -------—
virtual std::string getNodeName()
LinearMatrixValues * value
The values are expressions of the form a_0 + a_1 x_{i_1} * a_2 x_{i_2} + ...
int getColumnPartitionSize()
get the size of the column partition of a matrix
OSMatrixWithMatrixObjIdx()
-------— Methods for class OSMatrixWithMatrixObjIdx -------—
virtual std::string getNodeName()
virtual std::string getMatrixNodeInXML()
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.
double value
This element contains the value.
bool IsEqual(ObjReferenceMatrixValues *that)
A function to check for the equality of two objects.
virtual bool expandElements(bool rowMajor)
A method to expand a matrix or block The result is a GeneralSparseMatrix object of constant matrix el...
bool baseTranspose
to allow the base matrix to be transposed before it is attached to the target matrix ...
virtual std::string getNodeName()
virtual ENUM_MATRIX_TYPE getMatrixType()
virtual bool alignsOnBlockBoundary(int firstRow, int firstColumn, int nRows, int nCols)
A method to check whether a matrix or block is diagonal.
OSMatrix * createConstructorTreeFromPrefix(std::vector< MatrixNode * > mtxConstructorVec)
bool IsEqual(VarReferenceMatrixValues *that)
A function to check for the equality of two objects.
~ConReferenceMatrixElements()
int baseMatrixIdx
the index of the base matrix
int getNumberOfTransformationConstructors()
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
virtual bool deepCopyFrom(ConReferenceMatrixValues *that)
A function to make a deep copy of an instance of this class.
virtual bool expandElements(bool rowMajor)
A method to expand a matrix or block The result is a GeneralSparseMatrix object of constant matrix el...
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...
int * getRowPartition()
get the row partition of the matrix
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...
bool matrixHasTransformations()
IntVector * rowOffset
An array listing the top row of each block within the larger matrix.
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
virtual std::string getMatrixNodeInXML()
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
virtual ENUM_MATRIX_TYPE getMatrixType()
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.
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
int valueSize
valueSize is the dimension of the index and value arrays
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 -------—
virtual LinearMatrixElements * cloneMatrixNode()
ENUM_MATRIX_TYPE matrixType
matrixType tracks the type of elements contained in this MatrixNode, which may be useful in solver se...
a data structure to represent the nonzero values in a linearMatrix element
bool deepCopyFrom(LinearMatrixElements *that)
A function to make a deep copy of an instance of this class.
ENUM_MATRIX_CONSTRUCTOR_TYPE nType
nType is a unique integer assigned to each type of matrix node (see OSParameters.h) ...
a sparse matrix data structure for matrices that can hold nonconstant values and have block structure...
bool isRowMajor
isRowMajor holds whether the matrix is stored by row.
virtual OSMatrixWithMatrixVarIdx * cloneMatrixNode()
The implementation of the virtual functions.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
virtual std::string getMatrixNodeInXML()
ENUM_CONREFERENCE_VALUETYPE
An enum to track the type of value contained in a reference to a constraint.
bool IsEqual(ConReferenceMatrixElement *that)
A function to check for the equality of two objects.
virtual std::string getNodeName()
LinearMatrixElement * convertToLinearMatrixElement(double val)
Some methods to convert one type of matrix element into another.
~ExpandedMatrixBlocks()
Default destructor.
LinearMatrixElementTerm()
-------— Methods for class LinearMatrixElementTerm -------—
The OSnLNode Class for nonlinear expressions.
ConstantMatrixValues * value
The value array of the (nonzero) constant elements.
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
this class extends OSMatrix for use, e.g., in the matrixObj section of OSoL and OSrL ...
bool IsEqual(MatrixBlock *that)
A function to check for the equality of two objects.
ConReferenceMatrixValues * value
The row references (indexes of core rows plus value type) of the elements.
ConReferenceMatrixElement ** el
el contains the indices of the matrix constraints along with the valueType.
bool b_deleteIndexArray
b_deleteIndexArray is true if we delete the index array in garbage collection — set to true by defaul...
std::vector< MatrixNode * > getPostfixFromNodeTree()
bool deepCopyFrom(VarReferenceMatrixElements *that)
A function to make a deep copy of an instance of this class.
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...
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
int startSize
startSize is the dimension of the starts array
GeneralSparseMatrix * getMatrixBlockInColumnMajorForm(int columnIdx, int rowIdx)
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ENUM_MATRIX_SYMMETRY symmetry
To track the type of symmetry present in the matrix or block.
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.
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...
virtual ENUM_MATRIX_CONSTRUCTOR_TYPE getNodeType()
IntVector * start
A vector listing the row or column starts.
a data structure to represent a matrix object (derived from MatrixType)
~VarReferenceMatrixElements()
int getNumberOfBlocksConstructors()
BaseMatrix()
Standard constructor and destructor methods.
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).
MatrixBlocks()
-------— Methods for class MatrixBlocks -------—
bool deepCopyFrom(ConstantMatrixValues *that)
A function to make a deep copy of an instance of this class.
a data structure to represent an expression in a linearMatrix element A LinearMatrixElement is a (fin...
bool IsEqual(ConReferenceMatrixValues *that)
A function to check for the equality of two objects.
GeneralSparseMatrix * getBlock(int rowIdx, int colIdx)
a method to retrieve a particular block from a collection
bool IsEqual(VarReferenceMatrixElements *that)
A function to check for the equality of two objects.
int m_iColumnPartitionSize
m_iColumnPartitionSize gives the size of the m_miColumnPartition array, which is one more than the nu...
GeneralMatrixValues * value
The values are general nonlinear expressions.
GeneralMatrixValues()
-------— Methods for class GeneralMatrixValues -------—
GeneralSparseMatrix * ExpandedMatrixInColumnMajorForm
MatrixType()
-------— Methods for class MatrixType -------—
virtual bool expandElements(bool rowMajor)
A method to process a matrixType into a specific block structure.
int * colOffset
colOffset gives the column offsets of the block decomposition It does not have to correspond to the c...
int * getColumnPartition()
get the column partition of the matrix