Scippy

SoPlex

Sequential object-oriented simPlex

SPxDevexPR Class Reference

Devex pricer.The Devex Pricer for SoPlex implements an approximate steepest edge pricing, that does without solving an extra linear system and computing the scalar products. More...

#include <spxdevexpr.h>

Inheritance diagram for SPxDevexPR:

Public Member Functions

Construction / destruction
 SPxDevexPR ()
 default constructor
 
 SPxDevexPR (const SPxDevexPR &old)
 copy constructor
 
SPxDevexPRoperator= (const SPxDevexPR &rhs)
 assignment operator
 
virtual ~SPxDevexPR ()
 destructor
 
virtual SPxPricerclone () const
 clone function for polymorphism
 
Access / modification
virtual void load (SPxSolver *base)
 sets the solver
 
virtual void setType (SPxSolver::Type)
 set entering/leaving algorithm
 
virtual void setRep (SPxSolver::Representation)
 set row/column representation
 
virtual int selectLeave ()
 
virtual SPxId selectEnter ()
 
virtual void left4 (int n, SPxId id)
 
virtual void entered4 (SPxId id, int n)
 
virtual void addedVecs (int n)
 n vectors have been added to loaded LP.
 
virtual void addedCoVecs (int n)
 n covectors have been added to loaded LP.
 
Consistency check
virtual bool isConsistent () const
 consistency check
 
- Public Member Functions inherited from SPxPricer
virtual const char * getName () const
 get name of pricer.
 
virtual void clear ()
 unloads LP.
 
virtual SPxSolversolver () const
 returns loaded SPxSolver object.
 
virtual Real epsilon () const
 returns violation bound theeps.
 
virtual void setEpsilon (Real eps)
 sets violation bound.
 
virtual void removedVec (int)
 vector i was removed from loaded LP.
 
virtual void removedVecs (const int *)
 vectors given by perm have been removed from loaded LP.
 
virtual void removedCoVec (int)
 covector i was removed from loaded LP.
 
virtual void removedCoVecs (const int *)
 covectors given by perm have been removed from loaded LP.
 
virtual void getNdualNorms (int &nrows, int &ncols) const
 get number of available norms
 
virtual bool getDualNorms (int &nrows, int &ncols, Real *norms) const
 export norms from pricer
 
virtual bool setDualNorms (int nrows, int ncols, Real *norms)
 import norms into pricer
 
 SPxPricer (const char *p_name)
 constructor
 
 SPxPricer (const SPxPricer &old)
 copy constructor
 
SPxPriceroperator= (const SPxPricer &rhs)
 assignment operator
 
virtual ~SPxPricer ()
 destructor.
 

Private Member Functions

Private helpers
void init (SPxSolver::Type)
 set entering/leaving algorithm
 
int buildBestPriceVectorLeave (Real feastol)
 build up vector of pricing values for later use
 
int selectLeaveX (Real feastol, int start=0, int incr=1)
 internal implementation of SPxPricer::selectLeave()
 
int selectLeaveSparse (Real feastol)
 implementation of sparse pricing in the leaving Simplex
 
int selectLeaveHyper (Real feastol)
 implementation of hyper sparse pricing in the leaving Simplex
 
SPxId buildBestPriceVectorEnterDim (Real &best, Real feastol)
 build up vector of pricing values for later use
 
SPxId buildBestPriceVectorEnterCoDim (Real &best, Real feastol)
 
SPxId selectEnterX (Real tol)
 choose the best entering index among columns and rows but prefer sparsity
 
SPxId selectEnterSparseDim (Real &best, Real feastol)
 implementation of sparse pricing in the entering Simplex (slack variables)
 
SPxId selectEnterSparseCoDim (Real &best, Real feastol)
 implementation of sparse pricing in the entering Simplex
 
SPxId selectEnterDenseDim (Real &best, Real feastol, int start=0, int incr=1)
 SPxPricer::selectEnter() in dense case (slack variabels)
 
SPxId selectEnterDenseCoDim (Real &best, Real feastol, int start=0, int incr=1)
 SPxPricer::selectEnter() in dense case.
 
SPxId selectEnterHyperDim (Real &best, Real feastol)
 implementation of hyper sparse pricing in the entering Simplex
 
SPxId selectEnterHyperCoDim (Real &best, Real feastol)
 implementation of hyper sparse pricing in the entering Simplex
 

Private Attributes

Data
Real last
 penalty, selected at last iteration.
 
DataArray< IdxElementprices
 temporary array of precomputed pricing values
 
DataArray< IdxElementpricesCo
 temporary array of precomputed pricing values
 
DIdxSet bestPrices
 set of best pricing candidates
 
DIdxSet bestPricesCo
 set of best pricing candidates
 

Additional Inherited Members

- Public Types inherited from SPxPricer
enum  ViolationType { NOT_VIOLATED = 0, VIOLATED = 1, VIOLATED_AND_CHECKED = 2 }
 
- Protected Attributes inherited from SPxPricer
IdxCompare compare
 
const char * m_name
 name of the pricer
 
SPxSolverthesolver
 the solver
 
Real theeps
 violation bound
 
DVector weights
 vector to store pricing weights or norms
 
DVector coWeights
 
bool weightsAreSetup
 are the weights already set up?
 

Detailed Description

Devex pricer.

The Devex Pricer for SoPlex implements an approximate steepest edge pricing, that does without solving an extra linear system and computing the scalar products.

See SPxPricer for a class documentation.

Todo:
There seem to be problems with this pricer especially on the greenbe[ab] problems with the entering algorithm (row representation?).

Definition at line 43 of file spxdevexpr.h.

Constructor & Destructor Documentation

default constructor

Definition at line 96 of file spxdevexpr.h.

Referenced by SPxDevexPR::clone().

SPxDevexPR ( const SPxDevexPR old)

copy constructor

Definition at line 102 of file spxdevexpr.h.

virtual ~SPxDevexPR ( )
virtual

destructor

Definition at line 119 of file spxdevexpr.h.

Member Function Documentation

void addedCoVecs ( int  n)
virtual

n covectors have been added to loaded LP.

Reimplemented from SPxPricer.

Definition at line 861 of file spxdevexpr.cpp.

References SPxPricer::coWeights, VectorBase< R >::dim(), SPxSolver::dim(), SPxSolver::ENTER, DVectorBase< R >::reDim(), SPxPricer::thesolver, and SPxSolver::type().

Referenced by SPxHybridPR::addedCoVecs(), and SPxDevexPR::setRep().

void addedVecs ( int  n)
virtual

n vectors have been added to loaded LP.

Reimplemented from SPxPricer.

Definition at line 852 of file spxdevexpr.cpp.

References SPxSolver::coDim(), VectorBase< R >::dim(), SPxSolver::ENTER, DVectorBase< R >::reDim(), SPxPricer::thesolver, SPxSolver::type(), and SPxPricer::weights.

Referenced by SPxHybridPR::addedVecs(), and SPxDevexPR::setRep().

virtual SPxPricer* clone ( ) const
virtual

clone function for polymorphism

Implements SPxPricer.

Definition at line 122 of file spxdevexpr.h.

References SPxDevexPR::SPxDevexPR().

void entered4 ( SPxId  id,
int  n 
)
virtual
Todo:
suspicious: the pricer should be informed, that variable id has entered the basis at position n, but the id is not used here (this is true for all pricers)

Reimplemented from SPxPricer.

Definition at line 812 of file spxdevexpr.cpp.

References SPxSolver::coPvec(), SPxPricer::coWeights, UpdateVector::delta(), SPxSolver::ENTER, SPxSolver::epsilon(), SPxSolver::fVec(), UpdateVector::idx(), IdxSet::index(), SPxDevexPR::init(), SPxDevexPR::last, SPxSolver::pVec(), IdxSet::size(), SPxPricer::thesolver, SSVectorBase< R >::values(), and SPxPricer::weights.

bool isConsistent ( ) const
virtual
void load ( SPxSolver base)
virtual

sets the solver

Reimplemented from SPxPricer.

Definition at line 24 of file spxdevexpr.cpp.

References SPxDevexPR::isConsistent(), SPxSolver::rep(), SPxDevexPR::setRep(), and SPxPricer::thesolver.

Referenced by SPxHybridPR::load(), and SPxAutoPR::load().

SPxDevexPR& operator= ( const SPxDevexPR rhs)

assignment operator

Definition at line 108 of file spxdevexpr.h.

References SPxDevexPR::last, and SPxPricer::operator=().

SPxId selectEnterDenseCoDim ( Real best,
Real  feastol,
int  start = 0,
int  incr = 1 
)
private
SPxId selectEnterDenseDim ( Real best,
Real  feastol,
int  start = 0,
int  incr = 1 
)
private
SPxId selectEnterSparseDim ( Real best,
Real  feastol 
)
private
int selectLeaveX ( Real  feastol,
int  start = 0,
int  incr = 1 
)
private
void setRep ( SPxSolver::Representation  )
virtual

set row/column representation

Todo:
suspicious: Shouldn't the relation between dim, coDim, Vecs, and CoVecs be influenced by the representation ?

Reimplemented from SPxPricer.

Definition at line 92 of file spxdevexpr.cpp.

References SPxDevexPR::addedCoVecs(), SPxDevexPR::addedVecs(), SPxSolver::coDim(), SPxSolver::dim(), SPxDevexPR::isConsistent(), and SPxPricer::thesolver.

Referenced by SPxDevexPR::load(), SPxHybridPR::setRep(), and SPxAutoPR::setRep().

void setType ( SPxSolver::Type  tp)
virtual

set entering/leaving algorithm

Reimplemented from SPxPricer.

Definition at line 83 of file spxdevexpr.cpp.

References SPxDevexPR::init().

Member Data Documentation

DIdxSet bestPricesCo
private
DataArray<IdxElement> prices
private

temporary array of precomputed pricing values

Definition at line 51 of file spxdevexpr.h.

Referenced by SPxDevexPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), and SPxDevexPR::init().

DataArray<IdxElement> pricesCo
private

temporary array of precomputed pricing values

Definition at line 52 of file spxdevexpr.h.

Referenced by SPxDevexPR::buildBestPriceVectorEnterCoDim(), and SPxDevexPR::init().