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>
Public Member Functions | |
Construction / destruction | |
SPxDevexPR () | |
default constructor More... | |
SPxDevexPR (const SPxDevexPR &old) | |
copy constructor More... | |
SPxDevexPR & | operator= (const SPxDevexPR &rhs) |
assignment operator More... | |
virtual | ~SPxDevexPR () |
destructor More... | |
virtual SPxPricer * | clone () const |
clone function for polymorphism More... | |
Access / modification | |
virtual void | load (SPxSolver *base) |
sets the solver More... | |
virtual void | setType (SPxSolver::Type) |
set entering/leaving algorithm More... | |
virtual void | setRep (SPxSolver::Representation) |
set row/column representation More... | |
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. More... | |
virtual void | addedCoVecs (int n) |
n covectors have been added to loaded LP. More... | |
Consistency check | |
virtual bool | isConsistent () const |
consistency check More... | |
Public Member Functions inherited from SPxPricer | |
virtual const char * | getName () const |
get name of pricer. More... | |
virtual void | clear () |
unloads LP. More... | |
virtual SPxSolver * | solver () const |
returns loaded SPxSolver object. More... | |
virtual Real | epsilon () const |
returns violation bound theeps. More... | |
virtual void | setEpsilon (Real eps) |
sets violation bound. More... | |
virtual void | removedVec (int) |
vector i was removed from loaded LP. More... | |
virtual void | removedVecs (const int *) |
vectors given by perm have been removed from loaded LP. More... | |
virtual void | removedCoVec (int) |
covector i was removed from loaded LP. More... | |
virtual void | removedCoVecs (const int *) |
covectors given by perm have been removed from loaded LP. More... | |
SPxPricer (const char *p_name) | |
constructor More... | |
SPxPricer (const SPxPricer &old) | |
copy constructor More... | |
SPxPricer & | operator= (const SPxPricer &rhs) |
assignment operator More... | |
virtual | ~SPxPricer () |
destructor. More... | |
Private Member Functions | |
Private helpers | |
void | setupWeights (SPxSolver::Type) |
set entering/leaving algorithm More... | |
int | buildBestPriceVectorLeave (Real feastol) |
build up vector of pricing values for later use More... | |
int | selectLeaveX (Real feastol, int start=0, int incr=1) |
internal implementation of SPxPricer::selectLeave() More... | |
int | selectLeaveSparse (Real feastol) |
implementation of sparse pricing in the leaving Simplex More... | |
int | selectLeaveHyper (Real feastol) |
implementation of hyper sparse pricing in the leaving Simplex More... | |
SPxId | buildBestPriceVectorEnterDim (Real &best, Real feastol) |
build up vector of pricing values for later use More... | |
SPxId | buildBestPriceVectorEnterCoDim (Real &best, Real feastol) |
SPxId | selectEnterX (Real tol) |
choose the best entering index among columns and rows but prefer sparsity More... | |
SPxId | selectEnterSparseDim (Real &best, Real feastol) |
implementation of sparse pricing in the entering Simplex (slack variables) More... | |
SPxId | selectEnterSparseCoDim (Real &best, Real feastol) |
implementation of sparse pricing in the entering Simplex More... | |
SPxId | selectEnterDenseDim (Real &best, Real feastol, int start=0, int incr=1) |
SPxPricer::selectEnter() in dense case (slack variabels) More... | |
SPxId | selectEnterDenseCoDim (Real &best, Real feastol, int start=0, int incr=1) |
SPxPricer::selectEnter() in dense case. More... | |
SPxId | selectEnterHyperDim (Real &best, Real feastol) |
implementation of hyper sparse pricing in the entering Simplex More... | |
SPxId | selectEnterHyperCoDim (Real &best, Real feastol) |
implementation of hyper sparse pricing in the entering Simplex More... | |
Private Attributes | |
Data | |
Real | last |
penalty, selected at last iteration. More... | |
DataArray< IdxElement > | prices |
temporary array of precomputed pricing values More... | |
DataArray< IdxElement > | pricesCo |
temporary array of precomputed pricing values More... | |
DIdxSet | bestPrices |
set of best pricing candidates More... | |
DIdxSet | bestPricesCo |
set of best pricing candidates More... | |
bool | refined |
has a refinement step already been tried? More... | |
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 More... | |
SPxSolver * | thesolver |
the solver More... | |
Real | theeps |
violation bound More... | |
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.
Definition at line 43 of file spxdevexpr.h.
SPxDevexPR | ( | ) |
SPxDevexPR | ( | const SPxDevexPR & | old | ) |
copy constructor
Definition at line 102 of file spxdevexpr.h.
|
virtual |
destructor
Definition at line 119 of file spxdevexpr.h.
|
virtual |
n
covectors have been added to loaded LP.
Reimplemented from SPxPricer.
Definition at line 926 of file spxdevexpr.cpp.
References SPxSolver::coWeights, VectorBase< R >::dim(), SPxSolver::dim(), SPxSolver::ENTER, DVectorBase< R >::reDim(), SPxPricer::thesolver, and SPxSolver::type().
Referenced by SPxHybridPR::addedCoVecs(), SPxDevexPR::clone(), and SPxDevexPR::setRep().
|
virtual |
n
vectors have been added to loaded LP.
Reimplemented from SPxPricer.
Definition at line 915 of file spxdevexpr.cpp.
References SPxSolver::coDim(), VectorBase< R >::dim(), SPxSolver::ENTER, DVectorBase< R >::reDim(), SPxPricer::thesolver, SPxSolver::type(), and SPxSolver::weights.
Referenced by SPxHybridPR::addedVecs(), SPxDevexPR::clone(), and SPxDevexPR::setRep().
Definition at line 431 of file spxdevexpr.cpp.
References DIdxSet::addIdx(), DataArray< T >::append(), SPxDevexPR::bestPricesCo, IdxSet::clear(), DataArray< T >::clear(), SPxPricer::compare, soplex::computePrice(), SPxPricer::IdxCompare::elements, DataArray< T >::get_const_ptr(), VectorBase< R >::get_const_ptr(), DataArray< T >::get_ptr(), HYPERPRICINGSIZE, SPxSolver::id(), SPxPricer::IdxElement::idx, IdxSet::index(), SPxSolver::infeasibilitiesCo, SPxSolver::isInfeasibleCo, SPxPricer::NOT_VIOLATED, SPxDevexPR::pricesCo, IdxSet::remove(), IdxSet::size(), DataArray< T >::size(), soplex::SPxQuicksortPart(), SPxSolver::test(), SPxPricer::thesolver, SPxPricer::IdxElement::val, SPxPricer::VIOLATED, SPxPricer::VIOLATED_AND_CHECKED, and SPxSolver::weights.
Referenced by SPxDevexPR::selectEnterX().
build up vector of pricing values for later use
Definition at line 378 of file spxdevexpr.cpp.
References DIdxSet::addIdx(), DataArray< T >::append(), SPxDevexPR::bestPrices, IdxSet::clear(), DataArray< T >::clear(), SPxSolver::coId(), SPxPricer::compare, soplex::computePrice(), SPxSolver::coTest(), SPxSolver::coWeights, SPxPricer::IdxCompare::elements, DataArray< T >::get_const_ptr(), VectorBase< R >::get_const_ptr(), DataArray< T >::get_ptr(), HYPERPRICINGSIZE, SPxPricer::IdxElement::idx, IdxSet::index(), SPxSolver::infeasibilities, SPxSolver::isInfeasible, SPxPricer::NOT_VIOLATED, SPxDevexPR::prices, IdxSet::remove(), IdxSet::size(), DataArray< T >::size(), soplex::SPxQuicksortPart(), SPxPricer::thesolver, SPxPricer::IdxElement::val, SPxPricer::VIOLATED, and SPxPricer::VIOLATED_AND_CHECKED.
Referenced by SPxDevexPR::selectEnterX().
|
private |
build up vector of pricing values for later use
Definition at line 119 of file spxdevexpr.cpp.
References DIdxSet::addIdx(), DataArray< T >::append(), SPxDevexPR::bestPrices, IdxSet::clear(), DataArray< T >::clear(), SPxPricer::compare, soplex::computePrice(), SPxSolver::coWeights, SPxPricer::IdxCompare::elements, SPxSolver::fTest(), DataArray< T >::get_const_ptr(), VectorBase< R >::get_const_ptr(), DataArray< T >::get_ptr(), HYPERPRICINGSIZE, SPxPricer::IdxElement::idx, IdxSet::index(), SPxSolver::infeasibilities, SPxSolver::isInfeasible, SPxDevexPR::prices, IdxSet::size(), DataArray< T >::size(), soplex::SPxQuicksortPart(), SPxPricer::thesolver, SPxPricer::IdxElement::val, SPxPricer::VIOLATED, and SPxPricer::VIOLATED_AND_CHECKED.
Referenced by SPxDevexPR::selectLeave().
|
virtual |
clone function for polymorphism
Implements SPxPricer.
Definition at line 122 of file spxdevexpr.h.
References SPxDevexPR::addedCoVecs(), SPxDevexPR::addedVecs(), SPxDevexPR::entered4(), SPxDevexPR::isConsistent(), SPxDevexPR::left4(), SPxDevexPR::load(), SPxDevexPR::selectEnter(), SPxDevexPR::selectLeave(), SPxDevexPR::setRep(), SPxDevexPR::setType(), and SPxDevexPR::SPxDevexPR().
|
virtual |
Reimplemented from SPxPricer.
Definition at line 870 of file spxdevexpr.cpp.
References SPxSolver::coPvec(), SPxSolver::coWeights, UpdateVector::delta(), SPxSolver::ENTER, SPxSolver::epsilon(), SPxSolver::fVec(), UpdateVector::idx(), IdxSet::index(), SPxDevexPR::last, SPxSolver::pVec(), SPxDevexPR::setupWeights(), IdxSet::size(), SPxPricer::thesolver, SSVectorBase< R >::values(), and SPxSolver::weights.
Referenced by SPxDevexPR::clone().
|
virtual |
consistency check
Reimplemented from SPxPricer.
Definition at line 31 of file spxdevexpr.cpp.
References SPxSolver::coDim(), SPxSolver::dim(), MSGinconsistent, and SPxPricer::thesolver.
Referenced by SPxDevexPR::clone(), SPxHybridPR::isConsistent(), SPxDevexPR::load(), SPxDevexPR::setRep(), and SPxDevexPR::setType().
|
virtual |
Reimplemented from SPxPricer.
Definition at line 340 of file spxdevexpr.cpp.
References SPxSolver::coPvec(), SPxSolver::coWeights, UpdateVector::delta(), SPxSolver::fVec(), UpdateVector::idx(), IdxSet::index(), SSVectorBase< R >::length2(), MSG_INFO3, IdxSet::size(), soplex::spxAbs(), SPxSolver::spxout, SPxPricer::theeps, SPxPricer::thesolver, and SSVectorBase< R >::values().
Referenced by SPxDevexPR::clone().
|
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 SPxDevexPR::clone(), 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=().
|
virtual |
Implements SPxPricer.
Definition at line 484 of file spxdevexpr.cpp.
References DEVEX_REFINETOL, SPxId::isValid(), MSG_INFO3, SPxDevexPR::refined, SPxDevexPR::selectEnterX(), SPxSolver::spxout, SPxPricer::theeps, and SPxPricer::thesolver.
Referenced by SPxDevexPR::clone().
SPxPricer::selectEnter() in dense case.
Definition at line 832 of file spxdevexpr.cpp.
References soplex::computePrice(), VectorBase< R >::dim(), VectorBase< R >::get_const_ptr(), SPxSolver::id(), SPxDevexPR::last, SPxSolver::test(), SPxPricer::thesolver, and SPxSolver::weights.
Referenced by SPxDevexPR::selectEnterX().
SPxPricer::selectEnter() in dense case (slack variabels)
Definition at line 798 of file spxdevexpr.cpp.
References SPxSolver::coId(), soplex::computePrice(), SPxSolver::coTest(), SPxSolver::coWeights, VectorBase< R >::dim(), VectorBase< R >::get_const_ptr(), SPxDevexPR::last, and SPxPricer::thesolver.
Referenced by SPxDevexPR::selectEnterX().
implementation of hyper sparse pricing in the entering Simplex
Definition at line 633 of file spxdevexpr.cpp.
References DIdxSet::addIdx(), SPxDevexPR::bestPricesCo, soplex::computePrice(), VectorBase< R >::get_const_ptr(), SPxSolver::id(), IdxSet::index(), soplex::infinity, SPxSolver::isInfeasibleCo, SPxDevexPR::last, SPxPricer::NOT_VIOLATED, IdxSet::remove(), IdxSet::size(), SPxSolver::test(), SPxPricer::thesolver, SPxSolver::updateViolsCo, SPxPricer::VIOLATED, SPxPricer::VIOLATED_AND_CHECKED, and SPxSolver::weights.
Referenced by SPxDevexPR::selectEnterX().
implementation of hyper sparse pricing in the entering Simplex
Definition at line 548 of file spxdevexpr.cpp.
References DIdxSet::addIdx(), SPxDevexPR::bestPrices, SPxSolver::coId(), soplex::computePrice(), SPxSolver::coTest(), SPxSolver::coWeights, VectorBase< R >::get_const_ptr(), IdxSet::index(), soplex::infinity, SPxSolver::isInfeasible, SPxDevexPR::last, SPxPricer::NOT_VIOLATED, IdxSet::remove(), IdxSet::size(), SPxPricer::thesolver, SPxSolver::updateViols, SPxPricer::VIOLATED, and SPxPricer::VIOLATED_AND_CHECKED.
Referenced by SPxDevexPR::selectEnterX().
implementation of sparse pricing in the entering Simplex
Definition at line 758 of file spxdevexpr.cpp.
References soplex::computePrice(), VectorBase< R >::dim(), VectorBase< R >::get_const_ptr(), SPxSolver::id(), IdxSet::index(), SPxSolver::infeasibilitiesCo, SPxSolver::isInfeasibleCo, SPxDevexPR::last, SPxPricer::NOT_VIOLATED, IdxSet::remove(), IdxSet::size(), SPxSolver::test(), SPxPricer::thesolver, and SPxSolver::weights.
Referenced by SPxDevexPR::selectEnterX().
implementation of sparse pricing in the entering Simplex (slack variables)
Definition at line 718 of file spxdevexpr.cpp.
References SPxSolver::coId(), soplex::computePrice(), SPxSolver::coTest(), SPxSolver::coWeights, VectorBase< R >::dim(), VectorBase< R >::get_const_ptr(), IdxSet::index(), SPxSolver::infeasibilities, SPxSolver::isInfeasible, SPxDevexPR::last, SPxPricer::NOT_VIOLATED, IdxSet::remove(), IdxSet::size(), and SPxPricer::thesolver.
Referenced by SPxDevexPR::selectEnterX().
choose the best entering index among columns and rows but prefer sparsity
Definition at line 503 of file spxdevexpr.cpp.
References SPxSolver::basis(), SPxDevexPR::bestPrices, SPxDevexPR::bestPricesCo, SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::buildBestPriceVectorEnterDim(), SPxSolver::hyperPricingEnter, SPxId::isValid(), SPxDevexPR::last, SPxBasis::lastUpdate(), SPxDevexPR::refined, SPxDevexPR::selectEnterDenseCoDim(), SPxDevexPR::selectEnterDenseDim(), SPxDevexPR::selectEnterHyperCoDim(), SPxDevexPR::selectEnterHyperDim(), SPxDevexPR::selectEnterSparseCoDim(), SPxDevexPR::selectEnterSparseDim(), IdxSet::size(), SPxSolver::sparsePricingEnter, SPxSolver::sparsePricingEnterCo, SPARSITY_TRADEOFF, and SPxPricer::thesolver.
Referenced by SPxDevexPR::selectEnter().
|
virtual |
Implements SPxPricer.
Definition at line 166 of file spxdevexpr.cpp.
References SPxSolver::basis(), SPxDevexPR::bestPrices, SPxDevexPR::buildBestPriceVectorLeave(), DEVEX_REFINETOL, SPxSolver::hyperPricingLeave, SPxBasis::lastUpdate(), MSG_INFO3, SPxDevexPR::refined, SPxDevexPR::selectLeaveHyper(), SPxDevexPR::selectLeaveSparse(), SPxDevexPR::selectLeaveX(), IdxSet::size(), SPxSolver::sparsePricingLeave, SPxSolver::spxout, SPxPricer::theeps, and SPxPricer::thesolver.
Referenced by SPxDevexPR::clone().
|
private |
implementation of hyper sparse pricing in the leaving Simplex
Definition at line 263 of file spxdevexpr.cpp.
References DIdxSet::addIdx(), SPxDevexPR::bestPrices, soplex::computePrice(), SPxSolver::coWeights, SPxSolver::fTest(), VectorBase< R >::get_const_ptr(), IdxSet::index(), soplex::infinity, SPxSolver::isInfeasible, SPxDevexPR::last, SPxPricer::NOT_VIOLATED, IdxSet::remove(), IdxSet::size(), SPxPricer::thesolver, SPxSolver::updateViols, SPxPricer::VIOLATED, and SPxPricer::VIOLATED_AND_CHECKED.
Referenced by SPxDevexPR::selectLeave().
|
private |
implementation of sparse pricing in the leaving Simplex
Definition at line 225 of file spxdevexpr.cpp.
References soplex::computePrice(), SPxSolver::coWeights, SPxSolver::fTest(), VectorBase< R >::get_const_ptr(), IdxSet::index(), SPxSolver::infeasibilities, SPxSolver::isInfeasible, SPxDevexPR::last, SPxPricer::NOT_VIOLATED, IdxSet::remove(), IdxSet::size(), SPxPricer::thesolver, SPxPricer::VIOLATED, and SPxPricer::VIOLATED_AND_CHECKED.
Referenced by SPxDevexPR::selectLeave().
|
private |
internal implementation of SPxPricer::selectLeave()
Definition at line 197 of file spxdevexpr.cpp.
References soplex::computePrice(), SPxSolver::coWeights, VectorBase< R >::dim(), SPxSolver::fTest(), VectorBase< R >::get_const_ptr(), SPxDevexPR::last, and SPxPricer::thesolver.
Referenced by SPxDevexPR::selectLeave().
|
virtual |
set row/column representation
Reimplemented from SPxPricer.
Definition at line 99 of file spxdevexpr.cpp.
References SPxDevexPR::addedCoVecs(), SPxDevexPR::addedVecs(), SPxSolver::coDim(), SPxSolver::dim(), SPxDevexPR::isConsistent(), and SPxPricer::thesolver.
Referenced by SPxDevexPR::clone(), SPxDevexPR::load(), SPxHybridPR::setRep(), and SPxAutoPR::setRep().
|
virtual |
set entering/leaving algorithm
Reimplemented from SPxPricer.
Definition at line 77 of file spxdevexpr.cpp.
References SPxDevexPR::bestPrices, SPxDevexPR::bestPricesCo, IdxSet::clear(), SPxSolver::coDim(), SPxSolver::dim(), SPxSolver::ENTER, SPxDevexPR::isConsistent(), SPxDevexPR::prices, SPxDevexPR::pricesCo, SPxDevexPR::refined, DataArray< T >::reMax(), DIdxSet::setMax(), SPxDevexPR::setupWeights(), and SPxPricer::thesolver.
Referenced by SPxDevexPR::clone().
|
private |
set entering/leaving algorithm
Definition at line 45 of file spxdevexpr.cpp.
References SPxSolver::coDim(), SPxSolver::coWeights, SPxSolver::dim(), SPxSolver::ENTER, DVectorBase< R >::reDim(), SPxPricer::thesolver, SPxSolver::weights, and SPxSolver::weightsAreSetup.
Referenced by SPxDevexPR::entered4(), and SPxDevexPR::setType().
|
private |
set of best pricing candidates
Definition at line 53 of file spxdevexpr.h.
Referenced by SPxDevexPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), SPxDevexPR::selectEnterHyperDim(), SPxDevexPR::selectEnterX(), SPxDevexPR::selectLeave(), SPxDevexPR::selectLeaveHyper(), and SPxDevexPR::setType().
|
private |
set of best pricing candidates
Definition at line 54 of file spxdevexpr.h.
Referenced by SPxDevexPR::buildBestPriceVectorEnterCoDim(), SPxDevexPR::selectEnterHyperCoDim(), SPxDevexPR::selectEnterX(), and SPxDevexPR::setType().
|
private |
penalty, selected at last iteration.
Definition at line 50 of file spxdevexpr.h.
Referenced by SPxDevexPR::entered4(), SPxDevexPR::operator=(), SPxDevexPR::selectEnterDenseCoDim(), SPxDevexPR::selectEnterDenseDim(), SPxDevexPR::selectEnterHyperCoDim(), SPxDevexPR::selectEnterHyperDim(), SPxDevexPR::selectEnterSparseCoDim(), SPxDevexPR::selectEnterSparseDim(), SPxDevexPR::selectEnterX(), SPxDevexPR::selectLeaveHyper(), SPxDevexPR::selectLeaveSparse(), and SPxDevexPR::selectLeaveX().
|
private |
temporary array of precomputed pricing values
Definition at line 51 of file spxdevexpr.h.
Referenced by SPxDevexPR::buildBestPriceVectorEnterDim(), SPxDevexPR::buildBestPriceVectorLeave(), and SPxDevexPR::setType().
|
private |
temporary array of precomputed pricing values
Definition at line 52 of file spxdevexpr.h.
Referenced by SPxDevexPR::buildBestPriceVectorEnterCoDim(), and SPxDevexPR::setType().
|
private |
has a refinement step already been tried?
Definition at line 55 of file spxdevexpr.h.
Referenced by SPxDevexPR::selectEnter(), SPxDevexPR::selectEnterX(), SPxDevexPR::selectLeave(), and SPxDevexPR::setType().