44 const SPxBasis::Desc& ds =
desc();
58 Real& v_rhs = (*theFrhs)[i];
61 for (
int j = row.size() - 1; j >= 0; --j)
63 int idx = row.index(j);
64 switch (ds.colStatus(idx))
103 (*thePvec)[i] =
vector(i) * (*theCoPvec);
117 (*thePvec)[i] =
vector(i) * (*theCoPvec);
141 Real& v_rhs = (*theFrhs)[i];
144 for (
int j = row.size() - 1; j >= 0; --j)
146 int idx = row.index(j);
147 switch (ds.colStatus(idx))
249 (*thePvec)[i] =
vector(i) * (*theCoPvec);
348 (*thePvec)[i] =
vector(i) * (*theCoPvec);
454 (*thePvec)[i] = (*thePvec)[n];
502 for (
int i = 0; i < n; ++i)
507 (*thePvec)[perm[i]] = (*thePvec)[i];
513 for (
int i = 0; i < n; ++i)
518 (*thePvec)[perm[i]] = (*thePvec)[i];
567 (*thePvec)[i] = (*thePvec)[n];
616 for (
int i = 0; i < n; ++i)
621 (*thePvec)[perm[i]] = (*thePvec)[i];
627 for (
int i = 0; i < n; ++i)
632 (*thePvec)[perm[i]] = (*thePvec)[i];
737 Real objChange = 0.0;
739 MSG_DEBUG( std::cout <<
"DCHANG01 changeLowerStatus(): col " << i
740 <<
"[" << newLower <<
":" << currUpper <<
"] " << stat; )
760 else if(
EQ(newLower, currUpper) )
764 objChange =
maxObj(i) * (newLower - oldLower);
767 objChange =
theLCbound[i] * (newLower - oldLower);
770 if(
EQ(newLower, currUpper) )
782 if(
NE(newLower, currUpper) )
802 MSG_DEBUG( std::cout <<
" -> " << stat << std::endl; )
818 for (
int i = 0; i < newLower.
dim(); ++i)
846 Real objChange = 0.0;
848 MSG_DEBUG( std::cout <<
"DCHANG02 changeUpperStatus(): col " << i
849 <<
"[" << currLower <<
":" << newUpper <<
"] " << stat; )
854 if (newUpper == currLower)
873 else if (
EQ(newUpper, currLower))
877 objChange =
maxObj(i) * (newUpper - oldUpper);
880 objChange =
theUCbound[i] * (newUpper - oldUpper);
891 if(
NE(newUpper, currLower) )
910 MSG_DEBUG( std::cout <<
" -> " << stat << std::endl; );
926 for (
int i = 0; i < newUpper.
dim(); ++i)
964 Real objChange = 0.0;
966 MSG_DEBUG( std::cout <<
"DCHANG03 changeLhsStatus() : row " << i
986 else if(
EQ(newLhs, currRhs) )
990 objChange =
maxRowObj(i) * (newLhs - oldLhs);
993 objChange =
theURbound[i] * (newLhs - oldLhs);
996 if(
EQ(newLhs, currRhs) )
1008 if(
NE(newLhs, currRhs) )
1027 MSG_DEBUG( std::cout <<
" -> " << stat << std::endl; )
1043 for (
int i = 0; i <
nRows(); ++i)
1069 Real objChange = 0.0;
1071 MSG_DEBUG( std::cout <<
"DCHANG04 changeRhsStatus() : row " << i
1091 else if(
EQ(newRhs, currLhs) )
1095 objChange =
maxRowObj(i) * (newRhs - oldRhs);
1098 objChange =
theLRbound[i] * (newRhs - oldRhs);
1101 if(
EQ(newRhs, currLhs) )
1113 if(
NE(newRhs, currLhs) )
1132 MSG_DEBUG( std::cout <<
" -> " << stat << std::endl; )
1149 for (
int i = 0; i <
nRows(); ++i)
1179 for (
int i =
nRows() - 1; i >= 0; --i)
1229 if( i < 0 || j < 0 )
const VectorBase< Real > & rhs() const
Returns right hand side vector.
void computeFtest()
compute basis feasibility test vector.
virtual void addedRows(int n)
virtual void changeRow(int i, const LPRow &newRow, bool scale=false)
Exception class for things that should NEVER happen.This class is derived from the SoPlex exception b...
void addedRows(int n)
inform SPxBasis, that n new rows had been added.
void setEnterBound4Col(int, int)
Basis is not known to be dual nor primal feasible.
void coSolve(Vector &x, const Vector &rhs)
Cosolves linear system with basis matrix.
primal variable is fixed to both bounds
virtual void changeLower(const Vector &newLower, bool scale=false)
primal or dual variable has no status
const VectorBase< Real > & upper() const
Returns upper bound vector.
Desc::Status dualColStatus(int i) const
dual Status for the i'th column variable of the loaded LP.
THREADLOCAL const Real infinity
void removedCols(const int perm[])
inform SPxBasis that columns in perm with negative entry were removed.
Abstract pricer base class.
Real leavetol() const
feasibility tolerance maintained by ratio test during LEAVE algorithm.
void computeTest()
compute test vector in ENTERing Simplex.
virtual void removedVecs(const int *)
vectors given by perm have been removed from loaded LP.
virtual void reDim()
reset dimensions of vectors according to loaded LP.
Basis is optimal, i.e. dual and primal feasible.
Exception classes for SoPlex.
Status & rowStatus(int i)
Real rhsUnscaled(int i) const
Returns unscaled right hand side of row number i.
virtual void changeCol(int n, const LPColBase< Real > &newCol, bool scale=false)
Replaces i 'th column of LP with newCol. scale determines whether the new data should be scaled...
virtual void addedCols(int newcols)
Called after the last n columns have just been added.
void localAddCols(int start)
Abstract ratio test base class.
void clearDualBounds(SPxBasis::Desc::Status, Real &, Real &) const
virtual void changeUpper(const Vector &newUpper, bool scale=false)
bool NE(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| > eps
void changedCol(int)
inform SPxBasis that a column had been changed.
virtual void addedCols(int n)
void shiftLBbound(int i, Real to)
shift i 'th lbBound to to.
void setLeaveBound4Col(int i, int n)
virtual void changeCol(int i, const LPCol &newCol, bool scale=false)
void changedElement(int, int)
inform SPxBasis that a matrix entry had been changed.
Desc::Status dualRowStatus(int i) const
dual Status for the i'th row variable of the loaded LP.
void changedRow(int)
inform SPxBasis that a row had been changed.
dual variable is left free, but unset
int nRows() const
Returns number of rows in LP.
void removedCol(int i)
inform SPxBasis that column i had been removed.
virtual void changeRhs(const Vector &newRhs, bool scale=false)
primal variable is set to its upper bound
virtual void addedCoVecs(int)
n covectors have been added to loaded LP.
virtual void changeBounds(const Vector &newLower, const Vector &newUpper, bool scale=false)
virtual void changeLhsStatus(int i, Real newLhs, Real oldLhs=0.0)
SPxSense
Optimization sense.
virtual void doRemoveRow(int i)
virtual void changeRowObj(const Vector &newObj, bool scale=false)
SPxStatus status() const
returns current SPxStatus.
virtual void doRemoveRows(int perm[])
Internal helper method.
void removedRows(const int perm[])
inform SPxBasis that rows in perm with negative entry were removed.
void localAddRows(int start)
virtual void doRemoveCols(int perm[])
void shiftLPbound(int i, Real to)
shift i 'th lpBound to to.
virtual void addedVecs(int)
n vectors have been added to loaded LP.
SPxSense spxSense() const
Returns the optimization sense.
virtual void changeMaxObj(const VectorBase< Real > &newObj, bool scale=false)
Changes objective vector to newObj. scale determines whether the new data should be scaled...
virtual void unInit()
uninitialize data structures.
Real entertol() const
feasibility tolerance maintained by ratio test during ENTER algorithm.
Real upperUnscaled(int i) const
Returns unscaled upper bound of column i.
virtual void changeSense(SPxSense sns)
virtual void changeElement(int i, int j, const Real &val, bool scale=false)
void computeEnterCoPrhs4Col(int i, int n)
dual variable is set to its upper bound
DVector theLBbound
Lower Basic Feasibility bound.
virtual void changeLhs(const Vector &newLhs, bool scale=false)
primal variable is left free, but unset
virtual void changeLower(const VectorBase< Real > &newLower, bool scale=false)
Changes vector of lower bounds to newLower. scale determines whether the new data should be scaled...
virtual void changeRhs(const VectorBase< Real > &newRhs, bool scale=false)
Changes right hand side vector for constraints to newRhs. scale determines whether the new data shoul...
const VectorBase< Real > & lhs() const
Returns left hand side vector.
bool updateNonbasicValue(Real objChange)
DVector theURbound
Upper Row Feasibility bound.
virtual void changeLowerStatus(int i, Real newLower, Real oldLower=0.0)
const VectorBase< Real > & maxRowObj() const
Real lhsUnscaled(int i) const
Returns unscaled left hand side of row number i.
const Vector & test() const
Violations of pVec.
void shiftUBbound(int i, Real to)
shift i 'th ubBound to to.
Status & colStatus(int i)
(In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is...
DVector theUBbound
Upper Basic Feasibility bound.
virtual void changeRow(int n, const LPRowBase< Real > &newRow, bool scale=false)
Replaces i 'th row of LP with newRow. scale determines whether the new data should be scaled...
virtual void changeRhsStatus(int i, Real newRhs, Real oldRhs=0.0)
virtual void changeUpper(const VectorBase< Real > &newUpper, bool scale=false)
Changes vector of upper bounds to newUpper. scale determines whether the new data should be scaled...
virtual void changeMaxObj(const Vector &newObj, bool scale=false)
Debugging, floating point type and parameter definitions.
SVectorBase< Real > SVector
bool EQ(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| <= eps
virtual void changeObj(const VectorBase< Real > &newObj, bool scale=false)
Changes objective vector to newObj. scale determines whether the new data should be scaled...
DVector theLRbound
Lower Row Feasibility bound.
DVector theUCbound
Upper Column Feasibility bound.
bool isInitialized() const
has the internal data been initialized?
void computeLeaveCoPrhs4Col(int i, int n)
VectorBase< R > & multAdd(const S &x, const VectorBase< T > &vec)
Addition of scaled vector.
void computeEnterCoPrhs4Row(int i, int n)
int dim() const
Dimension of vector.
virtual void doRemoveCols(int perm[])
Internal helper method.
Everything should be within this namespace.
void shiftUPbound(int i, Real to)
shift i 'th upBound to to.
virtual void changeRange(const Vector &newLhs, const Vector &newRhs, bool scale=false)
void computeLeaveCoPrhs4Row(int i, int n)
Real lowerUnscaled(int i) const
Returns unscaled lower bound of column i.
primal variable is set to its lower bound
bool m_nonbasicValueUpToDate
true, if the stored objValue is up to date
const VectorBase< Real > & maxObj() const
Returns objective vector for maximization problem.
void setEnterBound4Row(int, int)
DVector theLCbound
Lower Column Feasibility bound.
const SVectorBase< Real > & rowVector(int i) const
Gets row vector of row i.
virtual void changeRowObj(const VectorBase< Real > &newRowObj, bool scale=false)
Changes row objective function vector to newRowObj. scale determines whether the new data should be s...
virtual void removedVec(int)
vector i was removed from loaded LP.
virtual void changeUpperStatus(int i, Real newUpper, Real oldLower=0.0)
void removedRow(int i)
inform SPxBasis that row i had been removed.
void shiftFvec()
Perform initial shifting to optain an feasible or pricable basis.
dual variable is set to its lower bound
virtual void changeSense(SPxSense sns)
Changes optimization sense to sns.
Type type() const
return current Type.
Real theShift
sum of all shifts applied to any bound.
virtual void doRemoveCol(int i)
int nCols() const
Returns number of columns in LP.
virtual void changeElement(int i, int j, const Real &val, bool scale=false)
Changes LP element (i, j) to val. scale determines whether the new data should be scaled...
virtual void changeLhs(const VectorBase< Real > &newLhs, bool scale=false)
Changes left hand side vector for constraints to newLhs. scale determines whether the new data should...
dual variable has two bounds
virtual void doRemoveRow(int j)
Internal helper method.
virtual void doRemoveRows(int perm[])
virtual void addedRows(int newrows)
Called after the last n rows have just been added.
void forceRecompNonbasicValue()
void solve(Vector &x, const Vector &rhs)
const SVector & vector(int i) const
i 'th vector.
void computePvec()
compute entire pVec().
virtual void doRemoveCol(int j)
Internal helper method.
Status
Status of a variable.
virtual void changeObj(const Vector &newObj, bool scale=false)
scale determines whether the new data needs to be scaled according to the existing LP (persistent sca...
void setLeaveBound4Row(int i, int n)
const VectorBase< Real > & obj() const
Returns the vector of objective coefficients.
LP has been proven to be primal unbounded.
const VectorBase< Real > & lower() const
Returns (internal and possibly scaled) lower bound vector.
LP column.Class LPColBase provides a datatype for storing the column of an LP a the form similar to ...
const Desc & desc() const
Representation rep() const
return the current basis representation.
columnwise representation.
Basis is primal feasible.
void setBasisStatus(SPxBasis::SPxStatus stat)
set the lp solver's basis status.
void addedCols(int n)
inform SPxBasis that n new columns had been added.
LP has been proven to be primal infeasible.
No Problem has been loaded to the basis.
void computeCoTest()
compute coTest vector.