Scippy

SoPlex

Sequential object-oriented simPlex

SPxEquiliSC< R > Class Template Reference

Equilibrium row/column scaling. 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...
 
SPxEquiliSCoperator= (const SPxEquiliSC &)
 assignment operator More...
 
virtual ~SPxEquiliSC ()
 destructor More...
 
virtual SPxScaler< R > * clone () const override
 clone function for polymorphism More...
 
Scaling
virtual void scale (SPxLPBase< R > &lp, bool persistent=false) override
 Scale the loaded SPxLP. More...
 
- Public Member Functions inherited from SPxScaler< R >
virtual int computeScaleExp (const SVectorBase< R > &vec, const DataArray< int > &oldScaleExp) const
 compute a single scaling vector , e.g. of a newly added row More...
 
virtual void applyScaling (SPxLPBase< R > &lp)
 applies m_colscale and m_rowscale to the lp. More...
 
 SPxScaler (const char *name, bool colFirst=false, bool doBoth=true, SPxOut *spxout=nullptr)
 constructor More...
 
 SPxScaler (const SPxScaler &)
 copy constructor More...
 
SPxScaleroperator= (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 (R param, const char *name="realparam")
 set R parameter More...
 
virtual void setIntParam (int param, const char *name="intparam")
 set int parameter More...
 
virtual void setTolerances (std::shared_ptr< Tolerances > &tolerances)
 set tolerances More...
 
const std::shared_ptr< Tolerancestolerances () const
 get the _tolerances member variable More...
 
virtual void unscale (SPxLPBase< R > &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< R > &lp, int i, DSVectorBase< R > &vec) const
 gets unscaled column i More...
 
virtual R getColMaxAbsUnscaled (const SPxLPBase< R > &lp, int i) const
 returns maximum absolute value of unscaled column i More...
 
virtual R getColMinAbsUnscaled (const SPxLPBase< R > &lp, int i) const
 returns minumum absolute value of unscaled column i More...
 
virtual R upperUnscaled (const SPxLPBase< R > &lp, int i) const
 returns unscaled upper bound i More...
 
virtual void getUpperUnscaled (const SPxLPBase< R > &lp, VectorBase< R > &vec) const
 returns unscaled upper bound vector of lp More...
 
virtual R lowerUnscaled (const SPxLPBase< R > &lp, int i) const
 returns unscaled lower bound i More...
 
virtual void getLowerUnscaled (const SPxLPBase< R > &lp, VectorBase< R > &vec) const
 gets unscaled lower bound vector More...
 
virtual R maxObjUnscaled (const SPxLPBase< R > &lp, int i) const
 returns unscaled objective function coefficient of i More...
 
virtual void getMaxObjUnscaled (const SPxLPBase< R > &lp, VectorBase< R > &vec) const
 gets unscaled objective function More...
 
virtual void getRowUnscaled (const SPxLPBase< R > &lp, int i, DSVectorBase< R > &vec) const
 returns unscaled row i More...
 
virtual R getRowMaxAbsUnscaled (const SPxLPBase< R > &lp, int i) const
 returns maximum absolute value of unscaled row i More...
 
virtual R getRowMinAbsUnscaled (const SPxLPBase< R > &lp, int i) const
 returns minimum absolute value of unscaled row i More...
 
virtual R rhsUnscaled (const SPxLPBase< R > &lp, int i) const
 returns unscaled right hand side i More...
 
virtual void getRhsUnscaled (const SPxLPBase< R > &lp, VectorBase< R > &vec) const
 gets unscaled right hand side vector More...
 
virtual R lhsUnscaled (const SPxLPBase< R > &lp, int i) const
 returns unscaled left hand side i of lp More...
 
virtual void getLhsUnscaled (const SPxLPBase< R > &lp, VectorBase< R > &vec) const
 returns unscaled left hand side vector of lp More...
 
virtual R getCoefUnscaled (const SPxLPBase< R > &lp, int row, int col) const
 returns unscaled coefficient of lp More...
 
virtual void unscalePrimal (const SPxLPBase< R > &lp, VectorBase< R > &x) const
 unscale dense primal solution vector given in x. More...
 
virtual void unscaleSlacks (const SPxLPBase< R > &lp, VectorBase< R > &s) const
 unscale dense slack vector given in s. More...
 
virtual void unscaleDual (const SPxLPBase< R > &lp, VectorBase< R > &pi) const
 unscale dense dual solution vector given in pi. More...
 
virtual void unscaleRedCost (const SPxLPBase< R > &lp, VectorBase< R > &r) const
 unscale dense reduced cost vector given in r. More...
 
virtual void unscalePrimalray (const SPxLPBase< R > &lp, VectorBase< R > &ray) const
 unscale primal ray given in ray. More...
 
virtual void unscaleDualray (const SPxLPBase< R > &lp, VectorBase< R > &ray) const
 unscale dual ray given in ray. More...
 
virtual void scaleObj (const SPxLPBase< R > &lp, VectorBase< R > &origObj) const
 apply scaling to objective function vector origObj. More...
 
virtual R scaleObj (const SPxLPBase< R > &lp, int i, R origObj) const
 returns scaled objective function coefficient origObj. More...
 
virtual R scaleElement (const SPxLPBase< R > &lp, int row, int col, R val) const
 returns scaled LP element in row and col. More...
 
virtual R scaleLower (const SPxLPBase< R > &lp, int col, R lower) const
 returns scaled lower bound of column col. More...
 
virtual R scaleUpper (const SPxLPBase< R > &lp, int col, R upper) const
 returns scaled upper bound of column col. More...
 
virtual R scaleLhs (const SPxLPBase< R > &lp, int row, R lhs) const
 returns scaled left hand side of row row. More...
 
virtual R scaleRhs (const SPxLPBase< R > &lp, int row, R rhs) const
 returns scaled right hand side of row row. More...
 
virtual R minAbsColscale () const
 absolute smallest column scaling factor More...
 
virtual R maxAbsColscale () const
 absolute biggest column scaling factor More...
 
virtual R minAbsRowscale () const
 absolute smallest row scaling factor More...
 
virtual R maxAbsRowscale () const
 absolute biggest row scaling factor More...
 
virtual R maxColRatio (const SPxLPBase< R > &lp) const
 maximum ratio between absolute biggest and smallest element in any column. More...
 
virtual R maxRowRatio (const SPxLPBase< R > &lp) const
 maximum ratio between absolute biggest and smallest element in any row. More...
 
void computeExpVec (const std::vector< R > &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 SVSetBase< R > *vecset, const DataArray< int > &coScaleExp, DataArray< int > &scaleExp, R epsilon)
 compute equilibrium scaling vector rounded to power of two More...
 
static void computeEquiExpVec (const SVSetBase< R > *vecset, const std::vector< R > &coScaleVal, DataArray< int > &scaleExp, R epsilon)
 compute equilibrium scaling vector rounded to power of two More...
 
static void computePostequiExpVecs (const SPxLPBase< R > &lp, const std::vector< R > &preRowscale, const std::vector< R > &preColscale, DataArray< int > &rowscaleExp, DataArray< int > &colscaleExp, R epsilon)
 compute equilibrium scaling rounded to power of 2 for existing R scaling factors (preRowscale, preColscale) More...
 

Additional Inherited Members

- Protected Member Functions inherited from SPxScaler< R >
virtual void setup (SPxLPBase< R > &lp)
 clear and setup scaling arrays in the LP More...
 
- Protected Attributes inherited from SPxScaler< R >
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...
 
SPxOutspxout
 message handler More...
 
std::shared_ptr< Tolerances_tolerances
 the tolerances More...
 

Detailed Description

template<class R>
class soplex::SPxEquiliSC< R >

Equilibrium row/column scaling.

This SPxScaler implementation performs equilibrium scaling of the LPs rows and columns.

Definition at line 45 of file spxequilisc.h.

Constructor & Destructor Documentation

◆ SPxEquiliSC() [1/2]

SPxEquiliSC ( bool  doBoth = true)
explicit

default constructor (this scaler makes no use of inherited member m_colFirst)

◆ SPxEquiliSC() [2/2]

SPxEquiliSC ( const SPxEquiliSC< R > &  old)

copy constructor

◆ ~SPxEquiliSC()

virtual ~SPxEquiliSC ( )
virtual

destructor

Definition at line 70 of file spxequilisc.h.

Member Function Documentation

◆ clone()

virtual SPxScaler< R > * clone ( ) const
overridevirtual

clone function for polymorphism

Implements SPxScaler< R >.

Definition at line 73 of file spxequilisc.h.

◆ computeEquiExpVec() [1/2]

static void computeEquiExpVec ( const SVSetBase< R > *  vecset,
const DataArray< int > &  coScaleExp,
DataArray< int > &  scaleExp,
epsilon 
)
static

compute equilibrium scaling vector rounded to power of two

◆ computeEquiExpVec() [2/2]

static void computeEquiExpVec ( const SVSetBase< R > *  vecset,
const std::vector< R > &  coScaleVal,
DataArray< int > &  scaleExp,
epsilon 
)
static

compute equilibrium scaling vector rounded to power of two

◆ computePostequiExpVecs()

static void computePostequiExpVecs ( const SPxLPBase< R > &  lp,
const std::vector< R > &  preRowscale,
const std::vector< R > &  preColscale,
DataArray< int > &  rowscaleExp,
DataArray< int > &  colscaleExp,
epsilon 
)
static

compute equilibrium scaling rounded to power of 2 for existing R scaling factors (preRowscale, preColscale)

◆ operator=()

SPxEquiliSC & operator= ( const SPxEquiliSC< R > &  )

assignment operator

◆ scale()

virtual void scale ( SPxLPBase< R > &  lp,
bool  persistent = false 
)
overridevirtual

Scale the loaded SPxLP.

Implements SPxScaler< R >.