Clp  1.17.8
List of all members
AbcPrimalColumnSteepest Class Reference

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

#include <AbcPrimalColumnSteepest.hpp>

+ Inheritance diagram for AbcPrimalColumnSteepest:
+ Collaboration diagram for AbcPrimalColumnSteepest:

Public Member Functions

Algorithmic methods
virtual int pivotColumn (CoinPartitionedVector *updates, CoinPartitionedVector *spareRow2, CoinPartitionedVector *spareColumn1)
 Returns pivot column, -1 if none. More...
 
void justDjs (CoinIndexedVector *updates, CoinIndexedVector *spareColumn1)
 Just update djs. More...
 
int partialPricing (CoinIndexedVector *updates, int numberWanted, int numberLook)
 Update djs doing partial pricing (dantzig) More...
 
void djsAndDevex (CoinIndexedVector *updates, CoinIndexedVector *spareRow2, CoinIndexedVector *spareColumn1)
 Update djs, weights for Devex using djs. More...
 
void djsAndDevex2 (CoinIndexedVector *updates, CoinIndexedVector *spareColumn1)
 Update djs, weights for Devex using pivot row. More...
 
void justDevex (CoinIndexedVector *updates, CoinIndexedVector *spareColumn1)
 Update weights for Devex. More...
 
int doSteepestWork (CoinPartitionedVector *updates, CoinPartitionedVector *spareRow2, CoinPartitionedVector *spareColumn1, int type)
 Does steepest work type - 0 - just djs 1 - just steepest 2 - both using scaleFactor 3 - both using extra array. More...
 
virtual void updateWeights (CoinIndexedVector *input)
 Updates weights - part 1 - also checks accuracy. More...
 
void checkAccuracy (int sequence, double relativeTolerance, CoinIndexedVector *rowArray1)
 Checks accuracy - just for debug. More...
 
void initializeWeights ()
 Initialize weights. More...
 
virtual void saveWeights (AbcSimplex *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...
 
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
 AbcPrimalColumnSteepest (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...
 
 AbcPrimalColumnSteepest (const AbcPrimalColumnSteepest &rhs)
 Copy constructor. More...
 
AbcPrimalColumnSteepestoperator= (const AbcPrimalColumnSteepest &rhs)
 Assignment operator. More...
 
virtual ~AbcPrimalColumnSteepest ()
 Destructor. More...
 
virtual AbcPrimalColumnPivotclone (bool copyData=true) const
 Clone. More...
 
Private functions to deal with devex
bool reference (int i) const
 reference would be faster using AbcSimplex'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 AbcPrimalColumnPivot
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...
 
 AbcPrimalColumnPivot ()
 Default Constructor. More...
 
 AbcPrimalColumnPivot (const AbcPrimalColumnPivot &)
 Copy constructor. More...
 
AbcPrimalColumnPivotoperator= (const AbcPrimalColumnPivot &rhs)
 Assignment operator. More...
 
virtual ~AbcPrimalColumnPivot ()
 Destructor. More...
 
AbcSimplexmodel ()
 Returns model. More...
 
void setModel (AbcSimplex *newmodel)
 Sets model. More...
 
int type ()
 Returns type (above 63 is extra information) 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...
 

Private Attributes

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

gets and sets

enum  Persistence { normal = 0x00, keep = 0x01 }
 enums for persistence More...
 
int mode () const
 Mode. More...
 

Additional Inherited Members

- Protected Attributes inherited from AbcPrimalColumnPivot
AbcSimplexmodel_
 Pointer to model. More...
 
int type_
 Type of column pivot algorithm. More...
 
bool looksOptimal_
 Says if looks optimal (normally computed) More...
 

Detailed Description

Primal Column Pivot Steepest Edge Algorithm Class.

See Forrest-Goldfarb paper for algorithm

Definition at line 21 of file AbcPrimalColumnSteepest.hpp.

Member Enumeration Documentation

◆ Persistence

enums for persistence

Enumerator
normal 
keep 

Definition at line 106 of file AbcPrimalColumnSteepest.hpp.

Constructor & Destructor Documentation

◆ AbcPrimalColumnSteepest() [1/2]

AbcPrimalColumnSteepest::AbcPrimalColumnSteepest ( 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.

◆ AbcPrimalColumnSteepest() [2/2]

AbcPrimalColumnSteepest::AbcPrimalColumnSteepest ( const AbcPrimalColumnSteepest rhs)

Copy constructor.

◆ ~AbcPrimalColumnSteepest()

virtual AbcPrimalColumnSteepest::~AbcPrimalColumnSteepest ( )
virtual

Destructor.

Member Function Documentation

◆ pivotColumn()

virtual int AbcPrimalColumnSteepest::pivotColumn ( CoinPartitionedVector *  updates,
CoinPartitionedVector *  spareRow2,
CoinPartitionedVector *  spareColumn1 
)
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 AbcPrimalColumnPivot.

◆ justDjs()

void AbcPrimalColumnSteepest::justDjs ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareColumn1 
)

Just update djs.

◆ partialPricing()

int AbcPrimalColumnSteepest::partialPricing ( CoinIndexedVector *  updates,
int  numberWanted,
int  numberLook 
)

Update djs doing partial pricing (dantzig)

◆ djsAndDevex()

void AbcPrimalColumnSteepest::djsAndDevex ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareRow2,
CoinIndexedVector *  spareColumn1 
)

Update djs, weights for Devex using djs.

◆ djsAndDevex2()

void AbcPrimalColumnSteepest::djsAndDevex2 ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareColumn1 
)

Update djs, weights for Devex using pivot row.

◆ justDevex()

void AbcPrimalColumnSteepest::justDevex ( CoinIndexedVector *  updates,
CoinIndexedVector *  spareColumn1 
)

Update weights for Devex.

◆ doSteepestWork()

int AbcPrimalColumnSteepest::doSteepestWork ( CoinPartitionedVector *  updates,
CoinPartitionedVector *  spareRow2,
CoinPartitionedVector *  spareColumn1,
int  type 
)

Does steepest work type - 0 - just djs 1 - just steepest 2 - both using scaleFactor 3 - both using extra array.

◆ updateWeights()

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

Updates weights - part 1 - also checks accuracy.

Reimplemented from AbcPrimalColumnPivot.

◆ checkAccuracy()

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

Checks accuracy - just for debug.

◆ initializeWeights()

void AbcPrimalColumnSteepest::initializeWeights ( )

Initialize weights.

◆ saveWeights()

virtual void AbcPrimalColumnSteepest::saveWeights ( AbcSimplex 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 AbcPrimalColumnPivot.

◆ unrollWeights()

virtual void AbcPrimalColumnSteepest::unrollWeights ( )
virtual

Gets rid of last update.

◆ clearArrays()

virtual void AbcPrimalColumnSteepest::clearArrays ( )
virtual

Gets rid of all arrays.

Reimplemented from AbcPrimalColumnPivot.

◆ looksOptimal()

virtual bool AbcPrimalColumnSteepest::looksOptimal ( ) const
virtual

Returns true if would not find any column.

Reimplemented from AbcPrimalColumnPivot.

◆ maximumPivotsChanged()

virtual void AbcPrimalColumnSteepest::maximumPivotsChanged ( )
virtual

Called when maximum pivots changes.

Reimplemented from AbcPrimalColumnPivot.

◆ mode()

int AbcPrimalColumnSteepest::mode ( ) const
inline

Mode.

Definition at line 98 of file AbcPrimalColumnSteepest.hpp.

◆ operator=()

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

Assignment operator.

◆ clone()

virtual AbcPrimalColumnPivot* AbcPrimalColumnSteepest::clone ( bool  copyData = true) const
virtual

Clone.

Implements AbcPrimalColumnPivot.

◆ reference()

bool AbcPrimalColumnSteepest::reference ( int  i) const
inline

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

Definition at line 141 of file AbcPrimalColumnSteepest.hpp.

◆ setReference()

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

Definition at line 145 of file AbcPrimalColumnSteepest.hpp.

◆ setPersistence()

void AbcPrimalColumnSteepest::setPersistence ( Persistence  life)
inline

Set/ get persistence.

Definition at line 155 of file AbcPrimalColumnSteepest.hpp.

◆ persistence()

Persistence AbcPrimalColumnSteepest::persistence ( ) const
inline

Definition at line 159 of file AbcPrimalColumnSteepest.hpp.

Member Data Documentation

◆ devex_

double AbcPrimalColumnSteepest::devex_
private

Definition at line 170 of file AbcPrimalColumnSteepest.hpp.

◆ weights_

double* AbcPrimalColumnSteepest::weights_
private

weight array

Definition at line 172 of file AbcPrimalColumnSteepest.hpp.

◆ infeasible_

CoinIndexedVector* AbcPrimalColumnSteepest::infeasible_
private

square of infeasibility array (just for infeasible columns)

Definition at line 174 of file AbcPrimalColumnSteepest.hpp.

◆ alternateWeights_

CoinIndexedVector* AbcPrimalColumnSteepest::alternateWeights_
private

alternate weight array (so we can unroll)

Definition at line 176 of file AbcPrimalColumnSteepest.hpp.

◆ savedWeights_

double* AbcPrimalColumnSteepest::savedWeights_
private

save weight array (so we can use checkpoint)

Definition at line 178 of file AbcPrimalColumnSteepest.hpp.

◆ reference_

unsigned int* AbcPrimalColumnSteepest::reference_
private

Definition at line 180 of file AbcPrimalColumnSteepest.hpp.

◆ state_

int AbcPrimalColumnSteepest::state_
private

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

Definition at line 186 of file AbcPrimalColumnSteepest.hpp.

◆ mode_

int AbcPrimalColumnSteepest::mode_
private

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 199 of file AbcPrimalColumnSteepest.hpp.

◆ persistence_

Persistence AbcPrimalColumnSteepest::persistence_
private

Life of weights.

Definition at line 201 of file AbcPrimalColumnSteepest.hpp.

◆ numberSwitched_

int AbcPrimalColumnSteepest::numberSwitched_
private

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

Definition at line 203 of file AbcPrimalColumnSteepest.hpp.

◆ pivotSequence_

int AbcPrimalColumnSteepest::pivotSequence_
private

Definition at line 205 of file AbcPrimalColumnSteepest.hpp.

◆ savedPivotSequence_

int AbcPrimalColumnSteepest::savedPivotSequence_
private

Definition at line 207 of file AbcPrimalColumnSteepest.hpp.

◆ savedSequenceOut_

int AbcPrimalColumnSteepest::savedSequenceOut_
private

Definition at line 209 of file AbcPrimalColumnSteepest.hpp.

◆ lastRectified_

int AbcPrimalColumnSteepest::lastRectified_
private

Definition at line 211 of file AbcPrimalColumnSteepest.hpp.

◆ sizeFactorization_

int AbcPrimalColumnSteepest::sizeFactorization_
private

Definition at line 213 of file AbcPrimalColumnSteepest.hpp.


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