Equilibrium row/column scaling.This SPxScaler implementation performs equilibrium scaling of the LPs rows and columns. More...
#include <spxequilisc.h>
Public Member Functions | |
Construction / destruction | |
SPxEquiliSC (bool doBoth=true) | |
default constructor (this scaler makes no use of inherited member m_colFirst) More... | |
SPxEquiliSC (const SPxEquiliSC &old) | |
copy constructor More... | |
SPxEquiliSC & | operator= (const SPxEquiliSC &) |
assignment operator More... | |
virtual | ~SPxEquiliSC () |
destructor More... | |
virtual SPxScaler * | clone () const override |
clone function for polymorphism More... | |
Scaling | |
virtual void | scale (SPxLPBase< Real > &lp, bool persistent=false) override |
Scale the loaded SPxLP. More... | |
Public Member Functions inherited from SPxScaler | |
virtual int | computeScaleExp (const SVector &vec, const DataArray< int > &oldScaleExp) const |
compute a single scaling vector , e.g. of a newly added row More... | |
virtual int | computeScaleExp (const SVectorBase< Rational > &vec, const DataArray< int > &oldScaleExp) const |
virtual void | applyScaling (SPxLPBase< Real > &lp) |
applies m_colscale and m_rowscale to the lp . More... | |
SPxScaler (const char *name, bool colFirst=false, bool doBoth=true, SPxOut *spxout=NULL) | |
constructor More... | |
SPxScaler (const SPxScaler &) | |
copy constructor More... | |
SPxScaler & | operator= (const SPxScaler &) |
assignment operator More... | |
virtual | ~SPxScaler () |
destructor. More... | |
virtual const char * | getName () const |
get name of scaler More... | |
virtual void | setOrder (bool colFirst) |
set scaling order More... | |
virtual void | setBoth (bool both) |
set wether column and row scaling should be performed More... | |
virtual void | setOutstream (SPxOut &newOutstream) |
set message handler More... | |
virtual void | setRealParam (Real param, const char *name="realparam") |
set real parameter More... | |
virtual void | setIntParam (int param, const char *name="intparam") |
set int parameter More... | |
virtual void | unscale (SPxLPBase< Real > &lp) |
unscale SPxLP More... | |
virtual int | getColScaleExp (int i) const |
returns scaling factor for column i More... | |
virtual int | getRowScaleExp (int i) const |
returns scaling factor for row i More... | |
virtual void | getColUnscaled (const SPxLPBase< Real > &lp, int i, DSVector &vec) const |
gets unscaled column i More... | |
virtual Real | getColMaxAbsUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns maximum absolute value of unscaled column i More... | |
virtual Real | getColMinAbsUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns minumum absolute value of unscaled column i More... | |
virtual Real | upperUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns unscaled upper bound i More... | |
virtual void | getUpperUnscaled (const SPxLPBase< Real > &lp, Vector &vec) const |
returns unscaled upper bound vector of lp More... | |
virtual Real | lowerUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns unscaled lower bound i More... | |
virtual void | getLowerUnscaled (const SPxLPBase< Real > &lp, Vector &vec) const |
gets unscaled lower bound vector More... | |
virtual Real | maxObjUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns unscaled objective function coefficient of i More... | |
virtual void | getMaxObjUnscaled (const SPxLPBase< Real > &lp, Vector &vec) const |
gets unscaled objective function More... | |
virtual void | getRowUnscaled (const SPxLPBase< Real > &lp, int i, DSVector &vec) const |
returns unscaled row i More... | |
virtual Real | getRowMaxAbsUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns maximum absolute value of unscaled row i More... | |
virtual Real | getRowMinAbsUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns minimum absolute value of unscaled row i More... | |
virtual Real | rhsUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns unscaled right hand side i More... | |
virtual void | getRhsUnscaled (const SPxLPBase< Real > &lp, Vector &vec) const |
gets unscaled right hand side vector More... | |
virtual Real | lhsUnscaled (const SPxLPBase< Real > &lp, int i) const |
returns unscaled left hand side i of lp More... | |
virtual void | getLhsUnscaled (const SPxLPBase< Real > &lp, Vector &vec) const |
returns unscaled left hand side vector of lp More... | |
virtual Real | getCoefUnscaled (const SPxLPBase< Real > &lp, int row, int col) const |
returns unscaled coefficient of lp More... | |
virtual void | unscalePrimal (const SPxLPBase< Real > &lp, Vector &x) const |
unscale dense primal solution vector given in x . More... | |
virtual void | unscaleSlacks (const SPxLPBase< Real > &lp, Vector &s) const |
unscale dense slack vector given in s . More... | |
virtual void | unscaleDual (const SPxLPBase< Real > &lp, Vector &pi) const |
unscale dense dual solution vector given in pi . More... | |
virtual void | unscaleRedCost (const SPxLPBase< Real > &lp, Vector &r) const |
unscale dense reduced cost vector given in r . More... | |
virtual void | unscalePrimalray (const SPxLPBase< Real > &lp, Vector &ray) const |
unscale primal ray given in ray . More... | |
virtual void | unscaleDualray (const SPxLPBase< Real > &lp, Vector &ray) const |
unscale dual ray given in ray . More... | |
virtual void | scaleObj (const SPxLPBase< Real > &lp, VectorReal &origObj) const |
apply scaling to objective function vector origObj . More... | |
virtual Real | scaleObj (const SPxLPBase< Real > &lp, int i, Real origObj) const |
returns scaled objective function coefficient origObj . More... | |
virtual Real | scaleElement (const SPxLPBase< Real > &lp, int row, int col, Real val) const |
returns scaled LP element in row and col . More... | |
virtual Real | scaleLower (const SPxLPBase< Real > &lp, int col, Real lower) const |
returns scaled lower bound of column col . More... | |
virtual Real | scaleUpper (const SPxLPBase< Real > &lp, int col, Real upper) const |
returns scaled upper bound of column col . More... | |
virtual Real | scaleLhs (const SPxLPBase< Real > &lp, int row, Real lhs) const |
returns scaled left hand side of row row . More... | |
virtual Real | scaleRhs (const SPxLPBase< Real > &lp, int row, Real rhs) const |
returns scaled right hand side of row row . More... | |
virtual Real | minAbsColscale () const |
absolute smallest column scaling factor More... | |
virtual Real | maxAbsColscale () const |
absolute biggest column scaling factor More... | |
virtual Real | minAbsRowscale () const |
absolute smallest row scaling factor More... | |
virtual Real | maxAbsRowscale () const |
absolute biggest row scaling factor More... | |
virtual Real | maxColRatio (const SPxLPBase< Real > &lp) const |
maximum ratio between absolute biggest and smallest element in any column. More... | |
virtual Real | maxRowRatio (const SPxLPBase< Real > &lp) const |
maximum ratio between absolute biggest and smallest element in any row. More... | |
void | computeExpVec (const std::vector< Real > &vec, DataArray< int > &vecExp) |
round vector entries to power of 2 More... | |
virtual bool | isConsistent () const |
consistency check More... | |
Static Public Member Functions | |
static void | computeEquiExpVec (const SVSet *vecset, const DataArray< int > &coScaleExp, DataArray< int > &scaleExp) |
compute equilibrium scaling vector rounded to power of two More... | |
static void | computeEquiExpVec (const SVSet *vecset, const std::vector< Real > &coScaleVal, DataArray< int > &scaleExp) |
compute equilibrium scaling vector rounded to power of two More... | |
static void | computePostequiExpVecs (const SPxLPBase< Real > &lp, const std::vector< Real > &preRowscale, const std::vector< Real > &preColscale, DataArray< int > &rowscaleExp, DataArray< int > &colscaleExp) |
compute equilibrium scaling rounded to power of 2 for existing Real scaling factors (preRowscale, preColscale) More... | |
Additional Inherited Members | |
Protected Member Functions inherited from SPxScaler | |
virtual void | setup (SPxLPBase< Real > &lp) |
clear and setup scaling arrays in the LP More... | |
Protected Attributes inherited from SPxScaler | |
const char * | m_name |
Name of the scaler. More... | |
DataArray< int > * | m_activeColscaleExp |
pointer to currently active column scaling factors More... | |
DataArray< int > * | m_activeRowscaleExp |
pointer to currently active row scaling factors More... | |
bool | m_colFirst |
do column scaling first More... | |
bool | m_doBoth |
do columns and rows More... | |
SPxOut * | spxout |
message handler More... | |
Equilibrium row/column scaling.
This SPxScaler implementation performs equilibrium scaling of the LPs rows and columns.
Definition at line 35 of file spxequilisc.h.
|
explicit |
default constructor (this scaler makes no use of inherited member m_colFirst)
Definition at line 160 of file spxequilisc.cpp.
Referenced by SPxEquiliSC::clone().
SPxEquiliSC | ( | const SPxEquiliSC & | old | ) |
copy constructor
Definition at line 164 of file spxequilisc.cpp.
|
virtual |
destructor
Definition at line 60 of file spxequilisc.h.
|
overridevirtual |
clone function for polymorphism
Implements SPxScaler.
Definition at line 63 of file spxequilisc.h.
References SPxEquiliSC::scale(), and SPxEquiliSC::SPxEquiliSC().
|
static |
compute equilibrium scaling vector rounded to power of two
Definition at line 74 of file spxequilisc.cpp.
References soplex::GT(), SVectorBase< R >::index(), SVSetBase< R >::num(), SVectorBase< R >::size(), soplex::spxAbs(), soplex::spxFrexp(), soplex::spxLdexp(), and SVectorBase< R >::value().
Referenced by SPxEquiliSC::computePostequiExpVecs(), and SPxEquiliSC::scale().
|
static |
compute equilibrium scaling vector rounded to power of two
Definition at line 105 of file spxequilisc.cpp.
References soplex::GT(), SVectorBase< R >::index(), SVSetBase< R >::num(), SVectorBase< R >::size(), soplex::spxAbs(), soplex::spxFrexp(), and SVectorBase< R >::value().
|
static |
compute equilibrium scaling rounded to power of 2 for existing Real scaling factors (preRowscale, preColscale)
Definition at line 137 of file spxequilisc.cpp.
References LPColSetBase< R >::colSet(), SPxEquiliSC::computeEquiExpVec(), soplex::maxPrescaledRatio(), and LPRowSetBase< R >::rowSet().
Referenced by SPxGeometSC::scale().
SPxEquiliSC & operator= | ( | const SPxEquiliSC & | rhs | ) |
assignment operator
Definition at line 168 of file spxequilisc.cpp.
References SPxScaler::operator=().
Scale the loaded SPxLP.
Implements SPxScaler.
Definition at line 179 of file spxequilisc.cpp.
References SPxScaler::applyScaling(), LPColSetBase< R >::colSet(), SPxEquiliSC::computeEquiExpVec(), SPxScaler::m_activeColscaleExp, SPxScaler::m_activeRowscaleExp, SPxScaler::m_doBoth, SPxScaler::maxAbsColscale(), SPxLPBase< R >::maxAbsNzo(), SPxScaler::maxAbsRowscale(), SPxScaler::maxColRatio(), SPxScaler::maxRowRatio(), SPxScaler::minAbsColscale(), SPxLPBase< R >::minAbsNzo(), SPxScaler::minAbsRowscale(), MSG_INFO1, MSG_INFO2, MSG_INFO3, LPRowSetBase< R >::rowSet(), SPxScaler::setup(), and SPxScaler::spxout.
Referenced by SPxEquiliSC::clone().