24 #define SOPLEX_DEBUG_SPXBASIS 221 return colstat.
size();
226 return rowstat.
size();
236 return costat->
size();
299 void reSize(
int rowDim,
int colDim);
434 if(thestatus != stat)
437 MSG_DEBUG(std::cout <<
"DBSTAT01 SPxBasis::setStatus(): status: " 438 <<
int(thestatus) <<
" (" << thestatus <<
") -> " 439 <<
int(stat) <<
" (" << stat <<
")" << std::endl;)
493 return id.isSPxRowId()
517 assert(matrixIsSetup);
779 factor->
solveLeft(x, y, z, rhsx, rhsy, rhsz);
788 factor->
solveLeft(x, y, z, rhsx, rhsy, rhsz);
861 const NameSet* rownames,
const NameSet* colnames,
const bool cpxFormat =
false)
const;
890 virtual void load(
SPxSolver* lp,
bool initSlackBasis =
true);
921 return theTime->
time();
934 #ifdef MEASUREUPDATETIME 945 spxout = &newOutstream;
1005 #ifdef SOPLEX_DEBUG_SPXBASIS 1006 #define SOPLEX_DEBUG 1007 #undef SOPLEX_DEBUG_SPXBASIS 1010 #endif // _SPXBASIS_H_ int lastMem
memory needed after last fresh factorization
int iterDegenCheck
number of calls to change() since last degeneracy check
int nzCount
number of nonzeros in basis matrix
int iteration() const
returns number of basis changes since last load().
Vector & multWithBase(Vector &x) const
Vector-basis product.
void addedRows(int n)
inform SPxBasis, that n new rows had been added.
const Status * colStatus(void) const
returns the array of column Statuses.
Real fillFactor
allowed increase in relative fill before refactorization
bool isSetup() const
Returns setup status.
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
primal or dual variable is undefined
void invalidate()
invalidates actual basis.
Desc::Status dualColStatus(int i) const
dual Status for the i'th column variable of the loaded LP.
virtual void printMatrix() const
bool isConsistent() const
consistency check.
void removedCols(const int perm[])
inform SPxBasis that columns in perm with negative entry were removed.
virtual std::string statistics() const =0
returns statistical information in form of a string.
void setMaxUpdates(int maxUp)
change maximum number of iterations until a refactorization is performed
int coDim() const
returns codimension.
virtual void solveRight(Vector &x, const Vector &b)=0
Solves .
int size() const
Number of used indices.
int updateCount
number of calls to change() since last factorize()
Basis is optimal, i.e. dual and primal feasible.
Status & rowStatus(int i)
virtual bool isDescValid(const Desc &ds)
checks if a Descriptor is valid for the current LP w.r.t. its bounds
DataArray< Status > * stat
basis' status.
int lastIndex() const
returns index in basis where last update was done.
int dim() const
returns dimension.
virtual ~SPxBasis()
destructor.
void changedCol(int)
inform SPxBasis that a column had been changed.
int lastNzCount
number of nonzeros in basis matrix after last fresh factorization
void solve4update(SSVector &x, Vector &y, const SVector &rhsx, SSVector &rhsy)
solves two systems in one call.
int lastUpdate() const
returns number of basis changes since last refactorization.
Status rowStatus(int i) const
returns status of row i.
Status coStatus(int i) const
returns status of covariable i.
Vector & multBaseWith(Vector &x) const
Basis-vector product.
Desc & operator=(const Desc &rhs)
assignment operator
void reSize(int rowDim, int colDim)
resets dimensions.
Real getFastCondition(int type=0)
void dump() const
Prints out status.
Ids for LP columns.Class SPxColId provides DataKeys for the column indices of an SPxLP.
Desc::Status dualStatus(const SPxColId &id) const
dual Status for the column variable with ID id of the loaded LP.
Sparse Linear Solver virtual base class.
virtual void solve3right4update(SSVector &x, Vector &y, Vector &z, const SVector &b, SSVector &d, SSVector &e)=0
Solves , and .
bool factorized
true iff factor = matrix .
void changedElement(int, int)
inform SPxBasis that a matrix entry had been changed.
virtual void writeBasis(std::ostream &os, const NameSet *rownames, const NameSet *colnames, const bool cpxFormat=false) const
void setRep()
sets descriptor representation according to loaded LP.
Sparse Linear Solver virtual base class.Class SLinSolver provides a class for solving sparse linear s...
Desc::Status dualRowStatus(int i) const
dual Status for the i'th row variable of the loaded LP.
Real memFactor
allowed total increase in memory consumption before refactorization
int lastIterCount
number of calls to change() before halting the simplex
SPxStatus thestatus
current status of the basis.
int nCols() const
returns number of columns.
void changedRow(int)
inform SPxBasis that a row had been changed.
Status colStatus(int i) const
returns status of column i.
dual variable is left free, but unset
Wrapper for different output streams and verbosity levels.
void coSolve(SSVector &x, SSVector &y, SSVector &z, const SVector &rhsx, SSVector &rhsy, SSVector &rhsz)
Sparse version of solving three systems in one call.
void removedCol(int i)
inform SPxBasis that column i had been removed.
int maxUpdates
number of updates before refactorization.
primal variable is set to its upper bound
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
virtual Real stability() const =0
returns a stability number (0: singularity, 1: perfect stability).
int getMaxUpdates() const
returns maximum number of updates before a refactorization is performed
Desc()
default constructor
SPxStatus status() const
returns current SPxStatus.
const SVector & baseVec(int i) const
returns the i'th basic vector.
void reDim()
resizes internal arrays.
SPxId baseId(int i) const
returns the Id of the i'th basis vector.
virtual void solveLeft(Vector &x, const Vector &b)=0
solves .
void setStatus(SPxStatus stat)
sets basis SPxStatus to stat.
Real lastFill
fill ratio that occured during last factorization
void removedRows(const int perm[])
inform SPxBasis that rows in perm with negative entry were removed.
void coSolve(SSVector &x, Vector &y, const SVector &rhsx, SSVector &rhsy)
solves two systems in one call.
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
dual variable is set to its upper bound
virtual bool readBasis(std::istream &in, const NameSet *rowNames, const NameSet *colNames)
const T * get_const_ptr() const
get a const C pointer to the data.
void solve4update(SSVector &x, SSVector &y, SSVector &y2, const SVector &rhsx, SSVector &rhsy, SSVector &rhsy2)
solves three systems in one call using only sparse data structures
primal variable is left free, but unset
void coSolve(SSVector &x, Vector &y, Vector &z, const SVector &rhsx, SSVector &rhsy, SSVector &rhsz)
solves three systems in one call. May be improved by using just one pass through the basis...
void clear()
Clears vector.
Real getEstimatedCondition()
virtual void loadBasisSolver(SLinSolver *solver, const bool destroy=false)
sets up linear solver to use.
virtual Real time() const =0
SPxId lastout
lastLeft(): variable left the base last
Real minStab
minimum stability
Status & colStatus(int i)
DataArray< Status > rowstat
status of rows.
void loadMatrixVecs()
loads matrix according to the SPxIds stored in theBaseId.
virtual void change(int i, SPxId &id, const SVector *enterVec, const SSVector *eta=0)
performs basis update.
Timer::TYPE timerType
type of timer (user or wallclock)
Debugging, floating point type and parameter definitions.
Simplex basis.Consider the linear program as provided from class SPxLP: where , and ...
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
void restoreInitialBasis()
Restores initial basis.
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
Real condition(int maxiters=10, Real tolerance=1e-6)
const Status * status(void) const
returns the array of variable Statuses.
int dim() const
Dimension of vector.
void solve4update(SSVector &x, Vector &y, Vector &y2, const SVector &rhsx, SSVector &rhsy, SSVector &rhsy2)
solves three systems in one call.
Desc thedesc
the basis' Descriptor
Everything should be within this namespace.
Desc & desc()
returns current basis Descriptor.
void setOutstream(SPxOut &newOutstream)
void solve4update(SSVector &x, const SVector &rhs)
solves linear system with basis matrix.
void coSolve(SSVector &x, SSVector &y, const SVector &rhsx, SSVector &rhsy)
Sparse version of solving two systems in one call.
SPxId lastLeft() const
returns SPxId of last vector that left the basis.
SPxOut * spxout
message handler
int prevIteration() const
returns the number of iterations prior to the last break in execution
DataArray< SPxId > theBaseId
SPxIds of basic vectors.
primal variable is set to its lower bound
int totalUpdateCount
number of updates
int lastidx
lastIndex(): basis index where last update was done
Desc::Status dualStatus(const SPxId &id) const
dual Status for the variable with ID id of the loaded LP.
const Status * coStatus(void) const
returns the array of covariable Statuses.
Saving LPs in a form suitable for SoPlex.
virtual void factorize()
factorizes the basis matrix.
Status status(int i) const
returns status of variable i.
void clear()
Set vector to 0.
void removedRow(int i)
inform SPxBasis that row i had been removed.
void coSolve(SSVector &x, const SVector &rhs)
Sparse version of coSolve.
dual variable is set to its lower bound
DataArray< Status > * costat
cobasis' status.
int size() const
return nr. of elements.
virtual void loadDesc(const Desc &)
sets up basis.
const Status * rowStatus(void) const
returns the array of row Statuses.
DataArray< Status > colstat
status of columns.
Sparse vectors.Class SVectorBase provides packed sparse vectors. Such are a sparse vectors...
dual variable has two bounds
virtual void solve2right4update(SSVector &x, Vector &y, const SVector &b, SSVector &d)=0
Solves and .
SPxId lastEntered() const
returns SPxId of last vector included to the basis.
Ids for LP rows.Class SPxRowId provides DataKeys for the row indices of an SPxLP. ...
void solve(SSVector &x, const SVector &rhs)
void solve4update(SSVector &x, SSVector &y, const SVector &rhsx, SSVector &rhsy)
solves two systems in one call using only sparse data structures
void solve(Vector &x, const Vector &rhs)
std::string statistics() const
returns statistical information in form of a string.
Save arrays of data objects.
Real getTotalUpdateTime() const
time spent in updates
int nRows() const
returns number of rows.
virtual void solveRight4update(SSVector &x, const SVector &b)=0
Solves . Possibly sets up internal data structures suitable for an optimized subsequent change() call...
virtual void load(SPxSolver *lp, bool initSlackBasis=true)
loads the LP lp to the basis.
virtual void unLoad()
unloads the LP from the basis.
SPxId lastin
lastEntered(): variable entered the base last
int iterCount
number of calls to change() since last manipulation
Status
Status of a variable.
LP has been proven to be primal unbounded.
Wrapper for the system time query methods.
void printMatrixMTX(int number)
Timer * theTime
time spent in updates
int getTotalUpdateCount() const
number of updates performed
Real nonzeroFactor
allowed increase of nonzeros before refactorization.
Real stability() const
returns the stability of the basis matrix.
const Desc & desc() const
bool freeSlinSolver
true iff factor should be freed inside of this object
friend std::ostream & operator<<(std::ostream &os, const Status &stat)
Basis is primal feasible.
SPxSolver * solver() const
returns loaded solver.
int lastDegenCheck() const
returns the number of iterations since the last degeneracy check
bool matrixIsSetup
true iff the pointers in matrix are set up correctly.
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.
DataArray< const SVector *> matrix
pointers to the vectors of the basis matrix.