35 for(
int i = 0; i < origLP->
nRows(); ++i )
45 for(
int j = 0; j < row.
size(); ++j)
50 <<
": orig " << origLP->
rowVector(i).value(j)
51 <<
", unscaled: " << row.
value(j) << std::endl; )
58 for(
int i = 0; i < origLP->
nCols(); ++i )
69 for(
int j = 0; j < col.
size(); ++j)
74 <<
": orig " << origLP->
colVector(i).value(j)
75 <<
", unscaled: " << col.
value(j) << std::endl; )
111 for(
int i = 0; i < basisdim; ++i)
113 binvcol[i] =
new DVector(basisdim);
120 for(
int i = 0; i < basisdim; ++i)
122 binvrow[i] =
new DVector(basisdim);
129 MSG_INFO1(
spxout,
spxout <<
"DEBUG: checking columns for identity after multiplying with basis matrix\n";)
131 for(
int i = 0; i < basisdim; ++i)
136 for(
int j = 0; j < basisdim; ++j)
140 error =
spxAbs(result[j]);
142 error =
spxAbs(result[j] - 1.0);
151 MSG_INFO1(
spxout,
spxout <<
"DEBUG: checking rows for identity after multiplying with basis matrix\n";)
152 for(
int i = 0; i < basisdim; ++i)
157 for(
int j = 0; j < basisdim; ++j)
161 error =
spxAbs(result[j]);
163 error =
spxAbs(result[j] - 1.0);
188 for(
int i = 0; i < basisdim; ++i)
190 binvcol2[i] =
new DVector(basisdim);
191 binvcol2[i]->
clear();
198 for(
int i = 0; i < basisdim; ++i)
200 binvrow2[i] =
new DVector(basisdim);
201 binvrow2[i]->
clear();
205 MSG_INFO1(
spxout,
spxout <<
"DEBUG: checking rows and columns of scaled/unscaled inverted of basis matrix\n";)
206 for(
int i = 0; i < basisdim; ++i)
209 for(
int j = 0; j < basisdim; ++j)
215 MSG_INFO1(
spxout,
spxout <<
"ERROR: col " << i <<
" " << j <<
", " << (*binvcol[i])[j] <<
" " << (*binvcol2[i])[j] << std::endl );
216 sumerror +=
spxAbs((*binvcol[i])[j] - (*binvcol2[i])[j]);
221 MSG_INFO1(
spxout,
spxout <<
"ERROR: row " << i <<
" " << j <<
", " << (*binvrow[i])[j] / (*binvrow2[i])[j] << std::endl );
222 sumerror +=
spxAbs((*binvrow[i])[j] - (*binvrow2[i])[j]);
const VectorBase< R > & rhs() const
Returns right hand side vector.
Rational spxAbs(const Rational &r)
Absolute.
void _checkScaling(SPxLPReal *origLP) const
check scaling of LP
bool multBasisTranspose(Real *vec, bool unscale=true)
multiply with transpose of basis matrix; vec * B^T (inplace)
bool getBasisInverseRowReal(int r, Real *coef, int *inds=NULL, int *ninds=NULL, bool unscale=true)
computes row r of basis inverse; returns true on success
const VectorBase< R > & upper() const
Returns upper bound vector.
int size() const
Number of used indices.
bool multBasis(Real *vec, bool unscale=true)
multiply with basis matrix; B * vec (inplace)
Real feastol() const
allowed primal feasibility tolerance.
void unscaleLPandReloadBasis()
unscales the LP and reloads the basis
bool isScaled() const
Returns true if and only if the LP is scaled.
R rhsUnscaled(int i) const
Returns unscaled right hand side of row number i.
bool NE(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| > eps
R & value(int n)
Reference to value of n 'th nonzero.
void _checkBasisScaling()
check correctness of (un)scaled basis matrix operations
int nRows() const
Returns number of rows in LP.
void spx_alloc(T &p, int n=1)
Allocate memory.
R * get_ptr()
Conversion to C-style pointer.
R objUnscaled(int i) const
Returns unscaled objective value of column i.
void getColVectorUnscaled(int i, DSVectorBase< Real > &vec) const
Gets column vector of column i.
R upperUnscaled(int i) const
Returns unscaled upper bound of column i.
LP has been solved to optimality.
bool getBasisInverseColReal(int c, Real *coef, int *inds=NULL, int *ninds=NULL, bool unscale=true)
computes column c of basis inverse; returns true on success
Class for collecting statistical information.
R obj(int i) const
Returns objective value of column i.
const VectorBase< R > & lhs() const
Returns left hand side vector.
R lhsUnscaled(int i) const
Returns unscaled left hand side of row number i.
Preconfigured SoPlex LP solver.
bool EQ(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| <= eps
Everything should be within this namespace.
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
R lowerUnscaled(int i) const
Returns unscaled lower bound of column i.
const SVectorBase< R > & rowVector(int i) const
Gets row vector of row i.
void clear()
Set vector to 0.
DVectorBase< Real > DVector
#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.
const VectorBase< R > & lower() const
Returns (internal and possibly scaled) lower bound vector.
SPxSolver::Status _status
Representation rep() const
return the current basis representation.
columnwise representation.
void spx_free(T &p)
Release memory.
void getRowVectorUnscaled(int i, DSVectorBase< Real > &vec) const
Gets unscaled row vector of row i.