This implements a dummy matrix as derived from ClpMatrixBase. More...
#include <ClpDummyMatrix.hpp>
Public Member Functions | |
Useful methods | |
virtual CoinPackedMatrix * | getPackedMatrix () const |
Return a complete CoinPackedMatrix. | |
virtual bool | isColOrdered () const |
Whether the packed matrix is column major ordered or not. | |
virtual CoinBigIndex | getNumElements () const |
Number of entries in the packed matrix. | |
virtual int | getNumCols () const |
Number of columns. | |
virtual int | getNumRows () const |
Number of rows. | |
virtual const double * | getElements () const |
A vector containing the elements in the packed matrix. | |
virtual const int * | getIndices () const |
A vector containing the minor indices of the elements in the packed matrix. | |
virtual const CoinBigIndex * | getVectorStarts () const |
Return a complete CoinPackedMatrix. | |
virtual const int * | getVectorLengths () const |
The lengths of the major-dimension vectors. | |
virtual void | deleteCols (const int numDel, const int *indDel) |
Delete the columns whose indices are listed in indDel . | |
virtual void | deleteRows (const int numDel, const int *indDel) |
Delete the rows whose indices are listed in indDel . | |
virtual ClpMatrixBase * | reverseOrderedCopy () const |
Returns a new matrix in reverse order without gaps. | |
virtual CoinBigIndex | countBasis (ClpSimplex *model, const int *whichColumn, int numberRowBasic, int &numberColumnBasic) |
Returns number of elements in column part of basis. | |
virtual void | fillBasis (ClpSimplex *model, const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, double *element) |
Fills in column part of basis. | |
virtual void | unpack (const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const |
Unpacks a column into an CoinIndexedvector. | |
virtual void | unpackPacked (ClpSimplex *model, CoinIndexedVector *rowArray, int column) const |
Unpacks a column into an CoinIndexedvector in packed foramt Note that model is NOT const. | |
virtual void | add (const ClpSimplex *model, CoinIndexedVector *rowArray, int column, double multiplier) const |
Adds multiple of a column into an CoinIndexedvector You can use quickAdd to add to vector. | |
virtual void | add (const ClpSimplex *model, double *array, int column, double multiplier) const |
Adds multiple of a column into an array. | |
virtual void | releasePackedMatrix () const |
Allow any parts of a created CoinMatrix to be deleted. | |
Matrix times vector methods | |
virtual void | times (double scalar, const double *x, double *y) const |
Return y + A * scalar *x in y . | |
virtual void | times (double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const |
And for scaling. | |
virtual void | transposeTimes (double scalar, const double *x, double *y) const |
Return y + x * scalar * A in y . | |
virtual void | transposeTimes (double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const |
And for scaling. | |
virtual void | transposeTimes (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const |
Return x * scalar * A + y in z . | |
virtual void | subsetTransposeTimes (const ClpSimplex *model, const CoinIndexedVector *x, const CoinIndexedVector *y, CoinIndexedVector *z) const |
Return x *A in z but just for indices in y. | |
Constructors, destructor | |
ClpDummyMatrix () | |
Default constructor. | |
ClpDummyMatrix (int numberColumns, int numberRows, int numberElements) | |
Constructor with data. | |
virtual | ~ClpDummyMatrix () |
Destructor. | |
Copy method | |
ClpDummyMatrix (const ClpDummyMatrix &) | |
The copy constructor. | |
ClpDummyMatrix (const CoinPackedMatrix &) | |
The copy constructor from an CoinDummyMatrix. | |
ClpDummyMatrix & | operator= (const ClpDummyMatrix &) |
The copy constructor. | |
virtual ClpMatrixBase * | clone () const |
Clone. | |
Protected Attributes | |
Data members | |
int | numberRows_ |
Number of rows. | |
int | numberColumns_ |
Number of columns. | |
int | numberElements_ |
Number of elements. |
This implements a dummy matrix as derived from ClpMatrixBase.
This is so you can do ClpPdco but may come in useful elsewhere. It just has dimensions but no data
Definition at line 17 of file ClpDummyMatrix.hpp.
ClpDummyMatrix::ClpDummyMatrix | ( | ) |
Default constructor.
ClpDummyMatrix::ClpDummyMatrix | ( | int | numberColumns, | |
int | numberRows, | |||
int | numberElements | |||
) |
Constructor with data.
virtual ClpDummyMatrix::~ClpDummyMatrix | ( | ) | [virtual] |
Destructor.
ClpDummyMatrix::ClpDummyMatrix | ( | const ClpDummyMatrix & | ) |
The copy constructor.
ClpDummyMatrix::ClpDummyMatrix | ( | const CoinPackedMatrix & | ) |
The copy constructor from an CoinDummyMatrix.
virtual CoinPackedMatrix* ClpDummyMatrix::getPackedMatrix | ( | ) | const [virtual] |
Return a complete CoinPackedMatrix.
Implements ClpMatrixBase.
virtual bool ClpDummyMatrix::isColOrdered | ( | ) | const [inline, virtual] |
Whether the packed matrix is column major ordered or not.
Implements ClpMatrixBase.
Definition at line 25 of file ClpDummyMatrix.hpp.
virtual CoinBigIndex ClpDummyMatrix::getNumElements | ( | ) | const [inline, virtual] |
Number of entries in the packed matrix.
Implements ClpMatrixBase.
Definition at line 27 of file ClpDummyMatrix.hpp.
virtual int ClpDummyMatrix::getNumCols | ( | ) | const [inline, virtual] |
virtual int ClpDummyMatrix::getNumRows | ( | ) | const [inline, virtual] |
virtual const double* ClpDummyMatrix::getElements | ( | ) | const [virtual] |
A vector containing the elements in the packed matrix.
Note that there might be gaps in this list, entries that do not belong to any major-dimension vector. To get the actual elements one should look at this vector together with vectorStarts and vectorLengths.
Implements ClpMatrixBase.
virtual const int* ClpDummyMatrix::getIndices | ( | ) | const [virtual] |
A vector containing the minor indices of the elements in the packed matrix.
Note that there might be gaps in this list, entries that do not belong to any major-dimension vector. To get the actual elements one should look at this vector together with vectorStarts and vectorLengths.
Implements ClpMatrixBase.
virtual const CoinBigIndex* ClpDummyMatrix::getVectorStarts | ( | ) | const [virtual] |
Return a complete CoinPackedMatrix.
Implements ClpMatrixBase.
virtual const int* ClpDummyMatrix::getVectorLengths | ( | ) | const [virtual] |
The lengths of the major-dimension vectors.
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::deleteCols | ( | const int | numDel, | |
const int * | indDel | |||
) | [virtual] |
Delete the columns whose indices are listed in indDel
.
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::deleteRows | ( | const int | numDel, | |
const int * | indDel | |||
) | [virtual] |
Delete the rows whose indices are listed in indDel
.
Implements ClpMatrixBase.
virtual ClpMatrixBase* ClpDummyMatrix::reverseOrderedCopy | ( | ) | const [virtual] |
Returns a new matrix in reverse order without gaps.
Reimplemented from ClpMatrixBase.
virtual CoinBigIndex ClpDummyMatrix::countBasis | ( | ClpSimplex * | model, | |
const int * | whichColumn, | |||
int | numberRowBasic, | |||
int & | numberColumnBasic | |||
) | [virtual] |
Returns number of elements in column part of basis.
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::fillBasis | ( | ClpSimplex * | model, | |
const int * | whichColumn, | |||
int & | numberColumnBasic, | |||
int * | row, | |||
int * | start, | |||
int * | rowCount, | |||
int * | columnCount, | |||
double * | element | |||
) | [virtual] |
Fills in column part of basis.
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::unpack | ( | const ClpSimplex * | model, | |
CoinIndexedVector * | rowArray, | |||
int | column | |||
) | const [virtual] |
Unpacks a column into an CoinIndexedvector.
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::unpackPacked | ( | ClpSimplex * | model, | |
CoinIndexedVector * | rowArray, | |||
int | column | |||
) | const [virtual] |
Unpacks a column into an CoinIndexedvector in packed foramt Note that model is NOT const.
Bounds and objective could be modified if doing column generation (just for this variable)
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::add | ( | const ClpSimplex * | model, | |
CoinIndexedVector * | rowArray, | |||
int | column, | |||
double | multiplier | |||
) | const [virtual] |
Adds multiple of a column into an CoinIndexedvector You can use quickAdd to add to vector.
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::add | ( | const ClpSimplex * | model, | |
double * | array, | |||
int | column, | |||
double | multiplier | |||
) | const [virtual] |
Adds multiple of a column into an array.
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::releasePackedMatrix | ( | ) | const [inline, virtual] |
Allow any parts of a created CoinMatrix to be deleted.
Allow any parts of a created CoinPackedMatrix to be deleted
Implements ClpMatrixBase.
Definition at line 88 of file ClpDummyMatrix.hpp.
virtual void ClpDummyMatrix::times | ( | double | scalar, | |
const double * | x, | |||
double * | y | |||
) | const [virtual] |
Return y + A * scalar *x
in y
.
x
must be of size numColumns()
y
must be of size numRows()
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::times | ( | double | scalar, | |
const double * | x, | |||
double * | y, | |||
const double * | rowScale, | |||
const double * | columnScale | |||
) | const [virtual] |
And for scaling.
Reimplemented from ClpMatrixBase.
virtual void ClpDummyMatrix::transposeTimes | ( | double | scalar, | |
const double * | x, | |||
double * | y | |||
) | const [virtual] |
Return y + x * scalar * A
in y
.
x
must be of size numRows()
y
must be of size numColumns()
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::transposeTimes | ( | double | scalar, | |
const double * | x, | |||
double * | y, | |||
const double * | rowScale, | |||
const double * | columnScale | |||
) | const [virtual] |
And for scaling.
virtual void ClpDummyMatrix::transposeTimes | ( | const ClpSimplex * | model, | |
double | scalar, | |||
const CoinIndexedVector * | x, | |||
CoinIndexedVector * | y, | |||
CoinIndexedVector * | z | |||
) | const [virtual] |
Return x * scalar * A + y
in z
.
Can use y as temporary array (will be empty at end) Note - If x packed mode - then z packed mode
Implements ClpMatrixBase.
virtual void ClpDummyMatrix::subsetTransposeTimes | ( | const ClpSimplex * | model, | |
const CoinIndexedVector * | x, | |||
const CoinIndexedVector * | y, | |||
CoinIndexedVector * | z | |||
) | const [virtual] |
Return x *A
in z
but just for indices in y.
Note - If x packed mode - then z packed mode Squashes small elements and knows about ClpSimplex
Implements ClpMatrixBase.
ClpDummyMatrix& ClpDummyMatrix::operator= | ( | const ClpDummyMatrix & | ) |
The copy constructor.
Reimplemented from ClpMatrixBase.
virtual ClpMatrixBase* ClpDummyMatrix::clone | ( | ) | const [virtual] |
Clone.
Implements ClpMatrixBase.
int ClpDummyMatrix::numberRows_ [protected] |
Number of rows.
Definition at line 166 of file ClpDummyMatrix.hpp.
int ClpDummyMatrix::numberColumns_ [protected] |
Number of columns.
Definition at line 168 of file ClpDummyMatrix.hpp.
int ClpDummyMatrix::numberElements_ [protected] |
Number of elements.
Definition at line 170 of file ClpDummyMatrix.hpp.