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;)
59 for(
int i = 0; i < origLP->
nCols(); ++i)
70 for(
int j = 0; j < col.
size(); ++j)
75 <<
": orig " << origLP->
colVector(i).value(j)
76 <<
", unscaled: " << col.
value(j) << std::endl;)
115 for(
int i = 0; i < basisdim; ++i)
117 binvcol[i] =
new DVector(basisdim);
126 for(
int i = 0; i < basisdim; ++i)
128 binvrow[i] =
new DVector(basisdim);
136 "DEBUG: checking columns for identity after multiplying with basis matrix\n";)
139 for(
int i = 0; i < basisdim; ++i)
145 for(
int j = 0; j < basisdim; ++j)
150 error =
spxAbs(result[j]);
152 error =
spxAbs(result[j] - 1.0);
165 "DEBUG: checking rows for identity after multiplying with basis matrix\n";)
167 for(
int i = 0; i < basisdim; ++i)
173 for(
int j = 0; j < basisdim; ++j)
178 error =
spxAbs(result[j]);
180 error =
spxAbs(result[j] - 1.0);
209 for(
int i = 0; i < basisdim; ++i)
211 binvcol2[i] =
new DVector(basisdim);
212 binvcol2[i]->
clear();
220 for(
int i = 0; i < basisdim; ++i)
222 binvrow2[i] =
new DVector(basisdim);
223 binvrow2[i]->
clear();
228 "DEBUG: checking rows and columns of scaled/unscaled inverted of basis matrix\n";)
230 for(
int i = 0; i < basisdim; ++i)
234 for(
int j = 0; j < basisdim; ++j)
241 (*binvcol2[i])[j] << std::endl);
242 sumerror +=
spxAbs((*binvcol[i])[j] - (*binvcol2[i])[j]);
249 (*binvrow2[i])[j] << std::endl);
250 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.