113 friend std::ostream& operator<<(std::ostream& s, const SPxScaler<T>& sc);
119 explicit SPxScaler(
const char* name,
bool colFirst =
false,
bool doBoth =
true,
135 virtual const char*
getName()
const;
137 virtual void setOrder(
bool colFirst);
139 virtual void setBoth(
bool both);
143 spxout = &newOutstream;
146 virtual void setRealParam(R param,
const char* name =
"realparam");
148 virtual void setIntParam(
int param,
const char* name =
"intparam");
248 #include "spxscaler.hpp" 250 #endif // _SPXSCALER_H_ virtual const char * getName() const
get name of scaler
virtual void scale(SPxLPBase< R > &lp, bool persistent=true)=0
scale SPxLP.
virtual void getUpperUnscaled(const SPxLPBase< R > &lp, VectorBase< R > &vec) const
returns unscaled upper bound vector of lp
virtual R lhsUnscaled(const SPxLPBase< R > &lp, int i) const
returns unscaled left hand side i of lp
virtual void scaleObj(const SPxLPBase< R > &lp, VectorBase< R > &origObj) const
apply scaling to objective function vector origObj.
virtual void setOrder(bool colFirst)
set scaling order
Dense vector.Class VectorBase provides dense linear algebra vectors. Internally, VectorBase wraps std...
virtual R maxRowRatio(const SPxLPBase< R > &lp) const
maximum ratio between absolute biggest and smallest element in any row.
virtual R scaleUpper(const SPxLPBase< R > &lp, int col, R upper) const
returns scaled upper bound of column col.
virtual void unscaleDual(const SPxLPBase< R > &lp, VectorBase< R > &pi) const
unscale dense dual solution vector given in pi.
Dynamic sparse vectors.Class DSVectorBase implements dynamic sparse vectors, i.e. SVectorBases with a...
virtual R maxObjUnscaled(const SPxLPBase< R > &lp, int i) const
returns unscaled objective function coefficient of i
virtual void setBoth(bool both)
set wether column and row scaling should be performed
virtual void getLhsUnscaled(const SPxLPBase< R > &lp, VectorBase< R > &vec) const
returns unscaled left hand side vector of lp
virtual void applyScaling(SPxLPBase< R > &lp)
applies m_colscale and m_rowscale to the lp.
virtual void getRowUnscaled(const SPxLPBase< R > &lp, int i, DSVectorBase< R > &vec) const
returns unscaled row i
Dense vector for linear algebra.
virtual void unscaleDualray(const SPxLPBase< R > &lp, VectorBase< R > &ray) const
unscale dual ray given in ray.
DataArray< int > * m_activeColscaleExp
pointer to currently active column scaling factors
virtual void setOutstream(SPxOut &newOutstream)
set message handler
virtual SPxScaler * clone() const =0
clone function for polymorphism
SPxScaler & operator=(const SPxScaler &)
assignment operator
virtual R scaleElement(const SPxLPBase< R > &lp, int row, int col, R val) const
returns scaled LP element in row and col.
virtual void setup(SPxLPBase< R > &lp)
clear and setup scaling arrays in the LP
SPxOut * spxout
message handler
virtual R maxAbsRowscale() const
absolute biggest row scaling factor
virtual void unscalePrimalray(const SPxLPBase< R > &lp, VectorBase< R > &ray) const
unscale primal ray given in ray.
virtual void setIntParam(int param, const char *name="intparam")
set int parameter
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
virtual void getColUnscaled(const SPxLPBase< R > &lp, int i, DSVectorBase< R > &vec) const
gets unscaled column i
virtual R upperUnscaled(const SPxLPBase< R > &lp, int i) const
returns unscaled upper bound i
virtual R getRowMaxAbsUnscaled(const SPxLPBase< R > &lp, int i) const
returns maximum absolute value of unscaled row i
virtual R getCoefUnscaled(const SPxLPBase< R > &lp, int row, int col) const
returns unscaled coefficient of lp
virtual R rhsUnscaled(const SPxLPBase< R > &lp, int i) const
returns unscaled right hand side i
virtual ~SPxScaler()
destructor.
virtual R maxAbsColscale() const
absolute biggest column scaling factor
DataArray< int > * m_activeRowscaleExp
pointer to currently active row scaling factors
Debugging, floating point type and parameter definitions.
virtual int getColScaleExp(int i) const
returns scaling factor for column i
virtual R scaleLhs(const SPxLPBase< R > &lp, int row, R lhs) const
returns scaled left hand side of row row.
void computeExpVec(const std::vector< R > &vec, DataArray< int > &vecExp)
round vector entries to power of 2
Everything should be within this namespace.
virtual void unscaleSlacks(const SPxLPBase< R > &lp, VectorBase< R > &s) const
unscale dense slack vector given in s.
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
virtual R maxColRatio(const SPxLPBase< R > &lp) const
maximum ratio between absolute biggest and smallest element in any column.
bool m_colFirst
do column scaling first
SPxScaler(const char *name, bool colFirst=false, bool doBoth=true, SPxOut *spxout=NULL)
constructor
virtual R getColMinAbsUnscaled(const SPxLPBase< R > &lp, int i) const
returns minumum absolute value of unscaled column i
virtual R minAbsColscale() const
absolute smallest column scaling factor
virtual void getRhsUnscaled(const SPxLPBase< R > &lp, VectorBase< R > &vec) const
gets unscaled right hand side vector
virtual void unscaleRedCost(const SPxLPBase< R > &lp, VectorBase< R > &r) const
unscale dense reduced cost vector given in r.
virtual R minAbsRowscale() const
absolute smallest row scaling factor
virtual void getLowerUnscaled(const SPxLPBase< R > &lp, VectorBase< R > &vec) const
gets unscaled lower bound vector
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
virtual int computeScaleExp(const SVectorBase< R > &vec, const DataArray< int > &oldScaleExp) const
compute a single scaling vector , e.g. of a newly added row
virtual bool isConsistent() const
consistency check
virtual void unscalePrimal(const SPxLPBase< R > &lp, VectorBase< R > &x) const
unscale dense primal solution vector given in x.
virtual R scaleLower(const SPxLPBase< R > &lp, int col, R lower) const
returns scaled lower bound of column col.
Sparse vectors.Class SVectorBase provides packed sparse vectors. Such are a sparse vectors...
virtual R lowerUnscaled(const SPxLPBase< R > &lp, int i) const
returns unscaled lower bound i
bool m_doBoth
do columns and rows
virtual void getMaxObjUnscaled(const SPxLPBase< R > &lp, VectorBase< R > &vec) const
gets unscaled objective function
virtual R scaleRhs(const SPxLPBase< R > &lp, int row, R rhs) const
returns scaled right hand side of row row.
Save arrays of data objects.
virtual R getColMaxAbsUnscaled(const SPxLPBase< R > &lp, int i) const
returns maximum absolute value of unscaled column i
virtual void unscale(SPxLPBase< R > &lp)
unscale SPxLP
const char * m_name
Name of the scaler.
virtual R getRowMinAbsUnscaled(const SPxLPBase< R > &lp, int i) const
returns minimum absolute value of unscaled row i
virtual void setRealParam(R param, const char *name="realparam")
set R parameter
virtual int getRowScaleExp(int i) const
returns scaling factor for row i