31 return doBoth ?
"bi-Equilibrium" :
"uni-Equilibrium";
38 const int n = rowRatio ? lp.
nRows() : lp.
nCols();
40 for(
int i = 0; i < n; ++i)
46 for(
int j = 0; j < vec.
size(); ++j)
48 assert(vec.
index(j) >= 0);
64 const Real p = maxi / mini;
77 assert(vecset !=
nullptr);
79 for(
int i = 0; i < vecset->
num(); ++i)
81 const SVector& vec = (*vecset)[i];
85 for(
int j = 0; j < vec.
size(); ++j)
99 spxFrexp(1.0 / maxi, &(scaleExp[i]));
108 assert(vecset !=
nullptr);
110 for(
int i = 0; i < vecset->
num(); ++i)
112 const SVector& vec = (*vecset)[i];
116 for(
int j = 0; j < vec.
size(); ++j)
118 assert(vec.
index(j) >= 0);
131 spxFrexp(1.0 / maxi, &(scaleExp[i]));
138 const std::vector<Real>& preRowscale,
const std::vector<Real>& preColscale,
144 const bool colFirst = colratio < rowratio;
210 bool colFirst = colratio < rowratio;
215 <<
" col-ratio= " << colratio
216 <<
" row-ratio= " << rowratio
Rational spxAbs(const Rational &r)
Absolute.
virtual void setup(SPxLPBase< Real > &lp)
clear and setup scaling arrays in the LP
virtual R minAbsNzo(bool unscaled=true) const
Absolute smallest non-zero element in (possibly scaled) LP.
THREADLOCAL const Real infinity
static const char * makename(bool doBoth)
int size() const
Number of used indices.
virtual Real maxRowRatio(const SPxLPBase< Real > &lp) const
maximum ratio between absolute biggest and smallest element in any row.
R & value(int n)
Reference to value of n 'th nonzero.
SPxEquiliSC(bool doBoth=true)
default constructor (this scaler makes no use of inherited member m_colFirst)
Saving LPs in a form suitable for SoPlex.
Real spxFrexp(Real y, int *exp)
Wrapper for different output streams and verbosity levels.
int nRows() const
Returns number of rows in LP.
DataArray< int > * m_activeColscaleExp
pointer to currently active column scaling factors
virtual void applyScaling(SPxLPBase< Real > &lp)
applies m_colscale and m_rowscale to the lp.
Real spxLdexp(Real x, int exp)
returns x * 2^exp
SPxOut * spxout
message handler
bool GT(Real a, Real b, Real eps=Param::epsilon())
returns true iff a > b + eps
int & index(int n)
Reference to index of n 'th nonzero.
#define MSG_INFO2(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO2.
virtual Real maxAbsColscale() const
absolute biggest column scaling factor
virtual Real minAbsColscale() const
absolute smallest column scaling factor
Preconfigured SoPlex LP solver.
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
DataArray< int > * m_activeRowscaleExp
pointer to currently active row scaling factors
virtual Real minAbsRowscale() const
absolute smallest row scaling factor
static Real maxPrescaledRatio(const SPxLP &lp, const std::vector< Real > &coScaleval, bool rowRatio)
maximum ratio between absolute biggest and smallest element in any scaled row/column.
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...
Everything should be within this namespace.
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
static void computeEquiExpVec(const SVSet *vecset, const DataArray< int > &coScaleExp, DataArray< int > &scaleExp)
compute equilibrium scaling vector rounded to power of two
virtual void scale(SPxLPBase< Real > &lp, bool persistent=false) override
Scale the loaded SPxLP.
Saving LPs in a form suitable for SoPlex.
const SVectorBase< R > & rowVector(int i) const
Gets row vector of row i.
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
virtual Real maxAbsRowscale() const
absolute biggest row scaling factor
#define MSG_INFO1(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO1.
const SVectorBase< R > & colVector(int i) const
Returns column vector of column i.
int nCols() const
Returns number of columns in LP.
SPxEquiliSC & operator=(const SPxEquiliSC &)
assignment operator
const SVSetBase< R > * colSet() const
Returns the complete SVSetBase.
bool isZero(Real a, Real eps=Param::epsilon())
returns true iff |a| <= eps
bool m_doBoth
do columns and rows
virtual Real maxColRatio(const SPxLPBase< Real > &lp) const
maximum ratio between absolute biggest and smallest element in any column.
const SVSetBase< R > * rowSet() const
Returns the complete SVSet.
Equilibrium row/column scaling.This SPxScaler implementation performs equilibrium scaling of the LPs ...
int num() const
Current number of SVectorBases.
virtual R maxAbsNzo(bool unscaled=true) const
Absolute biggest non-zero element in (in rational case possibly scaled) LP.
SPxScaler & operator=(const SPxScaler &)
assignment operator