Clp  1.17.8
List of all members
ClpPackedMatrix Class Reference

#include <ClpPackedMatrix.hpp>

+ Inheritance diagram for ClpPackedMatrix:
+ Collaboration diagram for ClpPackedMatrix:

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...
 
double * getMutableElements () const
 Mutable elements. 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 int getVectorLength (int index) const
 The length of a single major-dimension vector. 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 void appendCols (int number, const CoinPackedVectorBase *const *columns)
 Append Columns. More...
 
virtual void appendRows (int number, const CoinPackedVectorBase *const *rows)
 Append Rows. 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 void replaceVector (const int index, const int numReplace, const double *newElements)
 Replace the elements of a vector. More...
 
virtual void modifyCoefficient (int row, int column, double newElement, bool keepZero=false)
 Modify one element of packed matrix. More...
 
virtual ClpMatrixBasereverseOrderedCopy () const
 Returns a new matrix in reverse order without gaps. More...
 
virtual int 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 int scale (ClpModel *model, ClpSimplex *simplex=NULL) const
 Creates scales for column copy (rowCopy in model may be modified) returns non-zero if no scaling done. More...
 
virtual void scaleRowCopy (ClpModel *model) const
 Scales rowCopy if column copy scaled Only called if scales already exist. More...
 
void createScaledMatrix (ClpSimplex *model) const
 Creates scaled column copy if scales exist. More...
 
virtual ClpMatrixBasescaledColumnCopy (ClpModel *model) const
 Realy really scales column copy Only called if scales already exist. More...
 
virtual bool allElementsInRange (ClpModel *model, double smallest, double largest, int check=15)
 Checks if all elements are in valid range. 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
 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 CoinPackedMatrix to be deleted. More...
 
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 void partialPricing (ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
 Partial pricing. More...
 
virtual int refresh (ClpSimplex *model)
 makes sure active columns correct More...
 
virtual void reallyScale (const double *rowScale, const double *columnScale)
 
virtual void setDimensions (int numrows, int numcols)
 Set the dimensions of the matrix. 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, double *spare=NULL) const
 And for scaling. More...
 
void transposeTimesSubset (int number, const int *which, const double *pi, double *y, const double *rowScale, const double *columnScale, double *spare=NULL) const
 Return y - pi * A in y. More...
 
virtual void transposeTimes (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
 Return x * scalar * A in z. More...
 
void transposeTimesByColumn (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
 Return x * scalar * A in z. More...
 
virtual void transposeTimesByRow (const ClpSimplex *model, double scalar, const CoinIndexedVector *x, CoinIndexedVector *y, CoinIndexedVector *z) const
 Return x * scalar * A in z. More...
 
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. More...
 
virtual bool canCombine (const ClpSimplex *model, const CoinIndexedVector *pi) const
 Returns true if can combine transposeTimes and subsetTransposeTimes and if it would be faster. More...
 
virtual int transposeTimes2 (const ClpSimplex *model, const CoinIndexedVector *pi1, CoinIndexedVector *dj1, const CoinIndexedVector *pi2, CoinIndexedVector *spare, double *infeas, double *reducedCost, double referenceIn, double devex, unsigned int *reference, double *weights, double scaleFactor)
 Updates two arrays for steepest and does devex weights Returns nonzero if updates reduced cost and infeas - new infeas in dj1. 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. More...
 
void useEffectiveRhs (ClpSimplex *model)
 Sets up an effective RHS. More...
 
Other
CoinPackedMatrix * matrix () const
 Returns CoinPackedMatrix (non const) More...
 
void setMatrixNull ()
 Just sets matrix_ to NULL so it can be used elsewhere. More...
 
void makeSpecialColumnCopy ()
 Say we want special column copy. More...
 
void releaseSpecialColumnCopy ()
 Say we don't want special column copy. More...
 
bool zeros () const
 Are there zeros? More...
 
bool wantsSpecialColumnCopy () const
 Do we want special column copy. More...
 
int flags () const
 Flags. More...
 
void checkGaps ()
 Sets flags_ correctly. More...
 
int numberActiveColumns () const
 number of active columns (normally same as number of columns) More...
 
void setNumberActiveColumns (int value)
 Set number of active columns (normally same as number of columns) More...
 
Constructors, destructor
 ClpPackedMatrix ()
 Default constructor. More...
 
virtual ~ClpPackedMatrix ()
 Destructor. More...
 
- Public Member Functions inherited from ClpMatrixBase
virtual bool canGetRowCopy () const
 Returns true if can create row copy. More...
 
virtual int hiddenRows () const
 Returns number of hidden rows e.g. gub. 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 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 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 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.

CoinPackedMatrix * matrix_
 Data. More...
 
int numberActiveColumns_
 number of active columns (normally same as number of columns) More...
 
int flags_
 Flags - 1 - has zero elements 2 - has gaps 4 - has special row copy 8 - has special column copy 16 - wants special column copy. More...
 
ClpPackedMatrix2rowCopy_
 Special row copy. More...
 
ClpPackedMatrix3columnCopy_
 Special column copy. 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...
 

Copy method

 ClpPackedMatrix (const ClpPackedMatrix &)
 The copy constructor. More...
 
 ClpPackedMatrix (const CoinPackedMatrix &)
 The copy constructor from an CoinPackedMatrix. More...
 
 ClpPackedMatrix (const ClpPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
 Subset constructor (without gaps). More...
 
 ClpPackedMatrix (const CoinPackedMatrix &wholeModel, int numberRows, const int *whichRows, int numberColumns, const int *whichColumns)
 
 ClpPackedMatrix (CoinPackedMatrix *matrix)
 This takes over ownership (for space reasons) More...
 
ClpPackedMatrixoperator= (const ClpPackedMatrix &)
 
virtual ClpMatrixBaseclone () const
 Clone. More...
 
virtual void copy (const ClpPackedMatrix *from)
 Copy contents - resizing if necessary - otherwise re-use memory. More...
 
virtual ClpMatrixBasesubsetClone (int numberRows, const int *whichRows, int numberColumns, const int *whichColumns) const
 Subset clone (without gaps). More...
 
void specialRowCopy (ClpSimplex *model, const ClpMatrixBase *rowCopy)
 make special row copy More...
 
void specialColumnCopy (ClpSimplex *model)
 make special column copy More...
 
virtual void correctSequence (const ClpSimplex *model, int &sequenceIn, int &sequenceOut)
 Correct sequence in and out to give true value. More...
 
int gutsOfTransposeTimesUnscaled (const double *COIN_RESTRICT pi, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const double tolerance) const
 Meat of transposeTimes by column when not scaled. More...
 
int gutsOfTransposeTimesScaled (const double *COIN_RESTRICT pi, const double *COIN_RESTRICT columnScale, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const double tolerance) const
 Meat of transposeTimes by column when scaled. More...
 
int gutsOfTransposeTimesUnscaled (const double *COIN_RESTRICT pi, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const unsigned char *status, const double tolerance) const
 Meat of transposeTimes by column when not scaled and skipping. More...
 
int gutsOfTransposeTimesUnscaled (const double *COIN_RESTRICT pi, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const unsigned char *status, int *COIN_RESTRICT spareIndex, double *COIN_RESTRICT spareArray, const double *COIN_RESTRICT reducedCost, double &upperTheta, double acceptablePivot, double dualTolerance, int &numberRemaining, const double zeroTolerance) const
 Meat of transposeTimes by column when not scaled and skipping and doing part of dualColumn. More...
 
int gutsOfTransposeTimesScaled (const double *COIN_RESTRICT pi, const double *COIN_RESTRICT columnScale, int *COIN_RESTRICT index, double *COIN_RESTRICT array, const unsigned char *status, const double tolerance) const
 Meat of transposeTimes by column when scaled and skipping. More...
 
int gutsOfTransposeTimesByRowGEK (const CoinIndexedVector *COIN_RESTRICT piVector, int *COIN_RESTRICT index, double *COIN_RESTRICT output, int numberColumns, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n > K if packed - returns number nonzero. More...
 
int gutsOfTransposeTimesByRowGE3 (const CoinIndexedVector *COIN_RESTRICT piVector, int *COIN_RESTRICT index, double *COIN_RESTRICT output, double *COIN_RESTRICT array2, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n > 2 if packed - returns number nonzero. More...
 
int gutsOfTransposeTimesByRowGE3a (const CoinIndexedVector *COIN_RESTRICT piVector, int *COIN_RESTRICT index, double *COIN_RESTRICT output, int *COIN_RESTRICT lookup, char *COIN_RESTRICT marked, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n > 2 if packed - returns number nonzero. More...
 
void gutsOfTransposeTimesByRowEQ2 (const CoinIndexedVector *piVector, CoinIndexedVector *output, CoinIndexedVector *spareVector, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n == 2 if packed. More...
 
void gutsOfTransposeTimesByRowEQ1 (const CoinIndexedVector *piVector, CoinIndexedVector *output, const double tolerance, const double scalar) const
 Meat of transposeTimes by row n == 1 if packed. More...
 
void clearCopies ()
 Gets rid of special copies. More...
 
void checkFlags (int type) const
 Check validity. More...
 

Additional Inherited Members

- Protected Member Functions inherited from ClpMatrixBase
 ClpMatrixBase ()
 Default constructor. More...
 
 ClpMatrixBase (const ClpMatrixBase &)
 
ClpMatrixBaseoperator= (const ClpMatrixBase &)
 

Detailed Description

Definition at line 23 of file ClpPackedMatrix.hpp.

Constructor & Destructor Documentation

◆ ClpPackedMatrix() [1/6]

ClpPackedMatrix::ClpPackedMatrix ( )

Default constructor.

◆ ~ClpPackedMatrix()

virtual ClpPackedMatrix::~ClpPackedMatrix ( )
virtual

Destructor.

◆ ClpPackedMatrix() [2/6]

ClpPackedMatrix::ClpPackedMatrix ( const ClpPackedMatrix )

The copy constructor.

◆ ClpPackedMatrix() [3/6]

ClpPackedMatrix::ClpPackedMatrix ( const CoinPackedMatrix &  )

The copy constructor from an CoinPackedMatrix.

◆ ClpPackedMatrix() [4/6]

ClpPackedMatrix::ClpPackedMatrix ( const ClpPackedMatrix wholeModel,
int  numberRows,
const int *  whichRows,
int  numberColumns,
const int *  whichColumns 
)

Subset constructor (without gaps).

Duplicates are allowed and order is as given

◆ ClpPackedMatrix() [5/6]

ClpPackedMatrix::ClpPackedMatrix ( const CoinPackedMatrix &  wholeModel,
int  numberRows,
const int *  whichRows,
int  numberColumns,
const int *  whichColumns 
)

◆ ClpPackedMatrix() [6/6]

ClpPackedMatrix::ClpPackedMatrix ( CoinPackedMatrix *  matrix)

This takes over ownership (for space reasons)

Member Function Documentation

◆ getPackedMatrix()

virtual CoinPackedMatrix* ClpPackedMatrix::getPackedMatrix ( ) const
inlinevirtual

Return a complete CoinPackedMatrix.

Implements ClpMatrixBase.

Definition at line 29 of file ClpPackedMatrix.hpp.

◆ isColOrdered()

virtual bool ClpPackedMatrix::isColOrdered ( ) const
inlinevirtual

Whether the packed matrix is column major ordered or not.

Implements ClpMatrixBase.

Definition at line 34 of file ClpPackedMatrix.hpp.

◆ getNumElements()

virtual CoinBigIndex ClpPackedMatrix::getNumElements ( ) const
inlinevirtual

Number of entries in the packed matrix.

Implements ClpMatrixBase.

Definition at line 39 of file ClpPackedMatrix.hpp.

◆ getNumCols()

virtual int ClpPackedMatrix::getNumCols ( ) const
inlinevirtual

Number of columns.

Implements ClpMatrixBase.

Definition at line 44 of file ClpPackedMatrix.hpp.

◆ getNumRows()

virtual int ClpPackedMatrix::getNumRows ( ) const
inlinevirtual

Number of rows.

Implements ClpMatrixBase.

Definition at line 49 of file ClpPackedMatrix.hpp.

◆ getElements()

virtual const double* ClpPackedMatrix::getElements ( ) const
inlinevirtual

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.

Definition at line 58 of file ClpPackedMatrix.hpp.

◆ getMutableElements()

double* ClpPackedMatrix::getMutableElements ( ) const
inline

Mutable elements.

Definition at line 63 of file ClpPackedMatrix.hpp.

◆ getIndices()

virtual const int* ClpPackedMatrix::getIndices ( ) const
inlinevirtual

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.

Definition at line 72 of file ClpPackedMatrix.hpp.

◆ getVectorStarts()

virtual const CoinBigIndex* ClpPackedMatrix::getVectorStarts ( ) const
inlinevirtual

Implements ClpMatrixBase.

Definition at line 77 of file ClpPackedMatrix.hpp.

◆ getVectorLengths()

virtual const int* ClpPackedMatrix::getVectorLengths ( ) const
inlinevirtual

The lengths of the major-dimension vectors.

Implements ClpMatrixBase.

Definition at line 82 of file ClpPackedMatrix.hpp.

◆ getVectorLength()

virtual int ClpPackedMatrix::getVectorLength ( int  index) const
inlinevirtual

The length of a single major-dimension vector.

Reimplemented from ClpMatrixBase.

Definition at line 87 of file ClpPackedMatrix.hpp.

◆ deleteCols()

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

Delete the columns whose indices are listed in indDel.

Implements ClpMatrixBase.

◆ deleteRows()

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

Delete the rows whose indices are listed in indDel.

Implements ClpMatrixBase.

◆ appendCols()

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

Append Columns.

Reimplemented from ClpMatrixBase.

◆ appendRows()

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

Append Rows.

Reimplemented from ClpMatrixBase.

◆ appendMatrix()

virtual int ClpPackedMatrix::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 from ClpMatrixBase.

◆ replaceVector()

virtual void ClpPackedMatrix::replaceVector ( const int  index,
const int  numReplace,
const double *  newElements 
)
inlinevirtual

Replace the elements of a vector.

The indices remain the same. This is only needed if scaling and a row copy is used. At most the number specified will be replaced. The index is between 0 and major dimension of matrix

Definition at line 113 of file ClpPackedMatrix.hpp.

◆ modifyCoefficient()

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

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

Definition at line 121 of file ClpPackedMatrix.hpp.

◆ reverseOrderedCopy()

virtual ClpMatrixBase* ClpPackedMatrix::reverseOrderedCopy ( ) const
virtual

Returns a new matrix in reverse order without gaps.

Reimplemented from ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ countBasis()

virtual int ClpPackedMatrix::countBasis ( const int *  whichColumn,
int &  numberColumnBasic 
)
virtual

Returns number of elements in column part of basis.

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ fillBasis()

virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

◆ scale()

virtual int ClpPackedMatrix::scale ( ClpModel model,
ClpSimplex simplex = NULL 
) const
virtual

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

Reimplemented from ClpMatrixBase.

◆ scaleRowCopy()

virtual void ClpPackedMatrix::scaleRowCopy ( ClpModel model) const
virtual

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

Reimplemented from ClpMatrixBase.

◆ createScaledMatrix()

void ClpPackedMatrix::createScaledMatrix ( ClpSimplex model) const

Creates scaled column copy if scales exist.

◆ scaledColumnCopy()

virtual ClpMatrixBase* ClpPackedMatrix::scaledColumnCopy ( ClpModel model) const
virtual

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

Up to user ro delete

Reimplemented from ClpMatrixBase.

◆ allElementsInRange()

virtual bool ClpPackedMatrix::allElementsInRange ( ClpModel model,
double  smallest,
double  largest,
int  check = 15 
)
virtual

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

◆ rangeOfElements()

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

Returns largest and smallest elements of both signs.

Largest refers to largest absolute value.

Reimplemented from ClpMatrixBase.

◆ unpack()

virtual void ClpPackedMatrix::unpack ( const ClpSimplex model,
CoinIndexedVector *  rowArray,
int  column 
) const
virtual

Unpacks a column into an CoinIndexedvector.

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ unpackPacked()

virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

◆ add() [1/2]

virtual void ClpPackedMatrix::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.

Reimplemented in ClpGubMatrix.

◆ add() [2/2]

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

Adds multiple of a column into an array.

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ releasePackedMatrix()

virtual void ClpPackedMatrix::releasePackedMatrix ( ) const
inlinevirtual

Allow any parts of a created CoinPackedMatrix to be deleted.

Implements ClpMatrixBase.

Definition at line 188 of file ClpPackedMatrix.hpp.

◆ dubiousWeights()

virtual CoinBigIndex* ClpPackedMatrix::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

Reimplemented from ClpMatrixBase.

◆ canDoPartialPricing()

virtual bool ClpPackedMatrix::canDoPartialPricing ( ) const
virtual

Says whether it can do partial pricing.

Reimplemented from ClpMatrixBase.

◆ partialPricing()

virtual void ClpPackedMatrix::partialPricing ( ClpSimplex model,
double  start,
double  end,
int &  bestSequence,
int &  numberWanted 
)
virtual

Partial pricing.

Reimplemented from ClpMatrixBase.

Reimplemented in ClpGubMatrix, ClpDynamicExampleMatrix, ClpDynamicMatrix, and ClpGubDynamicMatrix.

◆ refresh()

virtual int ClpPackedMatrix::refresh ( ClpSimplex model)
virtual

makes sure active columns correct

Reimplemented from ClpMatrixBase.

Reimplemented in ClpDynamicMatrix.

◆ reallyScale()

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

Reimplemented from ClpMatrixBase.

◆ setDimensions()

virtual void ClpPackedMatrix::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 from ClpMatrixBase.

◆ times() [1/2]

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

Reimplemented in ClpGubDynamicMatrix, and ClpDynamicMatrix.

◆ times() [2/2]

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

And for scaling.

◆ transposeTimes() [1/3]

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

◆ transposeTimes() [2/3]

virtual void ClpPackedMatrix::transposeTimes ( double  scalar,
const double *  x,
double *  y,
const double *  rowScale,
const double *  columnScale,
double *  spare = NULL 
) const
virtual

And for scaling.

◆ transposeTimesSubset()

void ClpPackedMatrix::transposeTimesSubset ( int  number,
const int *  which,
const double *  pi,
double *  y,
const double *  rowScale,
const double *  columnScale,
double *  spare = NULL 
) const

Return y - pi * A in y.

Precondition
pi must be of size numRows()
y must be of size numColumns() This just does subset (but puts in correct place in y)

◆ transposeTimes() [3/3]

virtual void ClpPackedMatrix::transposeTimes ( const ClpSimplex model,
double  scalar,
const CoinIndexedVector *  x,
CoinIndexedVector *  y,
CoinIndexedVector *  z 
) const
virtual

Return x * scalar * A 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

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ transposeTimesByColumn()

void ClpPackedMatrix::transposeTimesByColumn ( const ClpSimplex model,
double  scalar,
const CoinIndexedVector *  x,
CoinIndexedVector *  y,
CoinIndexedVector *  z 
) const

Return x * scalar * A in z.

Note - If x packed mode - then z packed mode This does by column and knows no gaps Squashes small elements and knows about ClpSimplex

◆ transposeTimesByRow()

virtual void ClpPackedMatrix::transposeTimesByRow ( const ClpSimplex model,
double  scalar,
const CoinIndexedVector *  x,
CoinIndexedVector *  y,
CoinIndexedVector *  z 
) const
virtual

Return x * scalar * A 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. This version uses row copy

Reimplemented in ClpGubMatrix.

◆ subsetTransposeTimes()

virtual void ClpPackedMatrix::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 - z always packed mode

Implements ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ canCombine()

virtual bool ClpPackedMatrix::canCombine ( const ClpSimplex model,
const CoinIndexedVector *  pi 
) const
virtual

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

Reimplemented from ClpMatrixBase.

◆ transposeTimes2()

virtual int ClpPackedMatrix::transposeTimes2 ( const ClpSimplex model,
const CoinIndexedVector *  pi1,
CoinIndexedVector *  dj1,
const CoinIndexedVector *  pi2,
CoinIndexedVector *  spare,
double *  infeas,
double *  reducedCost,
double  referenceIn,
double  devex,
unsigned int *  reference,
double *  weights,
double  scaleFactor 
)
virtual

Updates two arrays for steepest and does devex weights Returns nonzero if updates reduced cost and infeas - new infeas in dj1.

Reimplemented from ClpMatrixBase.

◆ subsetTimes2()

virtual void ClpPackedMatrix::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.

Reimplemented from ClpMatrixBase.

◆ useEffectiveRhs()

void ClpPackedMatrix::useEffectiveRhs ( ClpSimplex model)

Sets up an effective RHS.

◆ matrix()

CoinPackedMatrix* ClpPackedMatrix::matrix ( ) const
inline

Returns CoinPackedMatrix (non const)

Definition at line 314 of file ClpPackedMatrix.hpp.

◆ setMatrixNull()

void ClpPackedMatrix::setMatrixNull ( )
inline

Just sets matrix_ to NULL so it can be used elsewhere.

used in GUB

Definition at line 321 of file ClpPackedMatrix.hpp.

◆ makeSpecialColumnCopy()

void ClpPackedMatrix::makeSpecialColumnCopy ( )
inline

Say we want special column copy.

Definition at line 326 of file ClpPackedMatrix.hpp.

◆ releaseSpecialColumnCopy()

void ClpPackedMatrix::releaseSpecialColumnCopy ( )

Say we don't want special column copy.

◆ zeros()

bool ClpPackedMatrix::zeros ( ) const
inline

Are there zeros?

Definition at line 333 of file ClpPackedMatrix.hpp.

◆ wantsSpecialColumnCopy()

bool ClpPackedMatrix::wantsSpecialColumnCopy ( ) const
inline

Do we want special column copy.

Definition at line 338 of file ClpPackedMatrix.hpp.

◆ flags()

int ClpPackedMatrix::flags ( ) const
inline

Flags.

Definition at line 343 of file ClpPackedMatrix.hpp.

◆ checkGaps()

void ClpPackedMatrix::checkGaps ( )
inline

Sets flags_ correctly.

Definition at line 348 of file ClpPackedMatrix.hpp.

◆ numberActiveColumns()

int ClpPackedMatrix::numberActiveColumns ( ) const
inline

number of active columns (normally same as number of columns)

Definition at line 353 of file ClpPackedMatrix.hpp.

◆ setNumberActiveColumns()

void ClpPackedMatrix::setNumberActiveColumns ( int  value)
inline

Set number of active columns (normally same as number of columns)

Definition at line 358 of file ClpPackedMatrix.hpp.

◆ operator=()

ClpPackedMatrix& ClpPackedMatrix::operator= ( const ClpPackedMatrix )

◆ clone()

virtual ClpMatrixBase* ClpPackedMatrix::clone ( ) const
virtual

◆ copy()

virtual void ClpPackedMatrix::copy ( const ClpPackedMatrix from)
virtual

Copy contents - resizing if necessary - otherwise re-use memory.

◆ subsetClone()

virtual ClpMatrixBase* ClpPackedMatrix::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

Reimplemented from ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ specialRowCopy()

void ClpPackedMatrix::specialRowCopy ( ClpSimplex model,
const ClpMatrixBase rowCopy 
)

make special row copy

◆ specialColumnCopy()

void ClpPackedMatrix::specialColumnCopy ( ClpSimplex model)

make special column copy

◆ correctSequence()

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

Correct sequence in and out to give true value.

Reimplemented from ClpMatrixBase.

Reimplemented in ClpGubMatrix.

◆ gutsOfTransposeTimesUnscaled() [1/3]

int ClpPackedMatrix::gutsOfTransposeTimesUnscaled ( const double *COIN_RESTRICT  pi,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const double  tolerance 
) const
private

Meat of transposeTimes by column when not scaled.

◆ gutsOfTransposeTimesScaled() [1/2]

int ClpPackedMatrix::gutsOfTransposeTimesScaled ( const double *COIN_RESTRICT  pi,
const double *COIN_RESTRICT  columnScale,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const double  tolerance 
) const
private

Meat of transposeTimes by column when scaled.

◆ gutsOfTransposeTimesUnscaled() [2/3]

int ClpPackedMatrix::gutsOfTransposeTimesUnscaled ( const double *COIN_RESTRICT  pi,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const unsigned char *  status,
const double  tolerance 
) const
private

Meat of transposeTimes by column when not scaled and skipping.

◆ gutsOfTransposeTimesUnscaled() [3/3]

int ClpPackedMatrix::gutsOfTransposeTimesUnscaled ( const double *COIN_RESTRICT  pi,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const unsigned char *  status,
int *COIN_RESTRICT  spareIndex,
double *COIN_RESTRICT  spareArray,
const double *COIN_RESTRICT  reducedCost,
double &  upperTheta,
double  acceptablePivot,
double  dualTolerance,
int &  numberRemaining,
const double  zeroTolerance 
) const
private

Meat of transposeTimes by column when not scaled and skipping and doing part of dualColumn.

◆ gutsOfTransposeTimesScaled() [2/2]

int ClpPackedMatrix::gutsOfTransposeTimesScaled ( const double *COIN_RESTRICT  pi,
const double *COIN_RESTRICT  columnScale,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  array,
const unsigned char *  status,
const double  tolerance 
) const
private

Meat of transposeTimes by column when scaled and skipping.

◆ gutsOfTransposeTimesByRowGEK()

int ClpPackedMatrix::gutsOfTransposeTimesByRowGEK ( const CoinIndexedVector *COIN_RESTRICT  piVector,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  output,
int  numberColumns,
const double  tolerance,
const double  scalar 
) const
private

Meat of transposeTimes by row n > K if packed - returns number nonzero.

◆ gutsOfTransposeTimesByRowGE3()

int ClpPackedMatrix::gutsOfTransposeTimesByRowGE3 ( const CoinIndexedVector *COIN_RESTRICT  piVector,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  output,
double *COIN_RESTRICT  array2,
const double  tolerance,
const double  scalar 
) const
private

Meat of transposeTimes by row n > 2 if packed - returns number nonzero.

◆ gutsOfTransposeTimesByRowGE3a()

int ClpPackedMatrix::gutsOfTransposeTimesByRowGE3a ( const CoinIndexedVector *COIN_RESTRICT  piVector,
int *COIN_RESTRICT  index,
double *COIN_RESTRICT  output,
int *COIN_RESTRICT  lookup,
char *COIN_RESTRICT  marked,
const double  tolerance,
const double  scalar 
) const
private

Meat of transposeTimes by row n > 2 if packed - returns number nonzero.

◆ gutsOfTransposeTimesByRowEQ2()

void ClpPackedMatrix::gutsOfTransposeTimesByRowEQ2 ( const CoinIndexedVector *  piVector,
CoinIndexedVector *  output,
CoinIndexedVector *  spareVector,
const double  tolerance,
const double  scalar 
) const
private

Meat of transposeTimes by row n == 2 if packed.

◆ gutsOfTransposeTimesByRowEQ1()

void ClpPackedMatrix::gutsOfTransposeTimesByRowEQ1 ( const CoinIndexedVector *  piVector,
CoinIndexedVector *  output,
const double  tolerance,
const double  scalar 
) const
private

Meat of transposeTimes by row n == 1 if packed.

◆ clearCopies()

void ClpPackedMatrix::clearCopies ( )
private

Gets rid of special copies.

◆ checkFlags()

void ClpPackedMatrix::checkFlags ( int  type) const
protected

Check validity.

Member Data Documentation

◆ matrix_

CoinPackedMatrix* ClpPackedMatrix::matrix_
protected

Data.

Definition at line 484 of file ClpPackedMatrix.hpp.

◆ numberActiveColumns_

int ClpPackedMatrix::numberActiveColumns_
protected

number of active columns (normally same as number of columns)

Definition at line 486 of file ClpPackedMatrix.hpp.

◆ flags_

int ClpPackedMatrix::flags_
mutableprotected

Flags - 1 - has zero elements 2 - has gaps 4 - has special row copy 8 - has special column copy 16 - wants special column copy.

Definition at line 494 of file ClpPackedMatrix.hpp.

◆ rowCopy_

ClpPackedMatrix2* ClpPackedMatrix::rowCopy_
protected

Special row copy.

Definition at line 496 of file ClpPackedMatrix.hpp.

◆ columnCopy_

ClpPackedMatrix3* ClpPackedMatrix::columnCopy_
protected

Special column copy.

Definition at line 498 of file ClpPackedMatrix.hpp.


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