Abstract pricer base class.Class SPxPricer is a pure virtual class defining the interface for pricer classes to be used by SoPlex. The pricer's task is to select a vector to enter or leave the simplex basis, depending on the chosen simplex type. More...
#include <spxpricer.h>
Classes | |
struct | IdxCompare |
Compare class to sort idx/val pairs, used for hypersparse pricing leaving. More... | |
struct | IdxElement |
Public Types | |
enum | ViolationType { NOT_VIOLATED = 0, VIOLATED = 1, VIOLATED_AND_CHECKED = 2 } |
Public Member Functions | |
Initialization | |
virtual const char * | getName () const |
get name of pricer. More... | |
virtual void | load (SPxSolverBase< R > *p_solver) |
loads LP. More... | |
virtual void | clear () |
unloads LP. More... | |
virtual SPxSolverBase< R > * | solver () const |
returns loaded SPxSolverBase object. More... | |
virtual R | epsilon () const |
returns violation bound theeps. More... | |
virtual void | setEpsilon (R eps) |
sets violation bound. More... | |
virtual void | setType (typename SPxSolverBase< R >::Type) |
sets pricing type. More... | |
virtual void | setRep (typename SPxSolverBase< R >::Representation) |
sets basis representation. More... | |
Pivoting | |
virtual int | selectLeave ()=0 |
returns selected index to leave basis. More... | |
virtual void | left4 (int, SPxId) |
performs leaving pivot. More... | |
virtual SPxId | selectEnter ()=0 |
selects Id to enter basis. More... | |
virtual void | entered4 (SPxId, int) |
performs entering pivot. More... | |
Extension | |
virtual void | addedVecs (int) |
n vectors have been added to loaded LP. More... | |
virtual void | addedCoVecs (int) |
n covectors have been added to loaded LP. More... | |
Shrinking | |
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... | |
Debugging | |
virtual bool | isConsistent () const |
Constructors / Destructors | |
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... | |
virtual SPxPricer * | clone () const =0 |
clone function for polymorphism More... | |
Protected Attributes | |
IdxCompare | compare |
Data | |
const char * | m_name |
name of the pricer More... | |
SPxSolverBase< R > * | thesolver |
the solver More... | |
R | theeps |
violation bound More... | |
Abstract pricer base class.
Class SPxPricer is a pure virtual class defining the interface for pricer classes to be used by SoPlex. The pricer's task is to select a vector to enter or leave the simplex basis, depending on the chosen simplex type.
An SPxPricer first loads the SoPlex object for which pricing is to be performed. Then, depending of the SPxSolverBase<R>::Type, methods selectEnter() and entered4() (for entering Simplex) or selectLeave() and left4() (for leaving Simplex) are called by SoPlex. The SPxPricer object is informed of a change of the SPxSolverBase<R>::Type by calling method setType().
Definition at line 47 of file spxpricer.h.
enum ViolationType |
Enumerator | |
---|---|
NOT_VIOLATED | |
VIOLATED | |
VIOLATED_AND_CHECKED |
Definition at line 96 of file spxpricer.h.
|
explicit |
constructor
Definition at line 266 of file spxpricer.h.
copy constructor
Definition at line 273 of file spxpricer.h.
|
virtual |
destructor.
Definition at line 294 of file spxpricer.h.
References SPxPricer< R >::clone(), and SPxPricer< R >::thesolver.
|
virtual |
n
covectors have been added to loaded LP.
Reimplemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxDevexPR< R >, and SPxHybridPR< R >.
Definition at line 228 of file spxpricer.h.
|
virtual |
n
vectors have been added to loaded LP.
Reimplemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxDevexPR< R >, and SPxHybridPR< R >.
Definition at line 225 of file spxpricer.h.
|
virtual |
unloads LP.
Reimplemented in SPxSteepPR< R >, SPxAutoPR< R >, and SPxHybridPR< R >.
Definition at line 121 of file spxpricer.h.
References SPxPricer< R >::thesolver.
|
pure virtual |
clone function for polymorphism
Implemented in SPxHybridPR< R >, SPxSteepPR< R >, SPxWeightPR< R >, SPxParMultPR< R >, SPxDevexPR< R >, SPxAutoPR< R >, SPxDantzigPR< R >, and SPxSteepExPR< R >.
Referenced by SPxPricer< R >::~SPxPricer().
|
virtual |
performs entering pivot.
Method entered4() is called after each simplex iteration in ENTER mode. It informs the SPxPricer that variable id
has entered at the n
'th position. When being called, all vectors of SoPlex involved in such an entering update are setup correctly and may be accessed via the corresponding methods (fVec(), pVec(), etc.). In general, argument id
will be the one returned by the SPxPricer at the previous call to selectEnter(). However, one can not rely on this.
Reimplemented in SPxSteepPR< R >, SPxDevexPR< R >, SPxAutoPR< R >, and SPxHybridPR< R >.
Definition at line 216 of file spxpricer.h.
|
virtual |
returns violation bound theeps.
Definition at line 133 of file spxpricer.h.
References SPxPricer< R >::theeps.
|
virtual |
|
virtual |
Reimplemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxDevexPR< R >, and SPxHybridPR< R >.
Definition at line 252 of file spxpricer.h.
References SPxPricer< R >::thesolver.
Referenced by SPxPricer< R >::operator=().
|
virtual |
performs leaving pivot.
Method left4() is called after each simplex iteration in LEAVE mode. It informs the SPxPricer that the n
'th variable has left the basis for id
to come in at this position. When being called, all vectors of SoPlex involved in such an entering update are setup correctly and may be accessed via the corresponding methods (fVec(), pVec(), etc.). In general, argument n
will be the one returned by the SPxPricer at the previous call to selectLeave(). However, one can not rely on this.
Reimplemented in SPxSteepPR< R >, SPxDevexPR< R >, SPxAutoPR< R >, and SPxHybridPR< R >.
Definition at line 188 of file spxpricer.h.
References SPxPricer< R >::selectEnter().
|
virtual |
loads LP.
Loads the solver and LP for which pricing steps are to be performed.
Reimplemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxParMultPR< R >, SPxDevexPR< R >, SPxAutoPR< R >, and SPxHybridPR< R >.
Definition at line 115 of file spxpricer.h.
References SPxPricer< R >::thesolver.
assignment operator
Definition at line 280 of file spxpricer.h.
References SPxPricer< R >::isConsistent(), SPxPricer< R >::m_name, SPxPricer< R >::theeps, and SPxPricer< R >::thesolver.
Referenced by SPxDantzigPR< R >::operator=(), SPxAutoPR< R >::operator=(), SPxParMultPR< R >::operator=(), SPxWeightPR< R >::operator=(), SPxDevexPR< R >::operator=(), SPxHybridPR< R >::operator=(), and SPxSteepPR< R >::operator=().
|
virtual |
covector i
was removed from loaded LP.
Reimplemented in SPxSteepPR< R >, and SPxWeightPR< R >.
Definition at line 242 of file spxpricer.h.
|
virtual |
covectors given by perm
have been removed from loaded LP.
Definition at line 245 of file spxpricer.h.
|
virtual |
vector i
was removed from loaded LP.
Reimplemented in SPxSteepPR< R >, and SPxWeightPR< R >.
Definition at line 236 of file spxpricer.h.
|
virtual |
vectors given by perm
have been removed from loaded LP.
Definition at line 239 of file spxpricer.h.
|
pure virtual |
selects Id to enter basis.
Selects the SPxId of a vector to enter the basis. The selected id, must not represent a basic index (i.e. solver()->isBasic(id) must be false). However, the corresponding test value needs not to be less than -epsilon(). If not, SoPlex will discard the pivot.
Note: When method selectEnter() is called by the loaded SoPlex object, all values from coTest() are up to date. However, whether the elements of test() are up to date depends on the SPxSolverBase<R>::Pricing type.
Implemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxDevexPR< R >, SPxParMultPR< R >, SPxAutoPR< R >, SPxDantzigPR< R >, and SPxHybridPR< R >.
Referenced by SPxPricer< R >::left4().
|
pure virtual |
returns selected index to leave basis.
Selects the index of a vector to leave the basis. The selected index i, say, must be in the range 0 <= i < solver()->dim() and its tested value must fullfill solver()->test()[i] < -epsilon().
Implemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxDevexPR< R >, SPxParMultPR< R >, SPxAutoPR< R >, SPxDantzigPR< R >, and SPxHybridPR< R >.
Referenced by SPxPricer< R >::setRep().
|
virtual |
sets violation bound.
Inequality violations are accepted, if their size is less than eps
.
Reimplemented in SPxAutoPR< R >, and SPxHybridPR< R >.
Definition at line 141 of file spxpricer.h.
|
virtual |
sets basis representation.
Informs pricer about (a change of) the loaded SoPlex's Representation.
Reimplemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxDevexPR< R >, SPxAutoPR< R >, and SPxHybridPR< R >.
Definition at line 163 of file spxpricer.h.
References SPxPricer< R >::selectLeave().
|
virtual |
sets pricing type.
Informs pricer about (a change of) the loaded SoPlex's Type. In the sequel, only the corresponding select methods may be called.
Reimplemented in SPxSteepPR< R >, SPxWeightPR< R >, SPxParMultPR< R >, SPxDevexPR< R >, SPxAutoPR< R >, and SPxHybridPR< R >.
Definition at line 152 of file spxpricer.h.
References SPxPricer< R >::thesolver.
|
virtual |
returns loaded SPxSolverBase object.
Definition at line 127 of file spxpricer.h.
References SPxPricer< R >::thesolver.
Referenced by SPxParMultPR< R >::clone().
|
protected |
Definition at line 91 of file spxpricer.h.
|
protected |
name of the pricer
Definition at line 55 of file spxpricer.h.
Referenced by SPxPricer< R >::getName(), and SPxPricer< R >::operator=().
|
protected |
violation bound
Definition at line 61 of file spxpricer.h.
Referenced by SPxPricer< R >::epsilon(), and SPxPricer< R >::operator=().
|
protected |
the solver
Definition at line 59 of file spxpricer.h.
Referenced by SPxPricer< R >::clear(), SPxPricer< R >::isConsistent(), SPxPricer< R >::load(), SPxPricer< R >::operator=(), SPxPricer< R >::setType(), SPxPricer< R >::solver(), and SPxPricer< R >::~SPxPricer().