31 const std::vector<Real>& coScaleval,
32 std::vector<Real>& scaleval)
36 assert(scaleval.size() == unsigned(vecset->
num()));
38 for(
int i = 0; i < vecset->
num(); ++i)
40 const SVector& vec = (*vecset)[i];
45 for(
int j = 0; j < vec.
size(); ++j)
69 scaleval[unsigned(i)] = 1.0 /
spxSqrt(mini * maxi);
71 const Real p = maxi / mini;
83 , postequilibration(equilibrate)
84 , m_maxIterations(maxIters)
85 , m_minImprovement(minImpr)
86 , m_goodEnoughRatio(goodEnough)
89 assert(minImpr > 0.0 && minImpr <= 1.0);
90 assert(goodEnough >= 0.0);
129 const bool colFirst = colratio < rowratio;
148 <<
" col-ratio= " << colratio
149 <<
" row-ratio= " << rowratio
168 std::vector<Real> rowscale(
unsigned(lp.
nRows()), 1.0);
169 std::vector<Real> colscale(
unsigned(lp.
nCols()), 1.0);
176 Real p0prev = p0start;
177 Real p1prev = p1start;
194 <<
" col-ratio= " << (colFirst ? p0 : p1)
195 <<
" row-ratio= " << (colFirst ? p1 : p0)
223 std::fill(rowscale.begin(), rowscale.end(), 1.0);
224 std::fill(colscale.begin(), colscale.end(), 1.0);
Rational spxAbs(const Rational &r)
Absolute.
virtual void setup(SPxLPBase< Real > &lp)
clear and setup scaling arrays in the LP
const Real m_goodEnoughRatio
no scaling needed if ratio is less than this.
const int m_maxIterations
maximum number of scaling iterations.
virtual R minAbsNzo(bool unscaled=true) const
Absolute smallest non-zero element in (possibly scaled) LP.
THREADLOCAL const Real infinity
virtual void scale(SPxLPBase< Real > &lp, bool persistent=true) override
Scale the loaded SPxLP.
Geometric mean row/column scaling.This SPxScaler implementation performs geometric mean scaling of th...
int size() const
Number of used indices.
LP geometric mean scaling.
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.
Saving LPs in a form suitable for SoPlex.
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.
SPxOut * spxout
message handler
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.
SPxGeometSC & operator=(const SPxGeometSC &)
assignment operator
Real spxSqrt(Real a)
returns square root
virtual Real maxAbsColscale() const
absolute biggest column scaling factor
virtual Real minAbsColscale() const
absolute smallest column scaling factor
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
void computeExpVec(const std::vector< Real > &vec, DataArray< int > &vecExp)
round vector entries to power of 2
DataArray< int > * m_activeRowscaleExp
pointer to currently active row scaling factors
SPxGeometSC(bool equilibrate=false, int maxIters=8, Real minImpr=0.85, Real goodEnough=1e3)
default constructor (this scaler makes no use of inherited members m_colFirst and m_doBoth) ...
void setScalingInfo(bool scaled)
set whether the LP is scaled or not
virtual Real minAbsRowscale() const
absolute smallest row scaling factor
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.
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.
static Real computeScalingVec(const SVSet *vecset, const std::vector< Real > &coScaleval, std::vector< Real > &scaleval)
int nCols() const
Returns number of columns in LP.
const SVSetBase< R > * colSet() const
Returns the complete SVSetBase.
bool isZero(Real a, Real eps=Param::epsilon())
returns true iff |a| <= eps
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.
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.
const bool postequilibration
equilibrate after geometric scaling?
const Real m_minImprovement
improvement necessary to carry on. (Bixby said Fourer said in MP 23, 274 ff. that 0...
SPxScaler & operator=(const SPxScaler &)
assignment operator