Cbc  2.9.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members
ClpMatrixBase Class Referenceabstract

Abstract base class for Clp Matrices. More...

#include <ClpMatrixBase.hpp>

+ Inheritance diagram for ClpMatrixBase:

Public Member Functions

Virtual methods that the derived classes must provide
virtual CoinPackedMatrixgetPackedMatrix () const =0
 Return a complete CoinPackedMatrix. More...
 
virtual bool isColOrdered () const =0
 Whether the packed matrix is column major ordered or not. More...
 
virtual CoinBigIndex getNumElements () const =0
 Number of entries in the packed matrix. More...
 
virtual int getNumCols () const =0
 Number of columns. More...
 
virtual int getNumRows () const =0
 Number of rows. More...
 
virtual const double * getElements () const =0
 A vector containing the elements in the packed matrix. More...
 
virtual const int * getIndices () const =0
 A vector containing the minor indices of the elements in the packed matrix. More...
 
virtual const CoinBigIndexgetVectorStarts () const =0
 
virtual const int * getVectorLengths () const =0
 The lengths of the major-dimension vectors. More...
 
virtual int getVectorLength (int index) const
 The length of a single major-dimension vector. More...
 
virtual void deleteCols (const int numDel, const int *indDel)=0
 Delete the columns whose indices are listed in indDel. More...
 
virtual void deleteRows (const int numDel, const int *indDel)=0
 Delete the rows whose indices are listed in indDel. 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 ClpMatrixBasereverseOrderedCopy () const
 Returns a new matrix in reverse order without gaps Is allowed to return NULL if doesn't want to have row copy. More...
 
virtual CoinBigIndex countBasis (const int *whichColumn, int &numberColumnBasic)=0
 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)=0
 Fills in column part of basis. 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 ClpMatrixBasescaledColumnCopy (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 void unpack (const ClpSimplex *model, CoinIndexedVector *rowArray, int column) const =0
 Unpacks a column into an CoinIndexedvector. More...
 
virtual void unpackPacked (ClpSimplex *model, CoinIndexedVector *rowArray, int column) const =0
 Unpacks a column into an CoinIndexedvector in packed format Note that model is NOT const. More...
 
virtual int refresh (ClpSimplex *)
 Purely for column generation and similar ideas. More...
 
virtual void reallyScale (const double *rowScale, const double *columnScale)
 
virtual CoinBigIndexdubiousWeights (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 void add (const ClpSimplex *model, CoinIndexedVector *rowArray, int column, double multiplier) const =0
 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 =0
 Adds multiple of a column into an array. More...
 
virtual void releasePackedMatrix () const =0
 Allow any parts of a created CoinPackedMatrix to be deleted. 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...
 
Matrix times vector methods

They can be faster if scalar is +- 1 Also for simplex I am not using basic/non-basic split

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 void transposeTimes (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const =0
 Return x * scalar *A + y in z. More...
 
virtual void subsetTransposeTimes (const ClpSimplex *model, const CoinIndexedVector *x, const CoinIndexedVector *y, CoinIndexedVector *z) const =0
 Return x *A in z but just for indices in y. 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...
 
Other

Clone

virtual ClpMatrixBaseclone () const =0
 
virtual ClpMatrixBasesubsetClone (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)
 

Protected Attributes

Data members

The data members are protected to allow access for derived classes.

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...
 

Constructors, destructor<br>

NOTE: All constructors are protected.

There's no need to expose them, after all, this is an abstract class.

virtual ~ClpMatrixBase ()
 Destructor (has to be public) More...
 
 ClpMatrixBase ()
 Default constructor. More...
 
 ClpMatrixBase (const ClpMatrixBase &)
 
ClpMatrixBaseoperator= (const ClpMatrixBase &)
 

Detailed Description

Abstract base class for Clp Matrices.

Since this class is abstract, no object of this type can be created.

If a derived class provides all methods then all Clp algorithms should work. Some can be very inefficient e.g. getElements etc is only used for tightening bounds for dual and the copies are deleted. Many methods can just be dummy i.e. abort(); if not all features are being used. So if column generation was being done then it makes no sense to do steepest edge so there would be no point providing subsetTransposeTimes.

Definition at line 38 of file ClpMatrixBase.hpp.

Constructor & Destructor Documentation

ClpMatrixBase::ClpMatrixBase ( )
protected

Default constructor.

virtual ClpMatrixBase::~ClpMatrixBase ( )
virtual

Destructor (has to be public)

ClpMatrixBase::ClpMatrixBase ( const ClpMatrixBase )
protected

Member Function Documentation

virtual CoinPackedMatrix* ClpMatrixBase::getPackedMatrix ( ) const
pure virtual
virtual bool ClpMatrixBase::isColOrdered ( ) const
pure virtual

Whether the packed matrix is column major ordered or not.

Implemented in ClpPackedMatrix, ClpDummyMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual CoinBigIndex ClpMatrixBase::getNumElements ( ) const
pure virtual

Number of entries in the packed matrix.

Implemented in ClpPackedMatrix, ClpDummyMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual int ClpMatrixBase::getNumCols ( ) const
pure virtual

Number of columns.

Implemented in ClpPackedMatrix, ClpDummyMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual int ClpMatrixBase::getNumRows ( ) const
pure virtual

Number of rows.

Implemented in ClpPackedMatrix, ClpDummyMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual const double* ClpMatrixBase::getElements ( ) const
pure 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.

Implemented in ClpPackedMatrix, ClpDummyMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual const int* ClpMatrixBase::getIndices ( ) const
pure 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.

Implemented in ClpPackedMatrix, ClpDummyMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual const CoinBigIndex* ClpMatrixBase::getVectorStarts ( ) const
pure virtual
virtual const int* ClpMatrixBase::getVectorLengths ( ) const
pure virtual

The lengths of the major-dimension vectors.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpDummyMatrix, and ClpPlusMinusOneMatrix.

virtual int ClpMatrixBase::getVectorLength ( int  index) const
virtual

The length of a single major-dimension vector.

Reimplemented in ClpPackedMatrix.

virtual void ClpMatrixBase::deleteCols ( const int  numDel,
const int *  indDel 
)
pure virtual

Delete the columns whose indices are listed in indDel.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpDummyMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::deleteRows ( const int  numDel,
const int *  indDel 
)
pure virtual

Delete the rows whose indices are listed in indDel.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpDummyMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::appendCols ( int  number,
const CoinPackedVectorBase *const *  columns 
)
virtual

Append Columns.

Reimplemented in ClpPackedMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::appendRows ( int  number,
const CoinPackedVectorBase *const *  rows 
)
virtual

Append Rows.

Reimplemented in ClpPackedMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::modifyCoefficient ( int  row,
int  column,
double  newElement,
bool  keepZero = false 
)
virtual

Modify one element of packed matrix.

An element may be added. This works for either ordering If the new element is zero it will be deleted unless keepZero true

Reimplemented in ClpPackedMatrix.

virtual int ClpMatrixBase::appendMatrix ( int  number,
int  type,
const CoinBigIndex starts,
const int *  index,
const double *  element,
int  numberOther = -1 
)
virtual

Append a set of rows/columns to the end of the matrix.

Returns number of errors i.e. if any of the new rows/columns contain an index that's larger than the number of columns-1/rows-1 (if numberOther>0) or duplicates If 0 then rows, 1 if columns

Reimplemented in ClpPackedMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual ClpMatrixBase* ClpMatrixBase::reverseOrderedCopy ( ) const
inlinevirtual

Returns a new matrix in reverse order without gaps Is allowed to return NULL if doesn't want to have row copy.

Reimplemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, ClpDummyMatrix, and ClpGubMatrix.

Definition at line 96 of file ClpMatrixBase.hpp.

virtual CoinBigIndex ClpMatrixBase::countBasis ( const int *  whichColumn,
int &  numberColumnBasic 
)
pure virtual

Returns number of elements in column part of basis.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual void ClpMatrixBase::fillBasis ( ClpSimplex model,
const int *  whichColumn,
int &  numberColumnBasic,
int *  row,
int *  start,
int *  rowCount,
int *  columnCount,
CoinFactorizationDouble element 
)
pure virtual

Fills in column part of basis.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual int ClpMatrixBase::scale ( ClpModel ,
const ClpSimplex = NULL 
) const
inlinevirtual

Creates scales for column copy (rowCopy in model may be modified) default does not allow scaling returns non-zero if no scaling done.

Reimplemented in ClpPackedMatrix.

Definition at line 113 of file ClpMatrixBase.hpp.

virtual void ClpMatrixBase::scaleRowCopy ( ClpModel ) const
inlinevirtual

Scales rowCopy if column copy scaled Only called if scales already exist.

Reimplemented in ClpPackedMatrix.

Definition at line 118 of file ClpMatrixBase.hpp.

virtual bool ClpMatrixBase::canGetRowCopy ( ) const
inlinevirtual

Returns true if can create row copy.

Definition at line 120 of file ClpMatrixBase.hpp.

virtual ClpMatrixBase* ClpMatrixBase::scaledColumnCopy ( ClpModel ) const
inlinevirtual

Realy really scales column copy Only called if scales already exist.

Up to user to delete

Reimplemented in ClpPackedMatrix.

Definition at line 126 of file ClpMatrixBase.hpp.

virtual bool ClpMatrixBase::allElementsInRange ( ClpModel ,
double  ,
double  ,
int  = 15 
)
inlinevirtual

Checks if all elements are in valid range.

Can just return true if you are not paranoid. For Clp I will probably expect no zeros. Code can modify matrix to get rid of small elements. check bits (can be turned off to save time) : 1 - check if matrix has gaps 2 - check if zero elements 4 - check and compress duplicates 8 - report on large and small

Reimplemented in ClpPackedMatrix.

Definition at line 140 of file ClpMatrixBase.hpp.

virtual void ClpMatrixBase::setDimensions ( int  numrows,
int  numcols 
)
virtual

Set the dimensions of the matrix.

In effect, append new empty columns/rows to the matrix. A negative number for either dimension means that that dimension doesn't change. Otherwise the new dimensions MUST be at least as large as the current ones otherwise an exception is thrown.

Reimplemented in ClpPackedMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::rangeOfElements ( double &  smallestNegative,
double &  largestNegative,
double &  smallestPositive,
double &  largestPositive 
)
virtual

Returns largest and smallest elements of both signs.

Largest refers to largest absolute value. If returns zeros then can't tell anything

Reimplemented in ClpPackedMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::unpack ( const ClpSimplex model,
CoinIndexedVector rowArray,
int  column 
) const
pure virtual

Unpacks a column into an CoinIndexedvector.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual void ClpMatrixBase::unpackPacked ( ClpSimplex model,
CoinIndexedVector rowArray,
int  column 
) const
pure virtual

Unpacks a column into an CoinIndexedvector in packed format Note that model is NOT const.

Bounds and objective could be modified if doing column generation (just for this variable)

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual int ClpMatrixBase::refresh ( ClpSimplex )
inlinevirtual

Purely for column generation and similar ideas.

Allows matrix and any bounds or costs to be updated (sensibly). Returns non-zero if any changes.

Reimplemented in ClpPackedMatrix, and ClpDynamicMatrix.

Definition at line 172 of file ClpMatrixBase.hpp.

virtual void ClpMatrixBase::reallyScale ( const double *  rowScale,
const double *  columnScale 
)
virtual

Reimplemented in ClpPackedMatrix.

virtual CoinBigIndex* ClpMatrixBase::dubiousWeights ( const ClpSimplex model,
int *  inputWeights 
) const
virtual

Given positive integer weights for each row fills in sum of weights for each column (and slack).

Returns weights vector Default returns vector of ones

Reimplemented in ClpPackedMatrix, ClpNetworkMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::add ( const ClpSimplex model,
CoinIndexedVector rowArray,
int  column,
double  multiplier 
) const
pure virtual

Adds multiple of a column into an CoinIndexedvector You can use quickAdd to add to vector.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual void ClpMatrixBase::add ( const ClpSimplex model,
double *  array,
int  column,
double  multiplier 
) const
pure virtual

Adds multiple of a column into an array.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual void ClpMatrixBase::releasePackedMatrix ( ) const
pure virtual

Allow any parts of a created CoinPackedMatrix to be deleted.

Implemented in ClpPackedMatrix, ClpNetworkMatrix, ClpPlusMinusOneMatrix, and ClpDummyMatrix.

virtual bool ClpMatrixBase::canDoPartialPricing ( ) const
virtual

Says whether it can do partial pricing.

Reimplemented in ClpPlusMinusOneMatrix, ClpPackedMatrix, and ClpNetworkMatrix.

virtual int ClpMatrixBase::hiddenRows ( ) const
virtual

Returns number of hidden rows e.g. gub.

Reimplemented in ClpGubMatrix.

virtual void ClpMatrixBase::partialPricing ( ClpSimplex model,
double  start,
double  end,
int &  bestSequence,
int &  numberWanted 
)
virtual
virtual int ClpMatrixBase::extendUpdated ( ClpSimplex model,
CoinIndexedVector update,
int  mode 
)
virtual

expands an updated column to allow for extra rows which the main solver does not know about and returns number added.

This will normally be a no-op - it is in for GUB but may get extended to general non-overlapping and embedded networks.

mode 0 - extend mode 1 - delete etc

Reimplemented in ClpGubMatrix.

virtual void ClpMatrixBase::primalExpanded ( ClpSimplex model,
int  mode 
)
virtual

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.

mode=2 - Check (or report on) primal infeasibilities

Reimplemented in ClpGubMatrix.

virtual void ClpMatrixBase::dualExpanded ( ClpSimplex model,
CoinIndexedVector array,
double *  other,
int  mode 
)
virtual

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.

mode=2 - Compute all djs and compute key dual infeasibilities mode=3 - Report on key dual infeasibilities mode=4 - Modify before updateTranspose in partial pricing

Reimplemented in ClpGubMatrix, and ClpDynamicMatrix.

virtual int ClpMatrixBase::generalExpanded ( ClpSimplex model,
int  mode,
int &  number 
)
virtual

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

Reimplemented in ClpGubMatrix, and ClpDynamicMatrix.

virtual int ClpMatrixBase::updatePivot ( ClpSimplex model,
double  oldInValue,
double  oldOutValue 
)
virtual

update information for a pivot (and effective rhs)

Reimplemented in ClpGubMatrix, ClpGubDynamicMatrix, and ClpDynamicMatrix.

virtual void ClpMatrixBase::createVariable ( ClpSimplex model,
int &  bestSequence 
)
virtual

Creates a variable.

This is called after partial pricing and may modify matrix. May update bestSequence.

Reimplemented in ClpDynamicMatrix, and ClpDynamicExampleMatrix.

virtual int ClpMatrixBase::checkFeasible ( ClpSimplex model,
double &  sum 
) const
virtual

Just for debug if odd type matrix.

Returns number of primal infeasibilities.

Reimplemented in ClpGubDynamicMatrix.

double ClpMatrixBase::reducedCost ( ClpSimplex model,
int  sequence 
) const

Returns reduced cost of a variable.

virtual void ClpMatrixBase::correctSequence ( const ClpSimplex model,
int &  sequenceIn,
int &  sequenceOut 
)
virtual

Correct sequence in and out to give true value (if both -1 maybe do whole matrix)

Reimplemented in ClpPackedMatrix, and ClpGubMatrix.

virtual void ClpMatrixBase::times ( double  scalar,
const double *COIN_RESTRICT  x,
double *COIN_RESTRICT  y 
) const
pure virtual

Return y + A * x * scalar in y.

Precondition
x must be of size numColumns()
y must be of size numRows()
virtual void ClpMatrixBase::times ( double  scalar,
const double *COIN_RESTRICT  x,
double *COIN_RESTRICT  y,
const double *COIN_RESTRICT  rowScale,
const double *COIN_RESTRICT  columnScale 
) const
virtual

And for scaling - default aborts for when scaling not supported (unless pointers NULL when as normal)

virtual void ClpMatrixBase::transposeTimes ( double  scalar,
const double *COIN_RESTRICT  x,
double *COIN_RESTRICT  y 
) const
pure virtual

Return y + x * scalar * A in y.

Precondition
x must be of size numRows()
y must be of size numColumns()
virtual void ClpMatrixBase::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
virtual

And for scaling - default aborts for when scaling not supported (unless pointers NULL when as normal)

virtual void ClpMatrixBase::transposeTimes ( const ClpSimplex model,
double  scalar,
const CoinIndexedVector x,
CoinIndexedVector y,
CoinIndexedVector z 
) const
pure 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 Squashes small elements and knows about ClpSimplex

Implemented in ClpPackedMatrix, ClpPlusMinusOneMatrix, ClpNetworkMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual void ClpMatrixBase::subsetTransposeTimes ( const ClpSimplex model,
const CoinIndexedVector x,
const CoinIndexedVector y,
CoinIndexedVector z 
) const
pure virtual

Return x *A in z but just for indices in y.

This is only needed for primal steepest edge. Note - z always packed mode

Implemented in ClpPackedMatrix, ClpPlusMinusOneMatrix, ClpNetworkMatrix, ClpDummyMatrix, and ClpGubMatrix.

virtual bool ClpMatrixBase::canCombine ( const ClpSimplex ,
const CoinIndexedVector  
) const
inlinevirtual

Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster.

Reimplemented in ClpPackedMatrix, and ClpPlusMinusOneMatrix.

Definition at line 320 of file ClpMatrixBase.hpp.

virtual void ClpMatrixBase::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 
)
virtual

Updates two arrays for steepest and does devex weights (need not be coded)

Reimplemented in ClpPackedMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::subsetTimes2 ( const ClpSimplex model,
CoinIndexedVector dj1,
const CoinIndexedVector pi2,
CoinIndexedVector dj2,
double  referenceIn,
double  devex,
unsigned int *  reference,
double *  weights,
double  scaleFactor 
)
virtual

Updates second array for steepest and does devex weights (need not be coded)

Reimplemented in ClpPackedMatrix, and ClpPlusMinusOneMatrix.

virtual void ClpMatrixBase::listTransposeTimes ( const ClpSimplex model,
double *  x,
int *  y,
int  number,
double *  z 
) const
virtual

Return x *A in z but just for number indices in y.

Default cheats with fake CoinIndexedVector and then calls subsetTransposeTimes

virtual ClpMatrixBase* ClpMatrixBase::clone ( ) const
pure virtual
virtual ClpMatrixBase* ClpMatrixBase::subsetClone ( int  numberRows,
const int *  whichRows,
int  numberColumns,
const int *  whichColumns 
) const
virtual

Subset clone (without gaps).

Duplicates are allowed and order is as given. Derived classes need not provide this as it may not always make sense

Reimplemented in ClpPackedMatrix, ClpPlusMinusOneMatrix, ClpNetworkMatrix, and ClpGubMatrix.

virtual void ClpMatrixBase::backToBasics ( )
inlinevirtual

Gets rid of any mutable by products.

Definition at line 363 of file ClpMatrixBase.hpp.

int ClpMatrixBase::type ( ) const
inline

Returns type.

The types which code may need to know about are: 1 - ClpPackedMatrix 11 - ClpNetworkMatrix 12 - ClpPlusMinusOneMatrix

Definition at line 370 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setType ( int  newtype)
inline

Sets type.

Definition at line 374 of file ClpMatrixBase.hpp.

void ClpMatrixBase::useEffectiveRhs ( ClpSimplex model)

Sets up an effective RHS.

virtual double* ClpMatrixBase::rhsOffset ( ClpSimplex model,
bool  forceRefresh = false,
bool  check = false 
)
virtual

Returns effective RHS offset if it is being used.

This is used for long problems or big gub or anywhere where going through full columns is expensive. This may re-compute

Reimplemented in ClpGubMatrix, ClpGubDynamicMatrix, and ClpDynamicMatrix.

int ClpMatrixBase::lastRefresh ( ) const
inline

If rhsOffset used this is iteration last refreshed.

Definition at line 385 of file ClpMatrixBase.hpp.

int ClpMatrixBase::refreshFrequency ( ) const
inline

If rhsOffset used this is refresh frequency (0==off)

Definition at line 389 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setRefreshFrequency ( int  value)
inline

Definition at line 392 of file ClpMatrixBase.hpp.

bool ClpMatrixBase::skipDualCheck ( ) const
inline

whether to skip dual checks most of time

Definition at line 396 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setSkipDualCheck ( bool  yes)
inline

Definition at line 399 of file ClpMatrixBase.hpp.

int ClpMatrixBase::minimumObjectsScan ( ) const
inline

Partial pricing tuning parameter - minimum number of "objects" to scan.

e.g. number of Gub sets but could be number of variables

Definition at line 404 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setMinimumObjectsScan ( int  value)
inline

Definition at line 407 of file ClpMatrixBase.hpp.

int ClpMatrixBase::minimumGoodReducedCosts ( ) const
inline

Partial pricing tuning parameter - minimum number of negative reduced costs to get.

Definition at line 411 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setMinimumGoodReducedCosts ( int  value)
inline

Definition at line 414 of file ClpMatrixBase.hpp.

double ClpMatrixBase::startFraction ( ) const
inline

Current start of search space in matrix (as fraction)

Definition at line 418 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setStartFraction ( double  value)
inline

Definition at line 421 of file ClpMatrixBase.hpp.

double ClpMatrixBase::endFraction ( ) const
inline

Current end of search space in matrix (as fraction)

Definition at line 425 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setEndFraction ( double  value)
inline

Definition at line 428 of file ClpMatrixBase.hpp.

double ClpMatrixBase::savedBestDj ( ) const
inline

Current best reduced cost.

Definition at line 432 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setSavedBestDj ( double  value)
inline

Definition at line 435 of file ClpMatrixBase.hpp.

int ClpMatrixBase::originalWanted ( ) const
inline

Initial number of negative reduced costs wanted.

Definition at line 439 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setOriginalWanted ( int  value)
inline

Definition at line 442 of file ClpMatrixBase.hpp.

int ClpMatrixBase::currentWanted ( ) const
inline

Current number of negative reduced costs which we still need.

Definition at line 446 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setCurrentWanted ( int  value)
inline

Definition at line 449 of file ClpMatrixBase.hpp.

int ClpMatrixBase::savedBestSequence ( ) const
inline

Current best sequence.

Definition at line 453 of file ClpMatrixBase.hpp.

void ClpMatrixBase::setSavedBestSequence ( int  value)
inline

Definition at line 456 of file ClpMatrixBase.hpp.

ClpMatrixBase& ClpMatrixBase::operator= ( const ClpMatrixBase )
protected

Member Data Documentation

double* ClpMatrixBase::rhsOffset_
protected

Effective RHS offset if it is being used.

This is used for long problems or big gub or anywhere where going through full columns is expensive

Definition at line 488 of file ClpMatrixBase.hpp.

double ClpMatrixBase::startFraction_
protected

Current start of search space in matrix (as fraction)

Definition at line 490 of file ClpMatrixBase.hpp.

double ClpMatrixBase::endFraction_
protected

Current end of search space in matrix (as fraction)

Definition at line 492 of file ClpMatrixBase.hpp.

double ClpMatrixBase::savedBestDj_
protected

Best reduced cost so far.

Definition at line 494 of file ClpMatrixBase.hpp.

int ClpMatrixBase::originalWanted_
protected

Initial number of negative reduced costs wanted.

Definition at line 496 of file ClpMatrixBase.hpp.

int ClpMatrixBase::currentWanted_
protected

Current number of negative reduced costs which we still need.

Definition at line 498 of file ClpMatrixBase.hpp.

int ClpMatrixBase::savedBestSequence_
protected

Saved best sequence in pricing.

Definition at line 500 of file ClpMatrixBase.hpp.

int ClpMatrixBase::type_
protected

type (may be useful)

Definition at line 502 of file ClpMatrixBase.hpp.

int ClpMatrixBase::lastRefresh_
protected

If rhsOffset used this is iteration last refreshed.

Definition at line 504 of file ClpMatrixBase.hpp.

int ClpMatrixBase::refreshFrequency_
protected

If rhsOffset used this is refresh frequency (0==off)

Definition at line 506 of file ClpMatrixBase.hpp.

int ClpMatrixBase::minimumObjectsScan_
protected

Partial pricing tuning parameter - minimum number of "objects" to scan.

Definition at line 508 of file ClpMatrixBase.hpp.

int ClpMatrixBase::minimumGoodReducedCosts_
protected

Partial pricing tuning parameter - minimum number of negative reduced costs to get.

Definition at line 510 of file ClpMatrixBase.hpp.

int ClpMatrixBase::trueSequenceIn_
protected

True sequence in (i.e. from larger problem)

Definition at line 512 of file ClpMatrixBase.hpp.

int ClpMatrixBase::trueSequenceOut_
protected

True sequence out (i.e. from larger problem)

Definition at line 514 of file ClpMatrixBase.hpp.

bool ClpMatrixBase::skipDualCheck_
protected

whether to skip dual checks most of time

Definition at line 516 of file ClpMatrixBase.hpp.


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