Weighted pricing.Class SPxWeightPR is an implemantation class of SPxPricer that uses weights for columns and rows for selecting the Simplex pivots. The weights are computed by methods computeCP() and computeRP() which may be overridden by derived classes. More...
#include <spxweightpr.h>
Public Member Functions | |
Construction / destruction | |
SPxWeightPR () | |
default constructor More... | |
SPxWeightPR (const SPxWeightPR &old) | |
copy constructor More... | |
SPxWeightPR & | operator= (const SPxWeightPR &rhs) |
assignment operator More... | |
virtual | ~SPxWeightPR () |
destructor More... | |
virtual SPxPricer * | clone () const |
clone function for polymorphism More... | |
Access / modification | |
virtual void | load (SPxSolver *base) |
sets the solver More... | |
void | setType (SPxSolver::Type tp) |
set entering/leaving algorithm More... | |
void | setRep (SPxSolver::Representation rep) |
set row/column representation More... | |
virtual int | selectLeave () |
virtual SPxId | selectEnter () |
virtual void | addedVecs (int n) |
n vectors have been added to the loaded LP. More... | |
virtual void | addedCoVecs (int n) |
n covectors have been added to the loaded LP. More... | |
virtual void | removedVec (int i) |
the i'th vector has been removed from the loaded LP. More... | |
virtual void | removedCoVec (int i) |
the i'th covector has been removed from the loaded LP. More... | |
virtual void | removedVecs (const int perm[]) |
n vectors have been removed from the loaded LP. More... | |
virtual void | removedCoVecs (const int perm[]) |
n covectors have been removed from the loaded LP. More... | |
Consistency check | |
virtual bool | isConsistent () const |
checks for consistency 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 | left4 (int, SPxId) |
performs leaving pivot. More... | |
virtual void | entered4 (SPxId, int) |
performs entering pivot. More... | |
virtual void | removedVecs (const int *) |
vectors given by perm have been 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 | computeLeavePenalty (int start, int end) |
compute leave penalties. More... | |
void | computeCP (int start, int end) |
compute weights for columns. More... | |
void | computeRP (int start, int end) |
compute weights for rows. More... | |
Private Attributes | |
Data | |
DVector | cPenalty |
column penalties More... | |
DVector | rPenalty |
row penalties More... | |
DVector | leavePenalty |
penalties for leaving alg More... | |
const Real * | penalty |
const Real * | coPenalty |
Real | objlength |
length of objective vector. 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... | |
Weighted pricing.
Class SPxWeightPR is an implemantation class of SPxPricer that uses weights for columns and rows for selecting the Simplex pivots. The weights are computed by methods computeCP() and computeRP() which may be overridden by derived classes.
The weights are interpreted as follows: The higher a value is, the more likely the corresponding row or column is set on one of its bounds.
See SPxPricer for a class documentation.
Definition at line 41 of file spxweightpr.h.
SPxWeightPR | ( | ) |
default constructor
Definition at line 79 of file spxweightpr.h.
Referenced by SPxWeightPR::clone().
SPxWeightPR | ( | const SPxWeightPR & | old | ) |
copy constructor
Definition at line 86 of file spxweightpr.h.
References SPxWeightPR::cPenalty, VectorBase< R >::get_const_ptr(), SPxWeightPR::penalty, and SPxWeightPR::rPenalty.
|
virtual |
destructor
Definition at line 136 of file spxweightpr.h.
|
virtual |
n
covectors have been added to the loaded LP.
Reimplemented from SPxPricer.
Definition at line 261 of file spxweightpr.cpp.
References SPxSolver::COLUMN, SPxWeightPR::computeCP(), SPxWeightPR::computeLeavePenalty(), SPxWeightPR::computeRP(), SPxWeightPR::cPenalty, VectorBase< R >::dim(), SPxSolver::LEAVE, SPxWeightPR::leavePenalty, DVectorBase< R >::reDim(), SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::clone().
|
virtual |
n
vectors have been added to the loaded LP.
Reimplemented from SPxPricer.
Definition at line 238 of file spxweightpr.cpp.
References SPxWeightPR::computeCP(), SPxWeightPR::computeLeavePenalty(), SPxWeightPR::computeRP(), SPxWeightPR::cPenalty, VectorBase< R >::dim(), SPxSolver::LEAVE, SPxWeightPR::leavePenalty, DVectorBase< R >::reDim(), SPxSolver::ROW, SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::clone().
|
virtual |
clone function for polymorphism
Implements SPxPricer.
Definition at line 139 of file spxweightpr.h.
References SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), SPxWeightPR::isConsistent(), SPxWeightPR::load(), SPxWeightPR::removedCoVec(), SPxWeightPR::removedCoVecs(), SPxWeightPR::removedVec(), SPxWeightPR::removedVecs(), SPxWeightPR::selectEnter(), SPxWeightPR::selectLeave(), SPxWeightPR::setRep(), SPxWeightPR::setType(), and SPxWeightPR::SPxWeightPR().
|
private |
compute weights for columns.
Definition at line 80 of file spxweightpr.cpp.
References ASSERT_WARN, SPxWeightPR::cPenalty, SPxPricer::epsilon(), SPxLPBase< R >::maxObj(), SPxWeightPR::objlength, and SPxPricer::solver().
Referenced by SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), and SPxWeightPR::load().
|
private |
compute leave penalties.
Definition at line 48 of file spxweightpr.cpp.
References SPxBasis::baseId(), SPxSolver::basis(), SPxWeightPR::cPenalty, SPxWeightPR::leavePenalty, SPxLPBase< R >::number(), SPxId::ROW_ID, SPxWeightPR::rPenalty, SPxPricer::solver(), and SPxPricer::thesolver.
Referenced by SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), and SPxWeightPR::setType().
|
private |
compute weights for rows.
Definition at line 63 of file spxweightpr.cpp.
References ASSERT_WARN, SPxPricer::epsilon(), SPxLPBase< R >::maxObj(), SPxWeightPR::objlength, SPxLPBase< R >::rowVector(), SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), and SPxWeightPR::load().
|
virtual |
checks for consistency
Reimplemented from SPxPricer.
Definition at line 376 of file spxweightpr.cpp.
References SPxWeightPR::cPenalty, VectorBase< R >::dim(), MSGinconsistent, SPxLPBase< R >::nCols(), SPxLPBase< R >::nRows(), SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::clone(), SPxWeightPR::selectEnter(), and SPxWeightPR::selectLeave().
|
virtual |
sets the solver
Reimplemented from SPxPricer.
Definition at line 89 of file spxweightpr.cpp.
References SPxWeightPR::computeCP(), SPxWeightPR::computeRP(), SPxWeightPR::cPenalty, SPxLPBase< R >::maxObj(), SPxLPBase< R >::nCols(), SPxLPBase< R >::nRows(), SPxWeightPR::objlength, DVectorBase< R >::reDim(), SPxWeightPR::rPenalty, SPxPricer::solver(), and SPxPricer::thesolver.
Referenced by SPxWeightPR::clone().
SPxWeightPR& operator= | ( | const SPxWeightPR & | rhs | ) |
assignment operator
Definition at line 109 of file spxweightpr.h.
References SPxWeightPR::cPenalty, VectorBase< R >::get_const_ptr(), SPxWeightPR::leavePenalty, SPxWeightPR::objlength, SPxPricer::operator=(), SPxWeightPR::penalty, and SPxWeightPR::rPenalty.
|
virtual |
the
i'th covector has been removed from the loaded LP.
Reimplemented from SPxPricer.
Definition at line 330 of file spxweightpr.cpp.
References SPxSolver::COLUMN, SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::clone().
|
virtual |
n
covectors have been removed from the loaded LP.
Definition at line 346 of file spxweightpr.cpp.
References SPxSolver::COLUMN, SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::clone().
|
virtual |
the
i'th vector has been removed from the loaded LP.
Reimplemented from SPxPricer.
Definition at line 284 of file spxweightpr.cpp.
References SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxSolver::ROW, SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::clone().
|
virtual |
n
vectors have been removed from the loaded LP.
Definition at line 300 of file spxweightpr.cpp.
References SPxWeightPR::cPenalty, VectorBase< R >::dim(), DVectorBase< R >::reDim(), SPxSolver::ROW, SPxWeightPR::rPenalty, and SPxPricer::solver().
Referenced by SPxWeightPR::clone().
|
virtual |
Implements SPxPricer.
Definition at line 130 of file spxweightpr.cpp.
References SPxSolver::basis(), SPxLPBase< R >::cId(), SPxBasis::Desc::colStatus(), SPxSolver::coTest(), SPxWeightPR::cPenalty, SPxBasis::Desc::D_FREE, SPxBasis::Desc::D_ON_BOTH, SPxBasis::Desc::D_ON_LOWER, SPxBasis::Desc::D_ON_UPPER, SPxBasis::Desc::D_UNDEFINED, SPxBasis::desc(), soplex::infinity, SPxWeightPR::isConsistent(), SPxBasis::Desc::P_FIXED, SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::rep(), SPxLPBase< R >::rId(), SPxSolver::ROW, SPxBasis::Desc::rowStatus(), SPxWeightPR::rPenalty, SPxPricer::solver(), SPxSolver::test(), and SPxPricer::theeps.
Referenced by SPxWeightPR::clone().
|
virtual |
Implements SPxPricer.
Definition at line 101 of file spxweightpr.cpp.
References SPxSolver::COLUMN, SPxSolver::dim(), SPxSolver::fTest(), VectorBase< R >::get_const_ptr(), soplex::infinity, SPxWeightPR::isConsistent(), SPxWeightPR::leavePenalty, SPxSolver::rep(), SPxPricer::solver(), SPxPricer::theeps, and SPxPricer::thesolver.
Referenced by SPxWeightPR::clone().
|
virtual |
set row/column representation
Reimplemented from SPxPricer.
Definition at line 25 of file spxweightpr.cpp.
References SPxWeightPR::coPenalty, SPxWeightPR::cPenalty, VectorBase< R >::get_const_ptr(), SPxWeightPR::penalty, SPxSolver::ROW, and SPxWeightPR::rPenalty.
Referenced by SPxWeightPR::clone().
|
virtual |
set entering/leaving algorithm
Reimplemented from SPxPricer.
Definition at line 39 of file spxweightpr.cpp.
References SPxWeightPR::computeLeavePenalty(), SPxSolver::dim(), SPxSolver::LEAVE, SPxWeightPR::leavePenalty, DVectorBase< R >::reDim(), and SPxPricer::thesolver.
Referenced by SPxWeightPR::clone().
|
private |
Definition at line 57 of file spxweightpr.h.
Referenced by SPxWeightPR::setRep().
|
private |
column penalties
Definition at line 49 of file spxweightpr.h.
Referenced by SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), SPxWeightPR::computeCP(), SPxWeightPR::computeLeavePenalty(), SPxWeightPR::isConsistent(), SPxWeightPR::load(), SPxWeightPR::operator=(), SPxWeightPR::removedCoVec(), SPxWeightPR::removedCoVecs(), SPxWeightPR::removedVec(), SPxWeightPR::removedVecs(), SPxWeightPR::selectEnter(), SPxWeightPR::setRep(), and SPxWeightPR::SPxWeightPR().
|
private |
penalties for leaving alg
Definition at line 53 of file spxweightpr.h.
Referenced by SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), SPxWeightPR::computeLeavePenalty(), SPxWeightPR::operator=(), SPxWeightPR::selectLeave(), and SPxWeightPR::setType().
|
private |
length of objective vector.
Definition at line 59 of file spxweightpr.h.
Referenced by SPxWeightPR::computeCP(), SPxWeightPR::computeRP(), SPxWeightPR::load(), and SPxWeightPR::operator=().
|
private |
Definition at line 55 of file spxweightpr.h.
Referenced by SPxWeightPR::operator=(), SPxWeightPR::setRep(), and SPxWeightPR::SPxWeightPR().
|
private |
row penalties
Definition at line 51 of file spxweightpr.h.
Referenced by SPxWeightPR::addedCoVecs(), SPxWeightPR::addedVecs(), SPxWeightPR::computeLeavePenalty(), SPxWeightPR::computeRP(), SPxWeightPR::isConsistent(), SPxWeightPR::load(), SPxWeightPR::operator=(), SPxWeightPR::removedCoVec(), SPxWeightPR::removedCoVecs(), SPxWeightPR::removedVec(), SPxWeightPR::removedVecs(), SPxWeightPR::selectEnter(), SPxWeightPR::setRep(), and SPxWeightPR::SPxWeightPR().