36 for(
int i = 0; i < vecset->
num(); ++i )
38 const SVector& vec = (*vecset)[i];
43 for(
int j = 0; j < vec.
size(); ++j )
64 scaleval[i] = 1.0 /
spxSqrt(mini * maxi);
77 , m_maxIterations(maxIters)
78 , m_minImprovement(minImpr)
79 , m_goodEnoughRatio(goodEnough)
102 MSG_INFO1( (*
spxout), (*
spxout) <<
"Geometric scaling LP" << (persistent ?
" (persistent)" :
"") << std::endl; )
119 bool colFirst = colratio < rowratio;
124 <<
" col-ratio= " << colratio
125 <<
" row-ratio= " << rowratio
142 <<
" col-ratio= " << (colFirst ? p0 : p1)
143 <<
" row-ratio= " << (colFirst ? p1 : p0)
173 for( i = 0; i < lp.
nCols(); ++i )
175 frexp(
double(colscale[i]), &(colscaleExp[i]));
179 for( i = 0; i < lp.
nRows(); ++i )
181 frexp(
double(rowscale[i]), &(rowscaleExp[i]));
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
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.
SPxGeometSC(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) ...
virtual void scale(SPxLPBase< Real > &lp, bool persistent=true)
Scale the loaded SPxLP.
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.
static Real computeScalingVec(const SVSet *vecset, const DataArray< Real > &coScaleval, DataArray< Real > &scaleval)
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.
DataArray< int > * m_activeRowscaleExp
pointer to currently active row scaling factors
virtual Real minAbsRowscale() const
absolute smallest row scaling factor
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.
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 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