38 #define HYPERPRICINGTHRESHOLD 5000 39 #define HYPERPRICINGSIZE 100 40 #define SPARSITYFACTOR 0.6 42 #define SPARSITY_TRADEOFF 0.8 45 #define MAXNCLCKSKIPS 32 46 #define SAFETYFACTOR 1e-2 47 #define NINITCALLS 200 83 class SPxSolver :
public SPxLP,
protected SPxBasis
469 spxout = &newOutstream;
561 virtual bool read(std::istream& in,
NameSet* rowNames = 0,
565 virtual void loadLP(
const SPxLP& LP,
bool initSlackBasis =
true);
592 virtual void clear();
609 const NameSet* rowNames,
const NameSet* colNames,
const bool cpxFormat =
false)
const;
617 const NameSet* rowNames = NULL,
const NameSet* colNames = NULL,
const bool cpxFormat =
false)
const;
644 polishObj = _polishObj;
670 m_nonbasicValue = 0.0;
671 m_nonbasicValueUpToDate =
false;
754 virtual void printDisplayLine(
const bool force =
false,
const bool forceHead =
false);
789 assert(m_entertol > 0.0);
796 assert(m_leavetol > 0.0);
803 assert(m_entertol > 0.0);
804 assert(m_leavetol > 0.0);
811 assert(m_entertol > 0.0);
812 assert(m_leavetol > 0.0);
819 assert(m_entertol > 0.0);
820 assert(m_leavetol > 0.0);
839 assert(timerType == theTime->
type());
864 sparsePricingFactor = fac;
893 fullPerturbation = full;
950 virtual void changeObj(
int i,
const Real& newVal,
bool scale =
false);
985 virtual void changeLower(
int i,
const Real& newLower,
bool scale =
false);
996 virtual void changeUpper(
int i,
const Real& newUpper,
bool scale =
false);
1005 virtual void changeBounds(
int i,
const Real& newLower,
const Real& newUpper,
bool scale =
false);
1017 virtual void changeLhs(
int i,
const Real& newLhs,
bool scale =
false);
1028 virtual void changeRhs(
int i,
const Real& newRhs,
bool scale =
false);
1037 virtual void changeRange(
int i,
const Real& newLhs,
const Real& newRhs,
bool scale =
false);
1045 virtual void changeRow(
int i,
const LPRow& newRow,
bool scale =
false);
1052 virtual void changeCol(
int i,
const LPCol& newCol,
bool scale =
false);
1157 return (*thevectors)[i];
1165 ? (*thevectors)[
number(rid)]
1173 ? (*thevectors)[
number(cid)]
1201 return (*thecovectors)[i];
1208 ? (*thecovectors)[
number(rid)]
1216 ? (*thecovectors)[
number(cid)]
1578 theShift +=
MAXIMUM(to - theUBbound[i], 0.0);
1586 theShift +=
MAXIMUM(theLBbound[i] - to, 0.0);
1594 theShift +=
MAXIMUM(to - (*theUbound)[i], 0.0);
1595 (*theUbound)[i] = to;
1602 theShift +=
MAXIMUM((*theLbound)[i] - to, 0.0);
1603 (*theLbound)[i] = to;
1610 theShift +=
MAXIMUM(to - (*theCoUbound)[i], 0.0);
1611 (*theCoUbound)[i] = to;
1618 theShift +=
MAXIMUM((*theCoLbound)[i] - to, 0.0);
1619 (*theCoLbound)[i] = to;
1650 int start = 0,
int incr = 1);
1654 int start = 0,
int incr = 1);
1792 bool leave(
int i,
bool polish =
false);
1837 virtual void init();
1859 initialized =
false;
1864 virtual void reDim();
1906 Real& enterBound,
Real& newUBbound,
2034 const int colsSize = -1)
const;
2082 theCumulativeTime = 0.0;
2212 std::stringstream s;
2214 <<
"Solution time : " << std::setw(10) << std::fixed << std::setprecision(
2215 2) <<
time() << std::endl
2216 <<
"Iterations : " << std::setw(10) <<
iterations() << std::endl;
2224 if(getStartingDecompBasis)
2233 computeDegeneracy = computeDegen;
2338 #endif // _SPXSOLVER_H_ virtual void unShift(void)
remove shift as much as possible.
const VectorBase< Real > & rhs() const
Returns right hand side vector.
void computeFtest()
compute basis feasibility test vector.
virtual Real objValue()
get objective value of current solution.
Real getMaxTime()
the maximum runtime
Real boundrange
absolute range of all bounds in the problem
virtual void ungetEnterVal(SPxId enterId, SPxBasis::Desc::Status enterStat, Real leaveVal, const SVector &vec, StableSum< Real > &objChange)
SPxId coId(int i) const
id of i 'th covector.
virtual void addedRows(int n)
const Vector & ucBound() const
Starting basis has been found and the simplex can be executed as normal.
int iteration() const
returns number of basis changes since last load().
bool enter(SPxId &id, bool polish=false)
virtual void changeRow(int i, const LPRow &newRow, bool scale=false)
void setEnterBound4Col(int, int)
virtual Real shift() const
total current shift amount.
int iterations() const
get number of iterations of current solution.
Bound flipping ratio test ("long step dual") for SoPlex.Class SPxBoundFlippingRT provides an implemen...
free variable fixed to zero.
SPxRowId rId(int n) const
Returns the row identifier for row n.
Real fillFactor
allowed increase in relative fill before refactorization
int getDisplayFreq()
get display frequency
virtual void rejectLeave(int leaveNum, SPxId leaveId, SPxBasis::Desc::Status leaveStat, const SVector *newVec=0)
int getMaxIters()
the maximum number of iterations
virtual void changeObj(SPxColId p_id, const Real &p_newVal, bool scale=false)
const SVector & coVector(int i) const
i 'th covector of LP.
int enterDegenCand
the number of degenerate candidates in the entering algorithm
int nClckSkipsLeft
remaining number of times the clock can be safely skipped
virtual void changeLower(const Vector &newLower, bool scale=false)
UpdateVector primVec
primal vector
SPxBasis::SPxStatus getBasisStatus() const
gets basis status
int boundflips
number of performed bound flips
bool getDualNorms(int &nnormsRow, int &nnormsCol, Real *norms) const
get dual norms
const VectorBase< Real > & upper() const
Returns upper bound vector.
const Vector & fTest() const
Violations of fVec.
virtual Status getPrimal(Vector &vector) const
get solution vector for primal variables.
void getNdualNorms(int &nnormsRow, int &nnormsCol) const
get number of dual norms
DIdxSet updateViols
store indices that were changed in the previous iteration and must be checked in hyper pricing ...
SPxOut * spxout
message handler
bool sparsePricingLeave
These values enable or disable sparse pricing.
THREADLOCAL const Real infinity
bool leave(int i, bool polish=false)
const SPxRatioTester * ratiotester() const
return loaded SPxRatioTester.
DVector * theUbound
Upper bound for vars.
Pricing pricing() const
return current Pricing.
Real objrange
absolute range of all objective coefficients in the problem
LP has beed solved to optimality but unscaled solution contains violations.
void setBasis(const VarStatus rows[], const VarStatus cols[])
set the lp solver's basis.
UpdateVector addVec
storage for thePvec = &addVec
int dualIterations()
return number of iterations done with primal algorithm
std::string statistics() const
returns statistical information in form of a string.
virtual void rejectEnter(SPxId enterId, Real enterTest, SPxBasis::Desc::Status enterStat)
virtual void qualRedCostViolation(Real &maxviol, Real &sumviol) const
get violation of optimality criterion.
Real leavetol() const
feasibility tolerance maintained by ratio test during LEAVE algorithm.
SolutionPolish getSolutionPolishing()
return objective of solution polishing
DVector * theCoUbound
Upper bound for covars.
SSVector * solveVector3
when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic so...
void setSolutionPolishing(SolutionPolish _polishObj)
set objective of solution polishing (0: off, 1: max_basic_slack, 2: min_basic_slack) ...
void computeTest()
compute test vector in ENTERing Simplex.
Status getBasis(VarStatus rows[], VarStatus cols[], const int rowsSize=-1, const int colsSize=-1) const
get current basis, and return solver status.
virtual void setStarter(SPxStarter *starter, const bool destroy=false)
setup starting basis generator to use. If destroy is true, starter will be freed in destructor...
int degenCompIterOffset
the number of iterations performed before the degeneracy level is computed
minimize number of basic slack variables, i.e. more variables in between bounds
void updateFtest()
update basis feasibility test vector.
virtual void reDim()
reset dimensions of vectors according to loaded LP.
Real feastol() const
allowed primal feasibility tolerance.
UpdateVector dualVec
dual vector
void unscaleLPandReloadBasis()
unscales the LP and reloads the basis
Random numbers.Class Random provides random Real variables, i.e. a value variable that gives another ...
virtual void setBasisSolver(SLinSolver *slu, const bool destroy=false)
setup linear solver to use. If destroy is true, slusolver will be freed in destructor.
Real sumDualDegeneracy()
get the sum of dual degeneracy
Type theType
entering or leaving algortihm.
void computePrimalray4Row(Real direction)
Representation
LP basis representation.
virtual void getEnterVals2(int leaveIdx, Real enterMax, Real &leaveBound, StableSum< Real > &objChange)
bool sparsePricingEnterCo
true if sparsePricing is turned on in the entering Simplex
virtual void clearRowObjs()
virtual void clear()
clear all data in solver.
virtual void qualBoundViolation(Real &maxviol, Real &sumviol) const
get violations of bounds.
void setType(Type tp)
set LEAVE or ENTER algorithm.
void setFillFactor(Real f)
set refactor threshold for fill-in in current factor update compared to fill-in in last factorization...
VarStatus basisStatusToVarStatus(SPxBasis::Desc::Status stat) const
converts basis status to VarStatus
void localAddCols(int start)
void clearDualBounds(SPxBasis::Desc::Status, Real &, Real &) const
solve() aborted due to iteration limit.
int leaveDegenCand
the number of degenerate candidates in the leaving algorithm
DecompStatus
Improved dual simplex status.
virtual int terminationIter() const
return iteration limit.
void computePrimalray4Col(Real direction, SPxId enterId)
virtual void perturbMaxLeave(void)
perturb nonbasic bounds.
virtual void changeUpper(const Vector &newUpper, bool scale=false)
int m_maxCycle
maximum steps before cycling is detected.
DataArray< int > isInfeasible
0: index not violated, 1: index violated, 2: index violated and among candidate list ...
No Problem has been loaded.
Safe arrays of arbitrary types.Class Array provides safe arrays of arbitrary type. Array elements are accessed just like ordinary C++ array elements by means of the index operator[](). Safety is provided by.
void setSolverStatus(SPxSolver::Status stat)
setting the solver status external from the solve loop.
Pricing thePricing
full or partial pricing.
int number(const SPxRowId &id) const
Returns the row number of the row with identifier id.
virtual void addedCols(int n)
virtual bool noViols(Real tol) const
check for violations above tol and immediately return false w/o checking the remaining values ...
Abstract ratio test base class.Class SPxRatioTester is the virtual base class for computing the ratio...
bool isId(const SPxId &p_id) const
Is p_id an SPxId ?
DVector primRhs
rhs vector for computing the primal vector
const LPRowSetBase< R > * lprowset() const
Returns the LP as an LPRowSetBase.
const Vector & lcBound() const
virtual void computeFrhsXtra()
virtual void perturbMinEnter(void)
int dim() const
dimension of basis matrix.
void shiftLBbound(int i, Real to)
shift i 'th lbBound to to.
SoPlex start basis generation base class.SPxStarter is the virtual base class for classes generating ...
void setup4solve(SSVector *p_y, SSVector *p_rhs)
Setup vectors to be solved within Simplex loop.
virtual void changeElement(SPxRowId rid, SPxColId cid, const Real &val, bool scale=false)
variable fixed to identical bounds.
Real sparsePricingFactor
enable sparse pricing when viols < factor * dim()
Real getFastCondition(int type=0)
LP has been proven to be primal infeasible.
void setComputeDegenFlag(bool computeDegen)
sets whether the degeneracy is computed at each iteration
void setPrimalBounds()
setup feasibility bounds for entering algorithm
void setLeaveBound4Col(int i, int n)
SSVector * solveVector2rhs
when 2 systems are to be solved at a time; typically for speepest edge weights
bool isTimeLimitReached(const bool forceCheck=false)
returns whether current time limit is reached; call to time() may be skipped unless forceCheck is tru...
Ids for LP columns.Class SPxColId provides DataKeys for the column indices of an SPxLP.
void setSparsePricingFactor(Real fac)
virtual void changeCol(int i, const LPCol &newCol, bool scale=false)
virtual void perturbMaxEnter(void)
perturb basis bounds.
void setOpttol(Real d)
set parameter opttol.
Real time() const
time spent in last call to method solve().
int getDecompIterationLimit() const
returns the iteration limit for the decomposition simplex initialisation
virtual void doPupdate(void)
void setDegenCompOffset(int iterOffset)
sets the offset for the number of iterations before the degeneracy is computed
void setPrimal(Vector &p_vector)
bool freeRatioTester
true iff theratiotester should be freed inside of object
void resetCumulativeTime()
reset cumulative time counter to zero.
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...
Real m_nonbasicValue
nonbasic part of current objective value
const SPxPricer * pricer() const
return loaded SPxPricer.
virtual bool readBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames)
virtual Real value()
current objective value.
bool setDualNorms(int nnormsRow, int nnormsCol, Real *norms)
set dual norms
virtual void computeLeaveCoPrhs()
compute theCoPrhs for leaving Simplex.
Real lastShift
for forcing feasibility.
SPxSolver(Type type=LEAVE, Representation rep=ROW, Timer::TYPE ttype=Timer::USER_TIME)
default constructor.
virtual void setTerminationTime(Real time=infinity)
set time limit.
const LPRowSet & rows() const
return const lp's rows if available.
bool isBasic(const SPxRowId &rid) const
is the rid 'th vector basic ?
Real memFactor
allowed total increase in memory consumption before refactorization
bool freePricer
true iff thepricer should be freed inside of object
SPxColId cId(int n) const
Returns the column identifier for column n.
maximize number of basic slack variables, i.e. more variables on bounds
Representation theRep
row or column representation.
int maxCycle() const
maximum number of degenerate simplex steps before we detect cycling.
Real getDegeneracyLevel(Vector degenvec)
get level of dual degeneracy
virtual void changeCol(SPxColId p_id, const LPCol &p_newCol, bool scale=false)
const Vector & ubBound() const
upper bound for fVec.
virtual void changeRhs(const Vector &newRhs, bool scale=false)
int dualDegeneratePivots()
get number of dual degenerate pivots
const Vector & fRhs() const
right-hand side vector for fVec
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
UpdateVector & coPvec() const
copricing vector.
int remainingRoundsLeave
number of dense rounds/refactorizations until sparsePricing is enabled again
virtual Status getDualfarkas(Vector &vector) const
get dual farkas proof of infeasibility.
virtual void changeBounds(const Vector &newLower, const Vector &newUpper, bool scale=false)
Fast shifting ratio test.Class SPxFastRT is an implementation class of SPxRatioTester providing fast ...
LP is primal infeasible or unbounded.
int m_numCycle
actual number of degenerate steps so far.
int maxIters
maximum allowed iterations.
Real m_entertol
feasibility tolerance maintained during entering algorithm
virtual void changeLhsStatus(int i, Real newLhs, Real oldLhs=0.0)
void setNonzeroFactor(Real f)
set refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix ...
SPxSense
Optimization sense.
virtual void doRemoveRow(int i)
nothing known about basis status (possibly due to a singular basis in transformed problem) ...
virtual void changeRowObj(const Vector &newObj, bool scale=false)
SPxStatus status() const
returns current SPxStatus.
SSVector * solveVector3rhs
when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic so...
Timer::TYPE getTiming()
set timing type
UpdateVector * theRPvec
row pricing vector
bool m_pricingViolCoUpToDate
true, if the stored violation in coDim is up to date
virtual void getEnterVals(SPxId id, Real &enterTest, Real &enterUB, Real &enterLB, Real &enterVal, Real &enterMax, Real &enterPric, SPxBasis::Desc::Status &enterStat, Real &enterRO, StableSum< Real > &objChange)
SSVector * coSolveVector3
when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic so...
bool isColBasic(int i) const
is the i 'th column vector basic ?
void setSlacks(Vector &p_vector)
void setStatus(SPxStatus stat)
sets basis SPxStatus to stat.
void localAddRows(int start)
virtual void doRemoveCols(int perm[])
Status status() const
Status of solution process.
Real sumPrimalDegeneracy()
get the sum of primal degeneracy
void shiftLPbound(int i, Real to)
shift i 'th lpBound to to.
DVector * theLbound
Lower bound for vars.
SPxSense spxSense() const
Returns the optimization sense.
virtual const SVector * enterVector(const SPxId &p_id)
Get pointer to the id 'th vector.
Real m_pricingViol
maximal feasibility violation of current solution
virtual void unInit()
uninitialize data structures.
virtual void changeRhs(SPxRowId p_id, const Real &p_newRhs, bool scale=false)
virtual void changeLower(SPxColId p_id, const Real &p_newLower, bool scale=false)
Dense vector with semi-sparse vector for updates.
std::ostream & operator<<(std::ostream &s, const VectorBase< R > &vec)
Output operator.
Real entertol() const
feasibility tolerance maintained by ratio test during ENTER algorithm.
SPxColId colId(int i) const
ColId of i 'th column.
void performSolutionPolishing()
SPxBasis::Desc::Status varStatusToBasisStatusRow(int row, VarStatus stat) const
converts VarStatus to basis status for rows
LP has been solved to optimality.
virtual void setPricer(SPxPricer *pricer, const bool destroy=false)
setup pricer to use. If destroy is true, pricer will be freed in destructor.
void getUpper(Vector &p_up) const
copy upper bound vector to p_up.
Real cumulativeTime() const
cumulative time spent in all calls to method solve().
const Vector & lbBound() const
lower bound for fVec.
virtual void changeSense(SPxSense sns)
virtual bool precisionReached(Real &newpricertol) const
is the solution precise enough, or should we increase delta() ?
virtual void setLeaveBounds()
const SVSet * thecovectors
the LP coVectors according to representation
void getLower(Vector &p_low) const
copy lower bound vector to p_low.
virtual void changeElement(int i, int j, const Real &val, bool scale=false)
void computeEnterCoPrhs4Col(int i, int n)
virtual Real terminationTime() const
return time limit.
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
SPxId id(int i) const
id of i 'th vector.
UpdateVector & fVec() const
feasibility vector.
virtual void reinitializeVecs()
setup all vecs fresh
solve() aborted due to commence decomposition simplex
void setDisplayFreq(int freq)
set display frequency
solve() aborted due to time limit.
DVector theLBbound
Lower Basic Feasibility bound.
SPxStarter * starter() const
return current starter.
virtual void setupPupdate(void)
virtual bool writeState(const char *filename, const NameSet *rowNames=NULL, const NameSet *colNames=NULL, const bool cpxFormat=false) const
virtual void changeLhs(const Vector &newLhs, bool scale=false)
bool isBasic(SPxBasis::Desc::Status stat) const
does stat describe a basic index ?
DVector coWeights
store dual norms
Real delta() const
guaranteed primal and dual bound violation for optimal solution, returning the maximum of feastol() a...
int info
user information to store values -1, 0, +1
virtual void qualSlackViolation(Real &maxviol, Real &sumviol) const
get the residuum |Ax-b|.
Real siderange
absolute range of all side in the problem
void setDual(Vector &p_vector)
solve() aborted to exit decomposition simplex
const VectorBase< Real > & lhs() const
Returns left hand side vector.
static Timer * switchTimer(Timer *timer, Timer::TYPE ttype)
bool getComputeDegeneracy() const
returns whether the degeneracy is computed in each iteration
SPxSolver & operator=(const SPxSolver &base)
assignment operator
int primalCount
number of primal iterations
Abstract pricer base class.Class SPxPricer is a pure virtual class defining the interface for pricer ...
SolutionPolish
objective for solution polishing
void shiftPvec()
Perform initial shifting to optain an feasible or pricable basis.
Dense vector with semi-sparse vector for updatesIn many algorithms vectors are updated in every itera...
SSVector * coSolveVector3rhs
when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic so...
virtual void changeLhs(SPxRowId p_id, const Real &p_newLhs, bool scale=false)
variable set to its upper bound.
int primalDegeneratePivots()
get number of primal degenerate pivots
void shiftUCbound(int i, Real to)
shift i 'th ucBound to to.
void updateTest()
recompute test vector.
bool updateNonbasicValue(Real objChange)
Dynamic index set.Class DIdxSet provides dynamic IdxSet in the sense, that no restrictions are posed ...
DVector theURbound
Upper Row Feasibility bound.
DVectorBase< R > up
vector of upper bounds.
bool freeStarter
true iff thestarter should be freed inside of object
int getDegenCompOffset() const
gets the offset for the number of iterations before the degeneracy is computed
bool sparsePricingEnter
true if sparsePricing is turned on in the entering Simplex for slack variables
int polishIterations()
return number of iterations done with primal algorithm
virtual Real time() const =0
int remainingRoundsEnterCo
int boundFlips() const
get number of bound flips.
void useFullPerturbation(bool full)
perturb entire problem or only the bounds relevant to the current pivot
int leaveCycles
the number of degenerate steps during the leaving algorithm
virtual Real getFastCondition()
void setup4coSolve(SSVector *p_y, SSVector *p_rhs)
Setup vectors to be cosolved within Simplex loop.
virtual void changeLowerStatus(int i, Real newLower, Real oldLower=0.0)
Timer * theTime
time spent in last call to method solve()
virtual void getLeaveVals(int i, SPxBasis::Desc::Status &leaveStat, SPxId &leaveId, Real &leaveMax, Real &leavebound, int &leaveNum, StableSum< Real > &objChange)
const Vector & test() const
Violations of pVec.
void shiftUBbound(int i, Real to)
shift i 'th ubBound to to.
Real m_leavetol
feasibility tolerance maintained during leaving algorithm
(In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is...
virtual void loadLP(const SPxLP &LP, bool initSlackBasis=true)
copy LP.
variable set to its lower bound.
DVector theUBbound
Upper Basic Feasibility bound.
Real m_pricingViolCo
maximal feasibility violation of current solution in coDim
virtual void changeRhsStatus(int i, Real newRhs, Real oldRhs=0.0)
DVector * theCoLbound
Lower bound for covars.
Real epsilon() const
values are considered to be 0.
void computeDualfarkas4Col(Real direction)
virtual void changeMaxObj(const Vector &newObj, bool scale=false)
Debugging, floating point type and parameter definitions.
virtual void loadBasis(const SPxBasis::Desc &)
set a start basis.
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...
bool isCoId(const SPxId &p_id) const
Is p_id a CoId.
Status getResult(Real *value=0, Vector *primal=0, Vector *slacks=0, Vector *dual=0, Vector *reduCost=0)
get all results of last solve.
int totalboundflips
total number of bound flips
int polishCount
number of solution polishing iterations
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
virtual bool writeBasisFile(const char *filename, const NameSet *rowNames, const NameSet *colNames, const bool cpxFormat=false) const
SolutionPolish polishObj
objective of solution polishing
UpdateVector & pVec() const
pricing vector.
virtual void changeRowObj(SPxRowId p_id, const Real &p_newVal, bool scale=false)
bool fullPerturbation
whether to perturb the entire problem or just the bounds relevant for the current pivot ...
const Vector & lpBound() const
SSVector * solveVector2
when 2 systems are to be solved at a time; typically for speepest edge weights
DVector theLRbound
Lower Row Feasibility bound.
void perturbMin(const UpdateVector &vec, Vector &low, Vector &up, Real eps, Real delta, int start=0, int incr=1)
DVector theUCbound
Upper Column Feasibility bound.
virtual void setTerminationIter(int iteration=-1)
set iteration limit.
bool isInitialized() const
has the internal data been initialized?
DecompStatus getDecompStatus() const
returns whether a basis needs to be found for the improved dual simplex
void computeLeaveCoPrhs4Col(int i, int n)
virtual bool read(std::istream &in, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
read LP from input stream.
int decompIterationLimit
the maximum number of iterations before the decomposition simplex is aborted.
void computeEnterCoPrhs4Row(int i, int n)
Status m_status
status of algorithm.
Starting basis has not been found yet.
SPxBasis::Desc::Status covarStatus(int i) const
Status of i 'th covariable.
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)
bool isBasisValid(DataArray< VarStatus > rows, DataArray< VarStatus > cols)
check a given basis for validity.
virtual bool terminate()
Termination criterion.
void computeLeaveCoPrhs4Row(int i, int n)
void shiftLCbound(int i, Real to)
shift i 'th lcBound to to.
R getEpsilon() const
Returns the non-zero epsilon used.
Real theCumulativeTime
cumulative time spent in all calls to method solve()
virtual void setTester(SPxRatioTester *tester, const bool destroy=false)
setup ratio-tester to use. If destroy is true, tester will be freed in destructor.
Real dualDegenSum
the sum of the dual degeneracy percentage
SSVector * coSolveVector2rhs
when 2 systems are to be solved at a time; typically for speepest edge weights
virtual void printDisplayLine(const bool force=false, const bool forceHead=false)
print display line of flying table
solve() aborted due to detection of cycling.
virtual void changeMaxObj(SPxColId p_id, const Real &p_newVal, bool scale=false)
void updateCoTest()
recompute coTest vector.
DVectorBase< R > low
vector of lower bounds.
bool isBasic(const SPxColId &cid) const
is the cid 'th vector basic ?
SPxSense sense() const
optimization sense.
Set of LP columns.Class LPColSetBase implements a set of LPColBase%s. Unless for memory limitations...
virtual void clearRowObjs()
Clears row objective function values for all rows.
bool isBasic(int i) const
is the i 'th vector basic ?
bool m_nonbasicValueUpToDate
true, if the stored objValue is up to date
virtual void getLeaveVals2(Real leaveMax, SPxId enterId, Real &enterBound, Real &newUBbound, Real &newLBbound, Real &newCoPrhs, StableSum< Real > &objChange)
void setIntegralityInformation(int ncols, int *intInfo)
pass integrality information about the variables to the solver
Save arrays of arbitrary types.
void setEnterBound4Row(int, int)
void setConditionInformation(int condInfo)
print condition number within the usual output
DVector theLCbound
Lower Column Feasibility bound.
virtual void clearUpdateVecs(void)
int leaveCount
number of LEAVE iterations
int numCycle() const
actual number of degenerate simplex steps encountered so far.
Saving LPs in a form suitable for SoPlex.
const LPColSetBase< R > * lpcolset() const
Returns the LP as an LPColSetBase.
nothing known on loaded problem.
don't perform modifications on optimal basis
VarStatus getBasisRowStatus(int row) const
gets basis status for a single row
bool isConsistent() const
check consistency.
const Vector & upBound() const
VarStatus getBasisColStatus(int col) const
gets basis status for a single column
const Vector & coTest() const
violations of coPvec.
int subversion() const
return the internal subversion of SPxSolver as number
void computeFrhs()
compute feasibility vector from scratch.
virtual void perturbMinLeave(void)
virtual void changeUpperStatus(int i, Real newUpper, Real oldLower=0.0)
bool isSPxRowId() const
is id a row id?
SPxBasis::Desc::Status varStatusToBasisStatusCol(int col, VarStatus stat) const
converts VarStatus to basis status for columns
SPxRatioTester * theratiotester
virtual Real terminationValue() const
return objective limit.
void shiftFvec()
Perform initial shifting to optain an feasible or pricable basis.
bool isValid() const
returns TRUE iff the id is a valid column or row identifier.
int enterCycles
the number of degenerate steps during the entering algorithm
DSVector primalRay
stores primal ray in case of unboundedness
void getLhs(Vector &p_lhs) const
copy lhs value vector to p_lhs.
virtual void changeRow(SPxRowId p_id, const LPRow &p_newRow, bool scale=false)
Type type() const
return current Type.
DataArray< int > isInfeasibleCo
0: index not violated, 1: index violated, 2: index violated and among candidate list ...
Real theShift
sum of all shifts applied to any bound.
int coDim() const
codimension.
virtual Status getRedCost(Vector &vector) const
get vector of reduced costs.
virtual void doRemoveCol(int i)
bool hyperPricingEnter
true if hyper sparse pricing is turned on in the entering Simplex
DSVector dualFarkas
stores dual farkas proof in case of infeasibility
Random random
The random number generator used throughout the whole computation. Its seed can be modified...
int enterCount
number of ENTER iterations
const SLinSolver * slinSolver() const
return loaded SLinSolver.
const Vector & coPrhs() const
Right-hand side vector for coPvec.
DVector weights
dual pricing norms
int printCondition
printing the current condition number in the log (0 - off, 1 - estimate,exact, 2 - exact)";ratio esti...
Array< UnitVector > unitVecs
array of unit vectors
bool isCoBasic(int i) const
is the i 'th covector basic ?
const SVSet * thevectors
the LP vectors according to representation
DataArray< int > integerVariables
supplementary variable information, 0: continous variable, 1: integer variable
#define SOPLEX_SUBVERSION
virtual void setEnterBounds()
void perturbMax(const UpdateVector &vec, Vector &low, Vector &up, Real eps, Real delta, int start=0, int incr=1)
Real maxTime
maximum allowed time.
bool recomputedVectors
flag to perform clean up step to reduce numerical errors only once
void setFeastol(Real d)
set parameter feastol.
virtual void init()
intialize data structures.
Ids for LP rows.Class SPxRowId provides DataKeys for the row indices of an SPxLP. ...
virtual void doRemoveRows(int perm[])
bool initialized
true, if all vectors are setup.
virtual void computeEnterCoPrhs()
compute theCoPrhs for entering Simplex.
void forceRecompNonbasicValue()
virtual void qualConstraintViolation(Real &maxviol, Real &sumviol) const
get violation of constraints.
bool weightsAreSetup
are the dual norms already set up?
const SVector & vector(int i) const
i 'th vector.
void initRep(Representation p_rep)
initialize ROW or COLUMN representation.
SSVector & delta()
update vector , writeable
Real opttol() const
allowed optimality, i.e., dual feasibility tolerance.
bool isRowBasic(int i) const
is the i 'th row vector basic ?
bool m_pricingViolUpToDate
true, if the stored violation is up to date
std::string statistics() const
returns statistical information in form of a string.
void hyperPricing(bool h)
enable or disable hyper sparse pricing
void getRhs(Vector &p_rhs) const
copy rhs value vector to p_rhs.
Real objLimit
< the number of calls to the method isTimeLimitReached()
const LPColSet & cols() const
return const lp's cols if available.
void setOutstream(SPxOut &newOutstream)
void setDecompIterationLimit(int iterationLimit)
sets the iteration limit for the decomposition simplex initialisation
void computePvec()
compute entire pVec().
virtual void setTerminationValue(Real value=infinity)
set objective limit.
bool getStartingDecompBasis
flag to indicate whether the simplex is solved to get the starting improved dual simplex basis ...
void setMemFactor(Real f)
set refactor threshold for memory growth in current factor update compared to the last factorization ...
void computeDualfarkas4Row(Real direction, SPxId enterId)
void computeFrhs2(Vector &, Vector &)
const SPxBasis & basis() const
Return current basis.
void setup4solve2(SSVector *p_y2, SSVector *p_rhs2)
Setup vectors to be solved within Simplex loop.
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)
SSVector * coSolveVector2
when 2 systems are to be solved at a time; typically for speepest edge weights
virtual void reLoad()
reload LP.
virtual Status solve()
solve loaded LP.
virtual Real maxInfeas() const
maximal infeasibility of basis
DIdxSet infeasibilitiesCo
Wrapper for the system time query methods.
DVector dualRhs
rhs vector for computing the dual vector
bool hyperPricingLeave
true if hyper sparse pricing is turned on in the leaving Simplex
int num() const
Current number of SVectorBases.
const VectorBase< Real > & lower() const
Returns (internal and possibly scaled) lower bound vector.
void setTiming(Timer::TYPE ttype)
set timing type
virtual void computeFrhs1(const Vector &, const Vector &)
Real nonzeroFactor
allowed increase of nonzeros before refactorization.
void setDecompStatus(DecompStatus decomp_stat)
turn on or off the improved dual simplex.
SPxRowId rowId(int i) const
RowId of i 'th inequality.
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.
Real nonbasicValue()
Compute part of objective value.
solve() aborted due to objective limit.
columnwise representation.
int version() const
return the version of SPxSolver as number like 123 for 1.2.3
void setRedCost(Vector &p_vector)
virtual Status getDual(Vector &vector) const
get current solution vector for dual variables.
Basis is singular, numerical troubles?
const SVector & unitVector(int i) const
return i 'th unit vector.
virtual Status getPrimalray(Vector &vector) const
get primal ray in case of unboundedness.
UpdateVector * theCPvec
column pricing vector
virtual void factorize()
Factorize basis matrix.
void resetClockStats()
resets clock average statistics
LP has a usable Basis (maybe LP is changed).
int primalIterations()
return number of iterations done with primal algorithm
virtual Status getSlacks(Vector &vector) const
get vector of slack variables.
void setBasisStatus(SPxBasis::SPxStatus stat)
set the lp solver's basis status.
void setPricing(Pricing pr)
set FULL or PARTIAL pricing.
LP has been proven to be primal unbounded.
SPxBasis::Desc::Status varStatus(int i) const
Status of i 'th variable.
void setup4coSolve2(SSVector *p_z, SSVector *p_rhs)
Setup vectors to be cosolved within Simplex loop.
virtual TYPE type()=0
return type of timer
bool isValid() const
returns TRUE, iff the DataKey is valid.
void setDelta(Real d)
set parameter delta, i.e., set feastol and opttol to same value.
Timer::TYPE timerType
type of timer (user or wallclock)
virtual void changeUpper(SPxColId p_id, const Real &p_newUpper, bool scale=false)
void computeCoTest()
compute coTest vector.
void calculateProblemRanges()
determine ranges of problem values for bounds, sides and objective to assess numerical difficulties ...
Real primalDegenSum
the sum of the primal degeneracy percentage