Cgl 0.59.7

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
ClpDummyMatrix Class Reference

This implements a dummy matrix as derived from ClpMatrixBase. More...

`#include <ClpDummyMatrix.hpp>`

Inheritance diagram for ClpDummyMatrix:
[legend]
Collaboration diagram for ClpDummyMatrix:
[legend]

## Public Member Functions
Useful methods
virtual CoinPackedMatrix * | getPackedMatrix () const
| Return a complete CoinPackedMatrix. More...
virtual bool | isColOrdered () const
| Whether the packed matrix is column major ordered or not. More...
virtual CoinBigIndex | getNumElements () const
| Number of entries in the packed matrix. More...
virtual int | getNumCols () const
| Number of columns. More...
virtual int | getNumRows () const
| Number of rows. More...
virtual const double * | getElements () const
| A vector containing the elements in the packed matrix. More...
virtual const int * | getIndices () const
| A vector containing the minor indices of the elements in the packed matrix. More...
virtual const CoinBigIndex * | getVectorStarts () const
virtual const int * | getVectorLengths () const
| The lengths of the major-dimension vectors. More...
virtual void | deleteCols (const int numDel, const int *indDel)
| Delete the columns whose indices are listed in `indDel`. More...
virtual void | deleteRows (const int numDel, const int *indDel)
| Delete the rows whose indices are listed in `indDel`. More...
virtual ClpMatrixBase * | reverseOrderedCopy () const
| Returns a new matrix in reverse order without gaps. More...
virtual CoinBigIndex | countBasis (const int *whichColumn, int &numberColumnBasic)
| Returns number of elements in column part of basis. More...
virtual void | fillBasis (ClpSimplex *model, const int *whichColumn, int &numberColumnBasic, int *row, int *start, int *rowCount, int *columnCount, CoinFactorizationDouble *element)
| Fills in column part of basis. More...
virtual void | unpack (const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const
| Unpacks a column into an CoinIndexedvector. More...
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. More...
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. More...
virtual void | add (const ClpSimplex *model, double *array, int column, double multiplier) const
| Adds multiple of a column into an array. More...
virtual void | releasePackedMatrix () const
| Allow any parts of a created CoinMatrix to be deleted Allow any parts of a created CoinPackedMatrix to be deleted. More...
Matrix times vector methods
virtual void | times (double scalar, const double *x, double *y) const
| Return `y + A * scalar *x` in `y`. More...
virtual void | times (double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const
| And for scaling. More...
virtual void | transposeTimes (double scalar, const double *x, double *y) const
| Return `y + x * scalar * A` in `y`. More...
virtual void | transposeTimes (double scalar, const double *x, double *y, const double *rowScale, const double *columnScale) const
| And for scaling. More...
virtual void | transposeTimes (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
| Return `x * scalar * A + y` in `z`. More...
virtual void | subsetTransposeTimes (const ClpSimplex *model, const CoinIndexedVector *x, const CoinIndexedVector *y, CoinIndexedVector *z) const
    Return <code>x *A</code> in <code>z</code> but
just for indices in y. More...
Constructors, destructor
| ClpDummyMatrix ()
| Default constructor. More...
| ClpDummyMatrix (int numberColumns, int numberRows, int numberElements)
| Constructor with data. More...
virtual | ~ClpDummyMatrix ()
| Destructor. More...
Copy method
| ClpDummyMatrix (const ClpDummyMatrix &)
| The copy constructor. More...
| ClpDummyMatrix (const CoinPackedMatrix &)
| The copy constructor from an CoinDummyMatrix. More...
ClpDummyMatrix & | operator= (const ClpDummyMatrix &)
virtual ClpMatrixBase * | clone () const
| Clone. More...
Public Member Functions inherited from ClpMatrixBase
virtual int | getVectorLength (int index) const
| The length of a single major-dimension vector. More...
virtual void | appendCols (int number, const CoinPackedVectorBase *const *columns)
| Append Columns. More...
virtual void | appendRows (int number, const CoinPackedVectorBase *const *rows)
| Append Rows. More...
virtual void | modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
| Modify one element of packed matrix. More...
virtual int | appendMatrix (int number, int type, const CoinBigIndex *starts, const int *index, const double *element, int numberOther=-1)
| Append a set of rows/columns to the end of the matrix. More...
virtual int | scale (ClpModel *, const ClpSimplex *=NULL) const
| Creates scales for column copy (rowCopy in model may be modified) default does not allow scaling returns non-zero if no scaling done. More...
virtual void | scaleRowCopy (ClpModel *) const
| Scales rowCopy if column copy scaled Only called if scales already exist. More...
virtual bool | canGetRowCopy () const
| Returns true if can create row copy. More...
virtual ClpMatrixBase * | scaledColumnCopy (ClpModel *) const
| Realy really scales column copy Only called if scales already exist. More...
virtual bool | allElementsInRange (ClpModel *, double, double, int=15)
| Checks if all elements are in valid range. More...
virtual void | setDimensions (int numrows, int numcols)
| Set the dimensions of the matrix. More...
virtual void | rangeOfElements (double &smallestNegative, double &largestNegative, double &smallestPositive, double &largestPositive)
| Returns largest and smallest elements of both signs. More...
virtual int | refresh (ClpSimplex *)
| Purely for column generation and similar ideas. More...
virtual void | reallyScale (const double *rowScale, const double *columnScale)
virtual CoinBigIndex * | dubiousWeights (const ClpSimplex *model, int *inputWeights) const
| Given positive integer weights for each row fills in sum of weights for each column (and slack). More...
virtual bool | canDoPartialPricing () const
| Says whether it can do partial pricing. More...
virtual int | hiddenRows () const
| Returns number of hidden rows e.g. gub. More...
virtual void | partialPricing (ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
| Partial pricing. More...
virtual int | extendUpdated (ClpSimplex *model, CoinIndexedVector *update, int mode)
| expands an updated column to allow for extra rows which the main solver does not know about and returns number added. More...
virtual void | primalExpanded (ClpSimplex *model, int mode)
| utility primal function for dealing with dynamic constraints mode=0 - Set up before "update" and "times" for primal solution using extended rows mode=1 - Cleanup primal solution after "times" using extended rows. More...
virtual void | dualExpanded (ClpSimplex *model, CoinIndexedVector *array, double *other, int mode)
| utility dual function for dealing with dynamic constraints mode=0 - Set up before "updateTranspose" and "transposeTimes" for duals using extended updates array (and may use other if dual values pass) mode=1 - Update dual solution after "transposeTimes" using extended rows. More...
virtual int | generalExpanded (ClpSimplex *model, int mode, int &number)
| general utility function for dealing with dynamic constraints mode=0 - Create list of non-key basics in pivotVariable_ using number as numberBasic in and out mode=1 - Set all key variables as basic mode=2 - return number extra rows needed, number gives maximum number basic mode=3 - before replaceColumn mode=4 - return 1 if can do primal, 2 if dual, 3 if both mode=5 - save any status stuff (when in good state) mode=6 - restore status stuff mode=7 - flag given variable (normally sequenceIn) mode=8 - unflag all variables mode=9 - synchronize costs and bounds mode=10 - return 1 if there may be changing bounds on variable (column generation) mode=11 - make sure set is clean (used when a variable rejected - but not flagged) mode=12 - after factorize but before permute stuff mode=13 - at end of simplex to delete stuff More...
virtual int | updatePivot (ClpSimplex *model, double oldInValue, double oldOutValue)
| update information for a pivot (and effective rhs) More...
virtual void | createVariable (ClpSimplex *model, int &bestSequence)
| Creates a variable. More...
virtual int | checkFeasible (ClpSimplex *model, double &sum) const
| Just for debug if odd type matrix. More...
double | reducedCost (ClpSimplex *model, int sequence) const
| Returns reduced cost of a variable. More...
virtual void | correctSequence (const ClpSimplex *model, int &sequenceIn, int &sequenceOut)
| Correct sequence in and out to give true value (if both -1 maybe do whole matrix) More...
virtual void | times (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const =0
| Return `y + A * x * scalar` in `y`. More...
virtual void | times (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y, const double *COIN_RESTRICT rowScale, const double *COIN_RESTRICT columnScale) const
| And for scaling - default aborts for when scaling not supported (unless pointers NULL when as normal) More...
virtual void | transposeTimes (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y) const =0
| Return `y + x * scalar * A` in `y`. More...
virtual void | transposeTimes (double scalar, const double *COIN_RESTRICT x, double *COIN_RESTRICT y, const double *COIN_RESTRICT rowScale, const double *COIN_RESTRICT columnScale, double *COIN_RESTRICT spare=NULL) const
| And for scaling - default aborts for when scaling not supported (unless pointers NULL when as normal) More...
virtual bool | canCombine (const ClpSimplex *, const CoinIndexedVector *) const
| Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster. More...
virtual void | transposeTimes2 (const ClpSimplex *model, const CoinIndexedVector *pi1, CoinIndexedVector *dj1, const CoinIndexedVector *pi2, CoinIndexedVector *spare, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
| Updates two arrays for steepest and does devex weights (need not be coded) More...
virtual void | subsetTimes2 (const ClpSimplex *model, CoinIndexedVector *dj1, const CoinIndexedVector *pi2, CoinIndexedVector *dj2, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
| Updates second array for steepest and does devex weights (need not be coded) More...
virtual void | listTransposeTimes (const ClpSimplex *model, double *x, int *y, int number, double *z) const
| Return `x *A` in `z` but just for number indices in y. More...
virtual ClpMatrixBase * | subsetClone (int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
| Subset clone (without gaps). More...
virtual void | backToBasics ()
| Gets rid of any mutable by products. More...
int | type () const
| Returns type. More...
void | setType (int newtype)
| Sets type. More...
void | useEffectiveRhs (ClpSimplex *model)
| Sets up an effective RHS. More...
virtual double * | rhsOffset (ClpSimplex *model, bool forceRefresh=false, bool check=false)
| Returns effective RHS offset if it is being used. More...
int | lastRefresh () const
| If rhsOffset used this is iteration last refreshed. More...
int | refreshFrequency () const
| If rhsOffset used this is refresh frequency (0==off) More...
void | setRefreshFrequency (int value)
bool | skipDualCheck () const
| whether to skip dual checks most of time More...
void | setSkipDualCheck (bool yes)
int | minimumObjectsScan () const
| Partial pricing tuning parameter - minimum number of "objects" to scan. More...
void | setMinimumObjectsScan (int value)
int | minimumGoodReducedCosts () const
| Partial pricing tuning parameter - minimum number of negative reduced costs to get. More...
void | setMinimumGoodReducedCosts (int value)
double | startFraction () const
| Current start of search space in matrix (as fraction) More...
void | setStartFraction (double value)
double | endFraction () const
| Current end of search space in matrix (as fraction) More...
void | setEndFraction (double value)
double | savedBestDj () const
| Current best reduced cost. More...
void | setSavedBestDj (double value)
int | originalWanted () const
| Initial number of negative reduced costs wanted. More...
void | setOriginalWanted (int value)
int | currentWanted () const
| Current number of negative reduced costs which we still need. More...
void | setCurrentWanted (int value)
int | savedBestSequence () const
| Current best sequence. More...
void | setSavedBestSequence (int value)
virtual | ~ClpMatrixBase ()
| Destructor (has to be public) More...

## Protected Attributes
Data members
The data members are protected to allow access for derived classes.
int | numberRows_
| Number of rows. More...
int | numberColumns_
| Number of columns. More...
int | numberElements_
| Number of elements. More...
Protected Attributes inherited from ClpMatrixBase
double * | rhsOffset_
| Effective RHS offset if it is being used. More...
double | startFraction_
| Current start of search space in matrix (as fraction) More...
double | endFraction_
| Current end of search space in matrix (as fraction) More...
double | savedBestDj_
| Best reduced cost so far. More...
int | originalWanted_
| Initial number of negative reduced costs wanted. More...
int | currentWanted_
| Current number of negative reduced costs which we still need. More...
int | savedBestSequence_
| Saved best sequence in pricing. More...
int | type_
| type (may be useful) More...
int | lastRefresh_
| If rhsOffset used this is iteration last refreshed. More...
int | refreshFrequency_
| If rhsOffset used this is refresh frequency (0==off) More...
int | minimumObjectsScan_
| Partial pricing tuning parameter - minimum number of "objects" to scan. More...
int | minimumGoodReducedCosts_
| Partial pricing tuning parameter - minimum number of negative reduced costs to get. More...
int | trueSequenceIn_
| True sequence in (i.e. from larger problem) More...
int | trueSequenceOut_
| True sequence out (i.e. from larger problem) More...
bool | skipDualCheck_
| whether to skip dual checks most of time More...

## Detailed Description

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 20 of file ClpDummyMatrix.hpp.

## Constructor & Destructor Documentation

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.

## Member Function Documentation

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 28 of file ClpDummyMatrix.hpp.

virtual CoinBigIndex ClpDummyMatrix::getNumElements | ( |  | ) | const
| inline virtual

Number of entries in the packed matrix.

Implements ClpMatrixBase.

Definition at line 32 of file ClpDummyMatrix.hpp.

virtual int ClpDummyMatrix::getNumCols | ( |  | ) | const
| inline virtual

Number of columns.

Implements ClpMatrixBase.

Definition at line 36 of file ClpDummyMatrix.hpp.

virtual int ClpDummyMatrix::getNumRows | ( |  | ) | const
| inline virtual

Number of rows.

Implements ClpMatrixBase.

Definition at line 40 of file ClpDummyMatrix.hpp.

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

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 | ( | const int * | whichColumn,
|  | 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,
|  | CoinFactorizationDouble * | 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 96 of file ClpDummyMatrix.hpp.

virtual void ClpDummyMatrix::times | ( | double | scalar,
|  | const double * | x,
|  | double * | y
| ) |  | const
| virtual

Return `y + A * scalar *x` in `y`.

Precondition
  `x` must be of size `numColumns()`
  `y` must be of size `numRows()`

virtual void ClpDummyMatrix::times | ( | double | scalar,
|  | const double * | x,
|  | double * | y,
|  | const double * | rowScale,
|  | const double * | columnScale
| ) |  | const
| virtual

And for scaling.

virtual void ClpDummyMatrix::transposeTimes | ( | double | scalar,
|  | const double * | x,
|  | double * | y
| ) |  | const
| virtual

Return `y + x * scalar * A` in `y`.

Precondition
  `x` must be of size `numRows()`
  `y` must be of size `numColumns()`

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 <code>x *A</code> in <code>z</code> 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 & |  | ) |

virtual ClpMatrixBase* ClpDummyMatrix::clone | ( |  | ) | const
| virtual

Clone.

Implements ClpMatrixBase.

## Member Data Documentation

int ClpDummyMatrix::numberRows_
| protected

Number of rows.

Definition at line 174 of file ClpDummyMatrix.hpp.

int ClpDummyMatrix::numberColumns_
| protected

Number of columns.

Definition at line 176 of file ClpDummyMatrix.hpp.

int ClpDummyMatrix::numberElements_
| protected

Number of elements.

Definition at line 178 of file ClpDummyMatrix.hpp.

The documentation for this class was generated from the following file:

- /home/coin/svn-release/Cgl-0.59.7/Clp/src/ClpDummyMatrix.hpp