Weighted start basis.Class SPxWeightST is an implementation of a SPxStarter for generating a Simplex starting basis. Using method setupWeights() it sets up arrays weight and coWeight, or equivalently rowWeight and colWeight. (rowWeight and colWeight are just pointers initialized to weight and coWeight according to the representation of SoPlex base
passed to method generate().)
More...
#include <spxweightst.h>
Public Member Functions | |
Construction / destruction | |
SPxWeightST () | |
default constructor. More... | |
SPxWeightST (const SPxWeightST &old) | |
copy constructor More... | |
SPxWeightST & | operator= (const SPxWeightST &rhs) |
assignment operator More... | |
virtual | ~SPxWeightST () |
destructor. More... | |
virtual SPxStarter * | clone () const |
clone function for polymorphism More... | |
Generation of a start basis | |
void | generate (SPxSolver &base) |
generates start basis for loaded basis. More... | |
Debugging | |
virtual bool | isConsistent () const |
consistency check. More... | |
Public Member Functions inherited from SPxStarter | |
virtual const char * | getName () const |
get name of starter. More... | |
SPxStarter (const char *name) | |
constructor More... | |
SPxStarter (const SPxStarter &old) | |
copy constructor More... | |
SPxStarter & | operator= (const SPxStarter &rhs) |
assignment operator More... | |
virtual | ~SPxStarter () |
destructor. More... | |
Protected Member Functions | |
Protected helpers | |
virtual void | setupWeights (SPxSolver &base) |
sets up variable weights. More... | |
Protected Attributes | |
Protected data | |
DataArray< Real > | rowWeight |
weight value for LP rows. More... | |
DataArray< Real > | colWeight |
weight value for LP columns. More... | |
DataArray< bool > | rowRight |
set variable to rhs?. More... | |
DataArray< bool > | colUp |
set primal variable to upper bound. More... | |
Protected Attributes inherited from SPxStarter | |
const char * | m_name |
name of the starter More... | |
Private Member Functions | |
Private helpers | |
void | setPrimalStatus (SPxBasis::Desc &, const SPxSolver &, const SPxId &) |
Private Attributes | |
Private data | |
DataArray< int > | forbidden |
DataArray< Real > * | weight |
DataArray< Real > * | coWeight |
Weighted start basis.
Class SPxWeightST is an implementation of a SPxStarter for generating a Simplex starting basis. Using method setupWeights() it sets up arrays weight and coWeight, or equivalently rowWeight and colWeight. (rowWeight and colWeight are just pointers initialized to weight and coWeight according to the representation of SoPlex base
passed to method generate().)
The weight values are then used to setup a starting basis for the LP: vectors with low values are likely to become dual (i.e. basic for a column basis) and such with high values are likely to become primal (i.e. nonbasic for a column basis).
However, if a variable having an upper and lower bound is to become primal, there is still a choice for setting it either to its upper or lower bound. Members rowRight and colUp are used to determine where to set a primal variable. If rowRight[i] is set to a nonzero value, the right-hand side inequality is set tightly for the i
'th to become primal. Analogously, If colUp[j] is nonzero, the j
'th variable will be set to its upper bound if it becomes primal.
Definition at line 56 of file spxweightst.h.
SPxWeightST | ( | ) |
default constructor.
Definition at line 110 of file spxweightst.h.
References SPxWeightST::isConsistent().
Referenced by SPxWeightST::clone().
SPxWeightST | ( | const SPxWeightST & | old | ) |
copy constructor
Definition at line 118 of file spxweightst.h.
References SPxWeightST::colWeight, SPxWeightST::isConsistent(), SPxWeightST::rowWeight, and SPxWeightST::weight.
|
virtual |
destructor.
Definition at line 175 of file spxweightst.h.
|
virtual |
clone function for polymorphism
Implements SPxStarter.
Reimplemented in SPxVectorST, and SPxSumST.
Definition at line 181 of file spxweightst.h.
References SPxWeightST::generate(), SPxWeightST::isConsistent(), and SPxWeightST::SPxWeightST().
|
virtual |
generates start basis for loaded basis.
Implements SPxStarter.
Definition at line 216 of file spxweightst.cpp.
References SPxSolver::coDim(), SPxSolver::coId(), SPxBasis::Desc::colStatus(), SPxSolver::COLUMN, SPxWeightST::colUp, SPxWeightST::colWeight, SPxSolver::coVector(), SPxWeightST::coWeight, VectorBase< R >::dim(), SPxSolver::dim(), EPS, SPxWeightST::forbidden, SVectorBase< R >::index(), soplex::infinity, SPxSolver::init(), soplex::initPrefs(), SPxSolver::loadBasis(), SPxLPBase< R >::lower(), SVectorBase< R >::maxAbs(), SPxLPBase< R >::maxObj(), MSG_DEBUG, SPxLPBase< R >::nCols(), SPxLPBase< R >::nRows(), SPxLPBase< R >::number(), SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::pVec(), SPxSolver::rep(), DataArray< T >::reSize(), SPxId::ROW_ID, SPxWeightST::rowRight, SPxWeightST::rowWeight, soplex::setDualStatus(), SPxWeightST::setPrimalStatus(), SPxWeightST::setupWeights(), SVectorBase< R >::size(), DataArray< T >::size(), soplex::spxAbs(), STABLE, SPxLPBase< R >::upper(), SVectorBase< R >::value(), SPxSolver::vector(), and SPxWeightST::weight.
Referenced by SPxWeightST::clone().
|
virtual |
consistency check.
Reimplemented from SPxStarter.
Definition at line 31 of file spxweightst.cpp.
References SPxWeightST::colUp, SPxWeightST::colWeight, DataArray< T >::isConsistent(), SPxWeightST::rowRight, and SPxWeightST::rowWeight.
Referenced by SPxWeightST::clone(), SPxSumST::operator=(), SPxVectorST::operator=(), SPxWeightST::operator=(), SPxSumST::SPxSumST(), SPxVectorST::SPxVectorST(), and SPxWeightST::SPxWeightST().
SPxWeightST& operator= | ( | const SPxWeightST & | rhs | ) |
assignment operator
Definition at line 145 of file spxweightst.h.
References SPxWeightST::colUp, SPxWeightST::colWeight, SPxWeightST::forbidden, SPxWeightST::isConsistent(), SPxStarter::operator=(), SPxWeightST::rowRight, SPxWeightST::rowWeight, and SPxWeightST::weight.
Referenced by SPxVectorST::operator=().
|
private |
Definition at line 62 of file spxweightst.cpp.
References SPxBasis::Desc::colStatus(), SPxWeightST::colUp, SPxSolver::epsilon(), soplex::infinity, SPxLPBase< R >::lhs(), SPxLPBase< R >::number(), SPxBasis::Desc::P_FIXED, SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxLPBase< R >::rhs(), SPxWeightST::rowRight, and SPxBasis::Desc::rowStatus().
Referenced by SPxWeightST::generate().
|
protectedvirtual |
sets up variable weights.
This method is called in order to setup the weights for all variables. It has been declared virtual
in order to allow for derived classes to compute other weight values.
Reimplemented in SPxVectorST, and SPxSumST.
Definition at line 431 of file spxweightst.cpp.
References SPxWeightST::colUp, SPxLPBase< R >::colVector(), SPxWeightST::colWeight, SPxSolver::epsilon(), soplex::infinity, SPxLPBase< R >::lhs(), SPxLPBase< R >::lower(), VectorBase< R >::maxAbs(), SPxLPBase< R >::maxObj(), MSG_DEBUG, SPxLPBase< R >::nCols(), SPxLPBase< R >::nRows(), SPxSolver::rep(), SPxLPBase< R >::rhs(), SPxWeightST::rowRight, SPxLPBase< R >::rowVector(), SPxWeightST::rowWeight, soplex::spxAbs(), SPxSolver::type(), and SPxLPBase< R >::upper().
Referenced by SPxWeightST::generate(), and SPxVectorST::setupWeights().
|
protected |
set primal variable to upper bound.
Definition at line 90 of file spxweightst.h.
Referenced by SPxWeightST::generate(), SPxWeightST::isConsistent(), SPxWeightST::operator=(), SPxWeightST::setPrimalStatus(), SPxVectorST::setupWeights(), and SPxWeightST::setupWeights().
weight value for LP columns.
Definition at line 86 of file spxweightst.h.
Referenced by SPxWeightST::generate(), SPxWeightST::isConsistent(), SPxWeightST::operator=(), SPxVectorST::setupWeights(), SPxWeightST::setupWeights(), and SPxWeightST::SPxWeightST().
Definition at line 68 of file spxweightst.h.
Referenced by SPxWeightST::generate().
|
private |
Definition at line 64 of file spxweightst.h.
Referenced by SPxWeightST::generate(), and SPxWeightST::operator=().
|
protected |
set variable to rhs?.
Definition at line 88 of file spxweightst.h.
Referenced by SPxWeightST::generate(), SPxWeightST::isConsistent(), SPxWeightST::operator=(), SPxWeightST::setPrimalStatus(), SPxVectorST::setupWeights(), and SPxWeightST::setupWeights().
weight value for LP rows.
Definition at line 84 of file spxweightst.h.
Referenced by SPxWeightST::generate(), SPxWeightST::isConsistent(), SPxWeightST::operator=(), SPxVectorST::setupWeights(), SPxWeightST::setupWeights(), and SPxWeightST::SPxWeightST().
Definition at line 66 of file spxweightst.h.
Referenced by SPxWeightST::generate(), SPxWeightST::operator=(), and SPxWeightST::SPxWeightST().