Clp  1.17.8
List of all members
ClpPrimalColumnSteepest Class Reference

Primal Column Pivot Steepest Edge Algorithm Class. More...

#include <ClpPrimalColumnSteepest.hpp>

+ Inheritance diagram for ClpPrimalColumnSteepest:
+ Collaboration diagram for ClpPrimalColumnSteepest:

Public Member Functions

Algorithmic methods
virtual int pivotColumn (CoinIndexedVector *updates, CoinIndexedVector *spareRow1, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Returns pivot column, -1 if none. More...
 
int pivotColumnOldMethod (CoinIndexedVector *updates, CoinIndexedVector *spareRow1, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 For quadratic or funny nonlinearities. More...
 
void justDjs (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Just update djs. More...
 
int partialPricing (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, int numberWanted, int numberLook)
 Update djs doing partial pricing (dantzig) More...
 
void djsAndDevex (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Update djs, weights for Devex using djs. More...
 
void djsAndSteepest (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Update djs, weights for Steepest using djs sets best sequence (possibly) More...
 
void djsAndDevex2 (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Update djs, weights for Devex using pivot row. More...
 
void djsAndSteepest2 (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Update djs, weights for Steepest using pivot row. More...
 
void justDevex (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Update weights for Devex. More...
 
void justSteepest (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1, CoinIndexedVector *spareColumn2)
 Update weights for Steepest. More...
 
int transposeTimes2 (const CoinIndexedVector *pi1, CoinIndexedVector *dj1, const CoinIndexedVector *pi2, CoinIndexedVector *dj2, CoinIndexedVector *spare, double scaleFactor)
 Updates two arrays for steepest. More...
 
virtual void updateWeights (CoinIndexedVector *input)
 Updates weights - part 1 - also checks accuracy. More...
 
void checkAccuracy (int sequence, double relativeTolerance, CoinIndexedVector *rowArray1, CoinIndexedVector *rowArray2)
 Checks accuracy - just for debug. More...
 
void initializeWeights ()
 Initialize weights. More...
 
virtual void saveWeights (ClpSimplex *model, int mode)
 Save weights - this may initialize weights as well mode is - 1) before factorization 2) after factorization 3) just redo infeasibilities 4) restore weights 5) at end of values pass (so need initialization) More...
 
void redoInfeasibilities ()
 redo infeasibilities More...
 
virtual void unrollWeights ()
 Gets rid of last update. More...
 
virtual void clearArrays ()
 Gets rid of all arrays. More...
 
virtual bool looksOptimal () const
 Returns true if would not find any column. More...
 
virtual void maximumPivotsChanged ()
 Called when maximum pivots changes. More...
 
Constructors and destructors
 ClpPrimalColumnSteepest (int mode=3)
 Default Constructor 0 is exact devex, 1 full steepest, 2 is partial exact devex 3 switches between 0 and 2 depending on factorization 4 starts as partial dantzig/devex but then may switch between 0 and 2. More...
 
 ClpPrimalColumnSteepest (const ClpPrimalColumnSteepest &rhs)
 Copy constructor. More...
 
ClpPrimalColumnSteepestoperator= (const ClpPrimalColumnSteepest &rhs)
 Assignment operator. More...
 
virtual ~ClpPrimalColumnSteepest ()
 Destructor. More...
 
virtual ClpPrimalColumnPivotclone (bool copyData=true) const
 Clone. More...
 
Private functions to deal with devex
bool reference (int i) const
 reference would be faster using ClpSimplex's status_, but I prefer to keep modularity. More...
 
void setReference (int i, bool trueFalse)
 
void setPersistence (Persistence life)
 Set/ get persistence. More...
 
Persistence persistence () const
 
- Public Member Functions inherited from ClpPrimalColumnPivot
virtual int pivotRow (double &way)
 Signals pivot row choice: -2 (default) - use normal pivot row choice -1 to numberRows-1 - use this (will be checked) way should be -1 to go to lower bound, +1 to upper bound. More...
 
virtual void setLooksOptimal (bool flag)
 Sets optimality flag (for advanced use) More...
 
 ClpPrimalColumnPivot ()
 Default Constructor. More...
 
 ClpPrimalColumnPivot (const ClpPrimalColumnPivot &)
 Copy constructor. More...
 
ClpPrimalColumnPivotoperator= (const ClpPrimalColumnPivot &rhs)
 Assignment operator. More...
 
virtual ~ClpPrimalColumnPivot ()
 Destructor. More...
 
ClpSimplexmodel ()
 Returns model. More...
 
void setModel (ClpSimplex *newmodel)
 Sets model. More...
 
int type ()
 Returns type (above 63 is extra information) More...
 

Protected Attributes

Protected member data
double devex_
 
double * weights_
 weight array More...
 
CoinIndexedVector * infeasible_
 square of infeasibility array (just for infeasible columns) More...
 
CoinIndexedVector * alternateWeights_
 alternate weight array (so we can unroll) More...
 
double * savedWeights_
 save weight array (so we can use checkpoint) More...
 
unsigned int * reference_
 
int state_
 Status 0) Normal -1) Needs initialization 1) Weights are stored by sequence number. More...
 
int mode_
 0 is exact devex, 1 full steepest, 2 is partial exact devex 3 switches between 0 and 2 depending on factorization 4 starts as partial dantzig/devex but then may switch between 0 and 2. More...
 
int infeasibilitiesState_
 
Persistence persistence_
 Life of weights. More...
 
int numberSwitched_
 Number of times switched from partial dantzig to 0/2. More...
 
int pivotSequence_
 
int savedPivotSequence_
 
int savedSequenceOut_
 
int lastRectified_
 
int sizeFactorization_
 
- Protected Attributes inherited from ClpPrimalColumnPivot
ClpSimplexmodel_
 Pointer to model. More...
 
int type_
 Type of column pivot algorithm. More...
 
bool looksOptimal_
 Says if looks optimal (normally computed) More...
 

gets and sets

enum  Persistence { normal = 0x00, keep = 0x01 }
 enums for persistence More...
 
int mode () const
 Mode. More...
 
void setMode (int mode)
 Set mode. More...
 
CoinIndexedVector * infeasible () const
 square of infeasibility array (just for infeasible columns) More...
 
const double * weights () const
 Weights. More...
 
CoinIndexedVector * alternateWeights () const
 alternate weight array More...
 
virtual int numberSprintColumns (int &numberIterations) const
 Returns number of extra columns for sprint algorithm - 0 means off. More...
 
virtual void switchOffSprint ()
 Switch off sprint idea. More...
 

Detailed Description

Primal Column Pivot Steepest Edge Algorithm Class.

See Forrest-Goldfarb paper for algorithm

Definition at line 21 of file ClpPrimalColumnSteepest.hpp.

Member Enumeration Documentation

◆ Persistence

enums for persistence

Enumerator
normal 
keep 

Definition at line 161 of file ClpPrimalColumnSteepest.hpp.

Constructor & Destructor Documentation

◆ ClpPrimalColumnSteepest() [1/2]

ClpPrimalColumnSteepest::ClpPrimalColumnSteepest ( int  mode = 3)

Default Constructor 0 is exact devex, 1 full steepest, 2 is partial exact devex 3 switches between 0 and 2 depending on factorization 4 starts as partial dantzig/devex but then may switch between 0 and 2.

By partial exact devex is meant that the weights are updated as normal but only part of the nonbasic variables are scanned. This can be faster on very easy problems.

◆ ClpPrimalColumnSteepest() [2/2]

ClpPrimalColumnSteepest::ClpPrimalColumnSteepest ( const ClpPrimalColumnSteepest rhs)

Copy constructor.

◆ ~ClpPrimalColumnSteepest()

virtual ClpPrimalColumnSteepest::~ClpPrimalColumnSteepest ( )
virtual

Destructor.

Member Function Documentation

◆ pivotColumn()

virtual int ClpPrimalColumnSteepest::pivotColumn ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow1,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)
virtual

Returns pivot column, -1 if none.

The Packed CoinIndexedVector updates has cost updates - for normal LP that is just +-weight where a feasibility changed. It also has reduced cost from last iteration in pivot row Parts of operation split out into separate functions for profiling and speed

Implements ClpPrimalColumnPivot.

Reimplemented in ClpPEPrimalColumnSteepest.

◆ pivotColumnOldMethod()

int ClpPrimalColumnSteepest::pivotColumnOldMethod ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow1,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

For quadratic or funny nonlinearities.

◆ justDjs()

void ClpPrimalColumnSteepest::justDjs ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

Just update djs.

◆ partialPricing()

int ClpPrimalColumnSteepest::partialPricing ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
int  numberWanted,
int  numberLook 
)

Update djs doing partial pricing (dantzig)

◆ djsAndDevex()

void ClpPrimalColumnSteepest::djsAndDevex ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

Update djs, weights for Devex using djs.

◆ djsAndSteepest()

void ClpPrimalColumnSteepest::djsAndSteepest ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

Update djs, weights for Steepest using djs sets best sequence (possibly)

◆ djsAndDevex2()

void ClpPrimalColumnSteepest::djsAndDevex2 ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

Update djs, weights for Devex using pivot row.

◆ djsAndSteepest2()

void ClpPrimalColumnSteepest::djsAndSteepest2 ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

Update djs, weights for Steepest using pivot row.

◆ justDevex()

void ClpPrimalColumnSteepest::justDevex ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

Update weights for Devex.

◆ justSteepest()

void ClpPrimalColumnSteepest::justSteepest ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1,
CoinIndexedVector *  spareColumn2 
)

Update weights for Steepest.

◆ transposeTimes2()

int ClpPrimalColumnSteepest::transposeTimes2 ( const CoinIndexedVector *  pi1,
CoinIndexedVector *  dj1,
const CoinIndexedVector *  pi2,
CoinIndexedVector *  dj2,
CoinIndexedVector *  spare,
double  scaleFactor 
)

Updates two arrays for steepest.

◆ updateWeights()

virtual void ClpPrimalColumnSteepest::updateWeights ( CoinIndexedVector *  input)
virtual

Updates weights - part 1 - also checks accuracy.

Reimplemented from ClpPrimalColumnPivot.

Reimplemented in ClpPEPrimalColumnSteepest.

◆ checkAccuracy()

void ClpPrimalColumnSteepest::checkAccuracy ( int  sequence,
double  relativeTolerance,
CoinIndexedVector *  rowArray1,
CoinIndexedVector *  rowArray2 
)

Checks accuracy - just for debug.

◆ initializeWeights()

void ClpPrimalColumnSteepest::initializeWeights ( )

Initialize weights.

◆ saveWeights()

virtual void ClpPrimalColumnSteepest::saveWeights ( ClpSimplex model,
int  mode 
)
virtual

Save weights - this may initialize weights as well mode is - 1) before factorization 2) after factorization 3) just redo infeasibilities 4) restore weights 5) at end of values pass (so need initialization)

Implements ClpPrimalColumnPivot.

Reimplemented in ClpPEPrimalColumnSteepest.

◆ redoInfeasibilities()

void ClpPrimalColumnSteepest::redoInfeasibilities ( )

redo infeasibilities

◆ unrollWeights()

virtual void ClpPrimalColumnSteepest::unrollWeights ( )
virtual

Gets rid of last update.

◆ clearArrays()

virtual void ClpPrimalColumnSteepest::clearArrays ( )
virtual

Gets rid of all arrays.

Reimplemented from ClpPrimalColumnPivot.

◆ looksOptimal()

virtual bool ClpPrimalColumnSteepest::looksOptimal ( ) const
virtual

Returns true if would not find any column.

Reimplemented from ClpPrimalColumnPivot.

◆ maximumPivotsChanged()

virtual void ClpPrimalColumnSteepest::maximumPivotsChanged ( )
virtual

Called when maximum pivots changes.

Reimplemented from ClpPrimalColumnPivot.

◆ mode()

int ClpPrimalColumnSteepest::mode ( ) const
inline

Mode.

Definition at line 126 of file ClpPrimalColumnSteepest.hpp.

◆ setMode()

void ClpPrimalColumnSteepest::setMode ( int  mode)
inline

Set mode.

Definition at line 131 of file ClpPrimalColumnSteepest.hpp.

◆ infeasible()

CoinIndexedVector* ClpPrimalColumnSteepest::infeasible ( ) const
inline

square of infeasibility array (just for infeasible columns)

Definition at line 136 of file ClpPrimalColumnSteepest.hpp.

◆ weights()

const double* ClpPrimalColumnSteepest::weights ( ) const
inline

Weights.

Definition at line 141 of file ClpPrimalColumnSteepest.hpp.

◆ alternateWeights()

CoinIndexedVector* ClpPrimalColumnSteepest::alternateWeights ( ) const
inline

alternate weight array

Definition at line 146 of file ClpPrimalColumnSteepest.hpp.

◆ numberSprintColumns()

virtual int ClpPrimalColumnSteepest::numberSprintColumns ( int &  numberIterations) const
virtual

Returns number of extra columns for sprint algorithm - 0 means off.

Also number of iterations before recompute

Reimplemented from ClpPrimalColumnPivot.

◆ switchOffSprint()

virtual void ClpPrimalColumnSteepest::switchOffSprint ( )
virtual

Switch off sprint idea.

Reimplemented from ClpPrimalColumnPivot.

◆ operator=()

ClpPrimalColumnSteepest& ClpPrimalColumnSteepest::operator= ( const ClpPrimalColumnSteepest rhs)

Assignment operator.

◆ clone()

virtual ClpPrimalColumnPivot* ClpPrimalColumnSteepest::clone ( bool  copyData = true) const
virtual

Clone.

Implements ClpPrimalColumnPivot.

Reimplemented in ClpPEPrimalColumnSteepest.

◆ reference()

bool ClpPrimalColumnSteepest::reference ( int  i) const
inline

reference would be faster using ClpSimplex's status_, but I prefer to keep modularity.

Definition at line 196 of file ClpPrimalColumnSteepest.hpp.

◆ setReference()

void ClpPrimalColumnSteepest::setReference ( int  i,
bool  trueFalse 
)
inline

Definition at line 200 of file ClpPrimalColumnSteepest.hpp.

◆ setPersistence()

void ClpPrimalColumnSteepest::setPersistence ( Persistence  life)
inline

Set/ get persistence.

Definition at line 210 of file ClpPrimalColumnSteepest.hpp.

◆ persistence()

Persistence ClpPrimalColumnSteepest::persistence ( ) const
inline

Definition at line 214 of file ClpPrimalColumnSteepest.hpp.

Member Data Documentation

◆ devex_

double ClpPrimalColumnSteepest::devex_
protected

Definition at line 225 of file ClpPrimalColumnSteepest.hpp.

◆ weights_

double* ClpPrimalColumnSteepest::weights_
protected

weight array

Definition at line 227 of file ClpPrimalColumnSteepest.hpp.

◆ infeasible_

CoinIndexedVector* ClpPrimalColumnSteepest::infeasible_
protected

square of infeasibility array (just for infeasible columns)

Definition at line 229 of file ClpPrimalColumnSteepest.hpp.

◆ alternateWeights_

CoinIndexedVector* ClpPrimalColumnSteepest::alternateWeights_
protected

alternate weight array (so we can unroll)

Definition at line 231 of file ClpPrimalColumnSteepest.hpp.

◆ savedWeights_

double* ClpPrimalColumnSteepest::savedWeights_
protected

save weight array (so we can use checkpoint)

Definition at line 233 of file ClpPrimalColumnSteepest.hpp.

◆ reference_

unsigned int* ClpPrimalColumnSteepest::reference_
protected

Definition at line 235 of file ClpPrimalColumnSteepest.hpp.

◆ state_

int ClpPrimalColumnSteepest::state_
protected

Status 0) Normal -1) Needs initialization 1) Weights are stored by sequence number.

Definition at line 241 of file ClpPrimalColumnSteepest.hpp.

◆ mode_

int ClpPrimalColumnSteepest::mode_
protected

0 is exact devex, 1 full steepest, 2 is partial exact devex 3 switches between 0 and 2 depending on factorization 4 starts as partial dantzig/devex but then may switch between 0 and 2.

5 is always partial dantzig By partial exact devex is meant that the weights are updated as normal but only part of the nonbasic variables are scanned. This can be faster on very easy problems.

New dubious option is >=10 which does mini-sprint

Definition at line 254 of file ClpPrimalColumnSteepest.hpp.

◆ infeasibilitiesState_

int ClpPrimalColumnSteepest::infeasibilitiesState_
protected

Definition at line 260 of file ClpPrimalColumnSteepest.hpp.

◆ persistence_

Persistence ClpPrimalColumnSteepest::persistence_
protected

Life of weights.

Definition at line 262 of file ClpPrimalColumnSteepest.hpp.

◆ numberSwitched_

int ClpPrimalColumnSteepest::numberSwitched_
protected

Number of times switched from partial dantzig to 0/2.

Definition at line 264 of file ClpPrimalColumnSteepest.hpp.

◆ pivotSequence_

int ClpPrimalColumnSteepest::pivotSequence_
protected

Definition at line 266 of file ClpPrimalColumnSteepest.hpp.

◆ savedPivotSequence_

int ClpPrimalColumnSteepest::savedPivotSequence_
protected

Definition at line 268 of file ClpPrimalColumnSteepest.hpp.

◆ savedSequenceOut_

int ClpPrimalColumnSteepest::savedSequenceOut_
protected

Definition at line 270 of file ClpPrimalColumnSteepest.hpp.

◆ lastRectified_

int ClpPrimalColumnSteepest::lastRectified_
protected

Definition at line 272 of file ClpPrimalColumnSteepest.hpp.

◆ sizeFactorization_

int ClpPrimalColumnSteepest::sizeFactorization_
protected

Definition at line 274 of file ClpPrimalColumnSteepest.hpp.


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