Clp  1.17.8
Public Types | List of all members
ClpDynamicMatrix Class Reference

This implements a dynamic matrix when we have a limit on the number of "interesting rows". More...

#include <ClpDynamicMatrix.hpp>

+ Inheritance diagram for ClpDynamicMatrix:
+ Collaboration diagram for ClpDynamicMatrix:

Public Types

enum  DynamicStatus { soloKey = 0x00, inSmall = 0x01, atUpperBound = 0x02, atLowerBound = 0x03 }
 enums for status of various sorts More...
 

Public Member Functions

Main functions provided
virtual void partialPricing (ClpSimplex *model, double start, double end, int &bestSequence, int &numberWanted)
 Partial pricing. More...
 
virtual int updatePivot (ClpSimplex *model, double oldInValue, double oldOutValue)
 update information for a pivot (and effective rhs) More...
 
virtual double * rhsOffset (ClpSimplex *model, bool forceRefresh=false, bool check=false)
 Returns effective RHS offset if it is being used. More...
 
virtual void times (double scalar, const double *x, double *y) const
 Return y + A * scalar *x in y. More...
 
void modifyOffset (int sequence, double amount)
 Modifies rhs offset. More...
 
double keyValue (int iSet) const
 Gets key value when none in small. More...
 
virtual void dualExpanded (ClpSimplex *model, CoinIndexedVector *array, double *other, int mode)
 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)
 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 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 refresh (ClpSimplex *model)
 Purely for column generation and similar ideas. More...
 
virtual void createVariable (ClpSimplex *model, int &bestSequence)
 Creates a variable. More...
 
virtual double reducedCost (ClpSimplex *model, int sequence) const
 Returns reduced cost of a variable. More...
 
void gubCrash ()
 Does gub crash. More...
 
void writeMps (const char *name)
 Writes out model (without names) More...
 
void initialProblem ()
 Populates initial matrix from dynamic status. More...
 
int addColumn (CoinBigIndex numberEntries, const int *row, const double *element, double cost, double lower, double upper, int iSet, DynamicStatus status)
 Adds in a column to gub structure (called from descendant) and returns sequence. More...
 
virtual void packDown (const int *, int)
 If addColumn forces compression then this allows descendant to know what to do. More...
 
double columnLower (int sequence) const
 Gets lower bound (to simplify coding) More...
 
double columnUpper (int sequence) const
 Gets upper bound (to simplify coding) More...
 
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...
 
Constructors, destructor
 ClpDynamicMatrix ()
 Default constructor. More...
 
 ClpDynamicMatrix (ClpSimplex *model, int numberSets, int numberColumns, const int *starts, const double *lower, const double *upper, const CoinBigIndex *startColumn, const int *row, const double *element, const double *cost, const double *columnLower=NULL, const double *columnUpper=NULL, const unsigned char *status=NULL, const unsigned char *dynamicStatus=NULL)
 This is the real constructor. More...
 
virtual ~ClpDynamicMatrix ()
 Destructor. More...
 
Copy method
 ClpDynamicMatrix (const ClpDynamicMatrix &)
 The copy constructor. More...
 
 ClpDynamicMatrix (const CoinPackedMatrix &)
 The copy constructor from an CoinPackedMatrix. More...
 
ClpDynamicMatrixoperator= (const ClpDynamicMatrix &)
 
virtual ClpMatrixBaseclone () const
 Clone. More...
 
gets and sets
ClpSimplex::Status getStatus (int sequence) const
 Status of row slacks. More...
 
void setStatus (int sequence, ClpSimplex::Status status)
 
bool flaggedSlack (int i) const
 Whether flagged slack. More...
 
void setFlaggedSlack (int i)
 
void unsetFlaggedSlack (int i)
 
int numberSets () const
 Number of sets (dynamic rows) More...
 
int numberGubEntries () const
 Number of possible gub variables. More...
 
int * startSets () const
 Sets. More...
 
bool flagged (int i) const
 Whether flagged. More...
 
void setFlagged (int i)
 
void unsetFlagged (int i)
 
void setDynamicStatus (int sequence, DynamicStatus status)
 
DynamicStatus getDynamicStatus (int sequence) const
 
double objectiveOffset () const
 Saved value of objective offset. More...
 
CoinBigIndex * startColumn () const
 Starts of each column. More...
 
int * row () const
 rows More...
 
double * element () const
 elements More...
 
double * cost () const
 costs More...
 
int * id () const
 ids of active columns (just index here) More...
 
double * columnLower () const
 Optional lower bounds on columns. More...
 
double * columnUpper () const
 Optional upper bounds on columns. More...
 
double * lowerSet () const
 Lower bounds on sets. More...
 
double * upperSet () const
 Upper bounds on sets. More...
 
int numberGubColumns () const
 size More...
 
int firstAvailable () const
 first free More...
 
int firstDynamic () const
 first dynamic More...
 
int lastDynamic () const
 number of columns in dynamic model More...
 
int numberStaticRows () const
 number of rows in original model More...
 
CoinBigIndex numberElements () const
 size of working matrix (max) More...
 
int * keyVariable () const
 
void switchOffCheck ()
 Switches off dj checking each factorization (for BIG models) More...
 
unsigned char * gubRowStatus () const
 Status region for gub slacks. More...
 
unsigned char * dynamicStatus () const
 Status region for gub variables. More...
 
int whichSet (int sequence) const
 Returns which set a variable is in. More...
 
- Public Member Functions inherited from ClpPackedMatrix
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 reallyScale (const double *rowScale, const double *columnScale)
 
virtual void setDimensions (int numrows, int numcols)
 Set the dimensions of the matrix. 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...
 
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...
 
 ClpPackedMatrix ()
 Default constructor. More...
 
virtual ~ClpPackedMatrix ()
 Destructor. More...
 
 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 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...
 
- 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 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...
 
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.

double sumDualInfeasibilities_
 Sum of dual infeasibilities. More...
 
double sumPrimalInfeasibilities_
 Sum of primal infeasibilities. More...
 
double sumOfRelaxedDualInfeasibilities_
 Sum of Dual infeasibilities using tolerance based on error in duals. More...
 
double sumOfRelaxedPrimalInfeasibilities_
 Sum of Primal infeasibilities using tolerance based on error in primals. More...
 
double savedBestGubDual_
 Saved best dual on gub row in pricing. More...
 
int savedBestSet_
 Saved best set in pricing. More...
 
int * backToPivotRow_
 Backward pointer to pivot row !!! More...
 
int * keyVariable_
 Key variable of set (only accurate if none in small problem) More...
 
int * toIndex_
 Backward pointer to extra row. More...
 
int * fromIndex_
 
int numberSets_
 Number of sets (dynamic rows) More...
 
int numberActiveSets_
 Number of active sets. More...
 
double objectiveOffset_
 Saved value of objective offset. More...
 
double * lowerSet_
 Lower bounds on sets. More...
 
double * upperSet_
 Upper bounds on sets. More...
 
unsigned char * status_
 Status of slack on set. More...
 
ClpSimplexmodel_
 Pointer back to model. More...
 
int firstAvailable_
 first free More...
 
int firstAvailableBefore_
 first free when iteration started More...
 
int firstDynamic_
 first dynamic More...
 
int lastDynamic_
 number of columns in dynamic model More...
 
int numberStaticRows_
 number of rows in original model More...
 
CoinBigIndex numberElements_
 size of working matrix (max) More...
 
int numberDualInfeasibilities_
 Number of dual infeasibilities. More...
 
int numberPrimalInfeasibilities_
 Number of primal infeasibilities. More...
 
int noCheck_
 If pricing will declare victory (i.e. More...
 
double infeasibilityWeight_
 Infeasibility weight when last full pass done. More...
 
int numberGubColumns_
 size More...
 
int maximumGubColumns_
 current maximum number of columns (then compress) More...
 
CoinBigIndex maximumElements_
 current maximum number of elemnts (then compress) More...
 
int * startSet_
 Start of each set. More...
 
int * next_
 next in chain More...
 
CoinBigIndex * startColumn_
 Starts of each column. More...
 
int * row_
 rows More...
 
double * element_
 elements More...
 
double * cost_
 costs More...
 
int * id_
 ids of active columns (just index here) More...
 
unsigned char * dynamicStatus_
 for status and which bound More...
 
double * columnLower_
 Optional lower bounds on columns. More...
 
double * columnUpper_
 Optional upper bounds on columns. More...
 
- Protected Attributes inherited from ClpPackedMatrix
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...
 

Additional Inherited Members

- Protected Member Functions inherited from ClpPackedMatrix
void checkFlags (int type) const
 Check validity. More...
 
- Protected Member Functions inherited from ClpMatrixBase
 ClpMatrixBase ()
 Default constructor. More...
 
 ClpMatrixBase (const ClpMatrixBase &)
 
ClpMatrixBaseoperator= (const ClpMatrixBase &)
 

Detailed Description

This implements a dynamic matrix when we have a limit on the number of "interesting rows".

This version inherits from ClpPackedMatrix and knows that the real matrix is gub. A later version could use shortest path to generate columns.

Definition at line 19 of file ClpDynamicMatrix.hpp.

Member Enumeration Documentation

◆ DynamicStatus

enums for status of various sorts

Enumerator
soloKey 
inSmall 
atUpperBound 
atLowerBound 

Definition at line 23 of file ClpDynamicMatrix.hpp.

Constructor & Destructor Documentation

◆ ClpDynamicMatrix() [1/4]

ClpDynamicMatrix::ClpDynamicMatrix ( )

Default constructor.

◆ ClpDynamicMatrix() [2/4]

ClpDynamicMatrix::ClpDynamicMatrix ( ClpSimplex model,
int  numberSets,
int  numberColumns,
const int *  starts,
const double *  lower,
const double *  upper,
const CoinBigIndex *  startColumn,
const int *  row,
const double *  element,
const double *  cost,
const double *  columnLower = NULL,
const double *  columnUpper = NULL,
const unsigned char *  status = NULL,
const unsigned char *  dynamicStatus = NULL 
)

This is the real constructor.

It assumes factorization frequency will not be changed. This resizes model !!!! The contents of original matrix in model will be taken over and original matrix will be sanitized so can be deleted (to avoid a very small memory leak)

◆ ~ClpDynamicMatrix()

virtual ClpDynamicMatrix::~ClpDynamicMatrix ( )
virtual

Destructor.

◆ ClpDynamicMatrix() [3/4]

ClpDynamicMatrix::ClpDynamicMatrix ( const ClpDynamicMatrix )

The copy constructor.

◆ ClpDynamicMatrix() [4/4]

ClpDynamicMatrix::ClpDynamicMatrix ( const CoinPackedMatrix &  )

The copy constructor from an CoinPackedMatrix.

Member Function Documentation

◆ partialPricing()

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

Partial pricing.

Reimplemented from ClpPackedMatrix.

Reimplemented in ClpDynamicExampleMatrix.

◆ updatePivot()

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

update information for a pivot (and effective rhs)

Reimplemented from ClpMatrixBase.

◆ rhsOffset()

virtual double* ClpDynamicMatrix::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 dynamic or anywhere where going through full columns is expensive. This may re-compute

Reimplemented from ClpMatrixBase.

◆ times() [1/3]

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

◆ modifyOffset()

void ClpDynamicMatrix::modifyOffset ( int  sequence,
double  amount 
)

Modifies rhs offset.

◆ keyValue()

double ClpDynamicMatrix::keyValue ( int  iSet) const

Gets key value when none in small.

◆ dualExpanded()

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

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

◆ generalExpanded()

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

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

◆ refresh()

virtual int ClpDynamicMatrix::refresh ( ClpSimplex model)
virtual

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

◆ createVariable()

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

Creates a variable.

This is called after partial pricing and will modify matrix. Will update bestSequence.

Reimplemented from ClpMatrixBase.

Reimplemented in ClpDynamicExampleMatrix.

◆ reducedCost()

virtual double ClpDynamicMatrix::reducedCost ( ClpSimplex model,
int  sequence 
) const
virtual

Returns reduced cost of a variable.

◆ gubCrash()

void ClpDynamicMatrix::gubCrash ( )

Does gub crash.

◆ writeMps()

void ClpDynamicMatrix::writeMps ( const char *  name)

Writes out model (without names)

◆ initialProblem()

void ClpDynamicMatrix::initialProblem ( )

Populates initial matrix from dynamic status.

◆ addColumn()

int ClpDynamicMatrix::addColumn ( CoinBigIndex  numberEntries,
const int *  row,
const double *  element,
double  cost,
double  lower,
double  upper,
int  iSet,
DynamicStatus  status 
)

Adds in a column to gub structure (called from descendant) and returns sequence.

◆ packDown()

virtual void ClpDynamicMatrix::packDown ( const int *  ,
int   
)
inlinevirtual

If addColumn forces compression then this allows descendant to know what to do.

If >=0 then entry stayed in, if -1 then entry went out to lower bound.of zero. Entries at upper bound (really nonzero) never go out (at present).

Reimplemented in ClpDynamicExampleMatrix.

Definition at line 108 of file ClpDynamicMatrix.hpp.

◆ columnLower() [1/2]

double ClpDynamicMatrix::columnLower ( int  sequence) const
inline

Gets lower bound (to simplify coding)

Definition at line 110 of file ClpDynamicMatrix.hpp.

◆ columnUpper() [1/2]

double ClpDynamicMatrix::columnUpper ( int  sequence) const
inline

Gets upper bound (to simplify coding)

Definition at line 118 of file ClpDynamicMatrix.hpp.

◆ operator=()

ClpDynamicMatrix& ClpDynamicMatrix::operator= ( const ClpDynamicMatrix )

◆ clone()

virtual ClpMatrixBase* ClpDynamicMatrix::clone ( ) const
virtual

Clone.

Reimplemented from ClpPackedMatrix.

Reimplemented in ClpDynamicExampleMatrix.

◆ getStatus()

ClpSimplex::Status ClpDynamicMatrix::getStatus ( int  sequence) const
inline

Status of row slacks.

Definition at line 165 of file ClpDynamicMatrix.hpp.

◆ setStatus()

void ClpDynamicMatrix::setStatus ( int  sequence,
ClpSimplex::Status  status 
)
inline

Definition at line 169 of file ClpDynamicMatrix.hpp.

◆ flaggedSlack()

bool ClpDynamicMatrix::flaggedSlack ( int  i) const
inline

Whether flagged slack.

Definition at line 176 of file ClpDynamicMatrix.hpp.

◆ setFlaggedSlack()

void ClpDynamicMatrix::setFlaggedSlack ( int  i)
inline

Definition at line 180 of file ClpDynamicMatrix.hpp.

◆ unsetFlaggedSlack()

void ClpDynamicMatrix::unsetFlaggedSlack ( int  i)
inline

Definition at line 184 of file ClpDynamicMatrix.hpp.

◆ numberSets()

int ClpDynamicMatrix::numberSets ( ) const
inline

Number of sets (dynamic rows)

Definition at line 189 of file ClpDynamicMatrix.hpp.

◆ numberGubEntries()

int ClpDynamicMatrix::numberGubEntries ( ) const
inline

Number of possible gub variables.

Definition at line 194 of file ClpDynamicMatrix.hpp.

◆ startSets()

int* ClpDynamicMatrix::startSets ( ) const
inline

Sets.

Definition at line 199 of file ClpDynamicMatrix.hpp.

◆ flagged()

bool ClpDynamicMatrix::flagged ( int  i) const
inline

Whether flagged.

Definition at line 204 of file ClpDynamicMatrix.hpp.

◆ setFlagged()

void ClpDynamicMatrix::setFlagged ( int  i)
inline

Definition at line 208 of file ClpDynamicMatrix.hpp.

◆ unsetFlagged()

void ClpDynamicMatrix::unsetFlagged ( int  i)
inline

Definition at line 212 of file ClpDynamicMatrix.hpp.

◆ setDynamicStatus()

void ClpDynamicMatrix::setDynamicStatus ( int  sequence,
DynamicStatus  status 
)
inline

Definition at line 216 of file ClpDynamicMatrix.hpp.

◆ getDynamicStatus()

DynamicStatus ClpDynamicMatrix::getDynamicStatus ( int  sequence) const
inline

Definition at line 222 of file ClpDynamicMatrix.hpp.

◆ objectiveOffset()

double ClpDynamicMatrix::objectiveOffset ( ) const
inline

Saved value of objective offset.

Definition at line 227 of file ClpDynamicMatrix.hpp.

◆ startColumn()

CoinBigIndex* ClpDynamicMatrix::startColumn ( ) const
inline

Starts of each column.

Definition at line 232 of file ClpDynamicMatrix.hpp.

◆ row()

int* ClpDynamicMatrix::row ( ) const
inline

rows

Definition at line 237 of file ClpDynamicMatrix.hpp.

◆ element()

double* ClpDynamicMatrix::element ( ) const
inline

elements

Definition at line 242 of file ClpDynamicMatrix.hpp.

◆ cost()

double* ClpDynamicMatrix::cost ( ) const
inline

costs

Definition at line 247 of file ClpDynamicMatrix.hpp.

◆ id()

int* ClpDynamicMatrix::id ( ) const
inline

ids of active columns (just index here)

Definition at line 252 of file ClpDynamicMatrix.hpp.

◆ columnLower() [2/2]

double* ClpDynamicMatrix::columnLower ( ) const
inline

Optional lower bounds on columns.

Definition at line 257 of file ClpDynamicMatrix.hpp.

◆ columnUpper() [2/2]

double* ClpDynamicMatrix::columnUpper ( ) const
inline

Optional upper bounds on columns.

Definition at line 262 of file ClpDynamicMatrix.hpp.

◆ lowerSet()

double* ClpDynamicMatrix::lowerSet ( ) const
inline

Lower bounds on sets.

Definition at line 267 of file ClpDynamicMatrix.hpp.

◆ upperSet()

double* ClpDynamicMatrix::upperSet ( ) const
inline

Upper bounds on sets.

Definition at line 272 of file ClpDynamicMatrix.hpp.

◆ numberGubColumns()

int ClpDynamicMatrix::numberGubColumns ( ) const
inline

size

Definition at line 277 of file ClpDynamicMatrix.hpp.

◆ firstAvailable()

int ClpDynamicMatrix::firstAvailable ( ) const
inline

first free

Definition at line 282 of file ClpDynamicMatrix.hpp.

◆ firstDynamic()

int ClpDynamicMatrix::firstDynamic ( ) const
inline

first dynamic

Definition at line 287 of file ClpDynamicMatrix.hpp.

◆ lastDynamic()

int ClpDynamicMatrix::lastDynamic ( ) const
inline

number of columns in dynamic model

Definition at line 292 of file ClpDynamicMatrix.hpp.

◆ numberStaticRows()

int ClpDynamicMatrix::numberStaticRows ( ) const
inline

number of rows in original model

Definition at line 297 of file ClpDynamicMatrix.hpp.

◆ numberElements()

CoinBigIndex ClpDynamicMatrix::numberElements ( ) const
inline

size of working matrix (max)

Definition at line 302 of file ClpDynamicMatrix.hpp.

◆ keyVariable()

int* ClpDynamicMatrix::keyVariable ( ) const
inline

Definition at line 306 of file ClpDynamicMatrix.hpp.

◆ switchOffCheck()

void ClpDynamicMatrix::switchOffCheck ( )

Switches off dj checking each factorization (for BIG models)

◆ gubRowStatus()

unsigned char* ClpDynamicMatrix::gubRowStatus ( ) const
inline

Status region for gub slacks.

Definition at line 313 of file ClpDynamicMatrix.hpp.

◆ dynamicStatus()

unsigned char* ClpDynamicMatrix::dynamicStatus ( ) const
inline

Status region for gub variables.

Definition at line 318 of file ClpDynamicMatrix.hpp.

◆ whichSet()

int ClpDynamicMatrix::whichSet ( int  sequence) const

Returns which set a variable is in.

◆ times() [2/3]

virtual void ClpPackedMatrix::times

Return y + A * scalar *x in y.

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

◆ times() [3/3]

virtual void ClpPackedMatrix::times

And for scaling.

Member Data Documentation

◆ sumDualInfeasibilities_

double ClpDynamicMatrix::sumDualInfeasibilities_
protected

Sum of dual infeasibilities.

Definition at line 331 of file ClpDynamicMatrix.hpp.

◆ sumPrimalInfeasibilities_

double ClpDynamicMatrix::sumPrimalInfeasibilities_
protected

Sum of primal infeasibilities.

Definition at line 333 of file ClpDynamicMatrix.hpp.

◆ sumOfRelaxedDualInfeasibilities_

double ClpDynamicMatrix::sumOfRelaxedDualInfeasibilities_
protected

Sum of Dual infeasibilities using tolerance based on error in duals.

Definition at line 335 of file ClpDynamicMatrix.hpp.

◆ sumOfRelaxedPrimalInfeasibilities_

double ClpDynamicMatrix::sumOfRelaxedPrimalInfeasibilities_
protected

Sum of Primal infeasibilities using tolerance based on error in primals.

Definition at line 337 of file ClpDynamicMatrix.hpp.

◆ savedBestGubDual_

double ClpDynamicMatrix::savedBestGubDual_
protected

Saved best dual on gub row in pricing.

Definition at line 339 of file ClpDynamicMatrix.hpp.

◆ savedBestSet_

int ClpDynamicMatrix::savedBestSet_
protected

Saved best set in pricing.

Definition at line 341 of file ClpDynamicMatrix.hpp.

◆ backToPivotRow_

int* ClpDynamicMatrix::backToPivotRow_
protected

Backward pointer to pivot row !!!

Definition at line 343 of file ClpDynamicMatrix.hpp.

◆ keyVariable_

int* ClpDynamicMatrix::keyVariable_
mutableprotected

Key variable of set (only accurate if none in small problem)

Definition at line 345 of file ClpDynamicMatrix.hpp.

◆ toIndex_

int* ClpDynamicMatrix::toIndex_
protected

Backward pointer to extra row.

Definition at line 347 of file ClpDynamicMatrix.hpp.

◆ fromIndex_

int* ClpDynamicMatrix::fromIndex_
protected

Definition at line 349 of file ClpDynamicMatrix.hpp.

◆ numberSets_

int ClpDynamicMatrix::numberSets_
protected

Number of sets (dynamic rows)

Definition at line 351 of file ClpDynamicMatrix.hpp.

◆ numberActiveSets_

int ClpDynamicMatrix::numberActiveSets_
protected

Number of active sets.

Definition at line 353 of file ClpDynamicMatrix.hpp.

◆ objectiveOffset_

double ClpDynamicMatrix::objectiveOffset_
protected

Saved value of objective offset.

Definition at line 355 of file ClpDynamicMatrix.hpp.

◆ lowerSet_

double* ClpDynamicMatrix::lowerSet_
protected

Lower bounds on sets.

Definition at line 357 of file ClpDynamicMatrix.hpp.

◆ upperSet_

double* ClpDynamicMatrix::upperSet_
protected

Upper bounds on sets.

Definition at line 359 of file ClpDynamicMatrix.hpp.

◆ status_

unsigned char* ClpDynamicMatrix::status_
protected

Status of slack on set.

Definition at line 361 of file ClpDynamicMatrix.hpp.

◆ model_

ClpSimplex* ClpDynamicMatrix::model_
protected

Pointer back to model.

Definition at line 363 of file ClpDynamicMatrix.hpp.

◆ firstAvailable_

int ClpDynamicMatrix::firstAvailable_
protected

first free

Definition at line 365 of file ClpDynamicMatrix.hpp.

◆ firstAvailableBefore_

int ClpDynamicMatrix::firstAvailableBefore_
protected

first free when iteration started

Definition at line 367 of file ClpDynamicMatrix.hpp.

◆ firstDynamic_

int ClpDynamicMatrix::firstDynamic_
protected

first dynamic

Definition at line 369 of file ClpDynamicMatrix.hpp.

◆ lastDynamic_

int ClpDynamicMatrix::lastDynamic_
protected

number of columns in dynamic model

Definition at line 371 of file ClpDynamicMatrix.hpp.

◆ numberStaticRows_

int ClpDynamicMatrix::numberStaticRows_
protected

number of rows in original model

Definition at line 373 of file ClpDynamicMatrix.hpp.

◆ numberElements_

CoinBigIndex ClpDynamicMatrix::numberElements_
protected

size of working matrix (max)

Definition at line 375 of file ClpDynamicMatrix.hpp.

◆ numberDualInfeasibilities_

int ClpDynamicMatrix::numberDualInfeasibilities_
protected

Number of dual infeasibilities.

Definition at line 377 of file ClpDynamicMatrix.hpp.

◆ numberPrimalInfeasibilities_

int ClpDynamicMatrix::numberPrimalInfeasibilities_
protected

Number of primal infeasibilities.

Definition at line 379 of file ClpDynamicMatrix.hpp.

◆ noCheck_

int ClpDynamicMatrix::noCheck_
protected

If pricing will declare victory (i.e.

no check every factorization). -1 - always check 0 - don't check 1 - in don't check mode but looks optimal

Definition at line 385 of file ClpDynamicMatrix.hpp.

◆ infeasibilityWeight_

double ClpDynamicMatrix::infeasibilityWeight_
protected

Infeasibility weight when last full pass done.

Definition at line 387 of file ClpDynamicMatrix.hpp.

◆ numberGubColumns_

int ClpDynamicMatrix::numberGubColumns_
protected

size

Definition at line 389 of file ClpDynamicMatrix.hpp.

◆ maximumGubColumns_

int ClpDynamicMatrix::maximumGubColumns_
protected

current maximum number of columns (then compress)

Definition at line 391 of file ClpDynamicMatrix.hpp.

◆ maximumElements_

CoinBigIndex ClpDynamicMatrix::maximumElements_
protected

current maximum number of elemnts (then compress)

Definition at line 393 of file ClpDynamicMatrix.hpp.

◆ startSet_

int* ClpDynamicMatrix::startSet_
protected

Start of each set.

Definition at line 395 of file ClpDynamicMatrix.hpp.

◆ next_

int* ClpDynamicMatrix::next_
protected

next in chain

Definition at line 397 of file ClpDynamicMatrix.hpp.

◆ startColumn_

CoinBigIndex* ClpDynamicMatrix::startColumn_
protected

Starts of each column.

Definition at line 399 of file ClpDynamicMatrix.hpp.

◆ row_

int* ClpDynamicMatrix::row_
protected

rows

Definition at line 401 of file ClpDynamicMatrix.hpp.

◆ element_

double* ClpDynamicMatrix::element_
protected

elements

Definition at line 403 of file ClpDynamicMatrix.hpp.

◆ cost_

double* ClpDynamicMatrix::cost_
protected

costs

Definition at line 405 of file ClpDynamicMatrix.hpp.

◆ id_

int* ClpDynamicMatrix::id_
protected

ids of active columns (just index here)

Definition at line 407 of file ClpDynamicMatrix.hpp.

◆ dynamicStatus_

unsigned char* ClpDynamicMatrix::dynamicStatus_
protected

for status and which bound

Definition at line 409 of file ClpDynamicMatrix.hpp.

◆ columnLower_

double* ClpDynamicMatrix::columnLower_
protected

Optional lower bounds on columns.

Definition at line 411 of file ClpDynamicMatrix.hpp.

◆ columnUpper_

double* ClpDynamicMatrix::columnUpper_
protected

Optional upper bounds on columns.

Definition at line 413 of file ClpDynamicMatrix.hpp.


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