Scippy

SoPlex

Sequential object-oriented simPlex

Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorithm. It provids two basis representations, namely a column basis and a row basis (see Representation). For both representations, a primal and dual algorithm is available (see Type). More...

#include <spxsolver.h>

Inheritance diagram for SPxSolver:

Public Types

Data Types
enum  Representation { ROW = -1, COLUMN = 1 }
 LP basis representation. More...
 
enum  Type { ENTER = -1, LEAVE = 1 }
 Algorithmic type. More...
 
enum  Pricing { FULL, PARTIAL }
 Pricing type. More...
 
enum  VarStatus {
  ON_UPPER, ON_LOWER, FIXED, ZERO,
  BASIC, UNDEFINED
}
 
enum  Status {
  ERROR = -13, NO_RATIOTESTER = -12, NO_PRICER = -11, NO_SOLVER = -10,
  NOT_INIT = -9, ABORT_CYCLING = -8, ABORT_TIME = -7, ABORT_ITER = -6,
  ABORT_VALUE = -5, SINGULAR = -4, NO_PROBLEM = -3, REGULAR = -2,
  RUNNING = -1, UNKNOWN = 0, OPTIMAL = 1, UNBOUNDED = 2,
  INFEASIBLE = 3, INForUNBD = 4
}
 
- Public Types inherited from SPxLPBase< Real >
enum  SPxSense
 Optimization sense. More...
 

Public Member Functions

void setOutstream (SPxOut &newOutstream)
 
UpdateVectorfVec () const
 feasibility vector.
 
const VectorfRhs () const
 right-hand side vector for fVec
 
const VectorubBound () const
 upper bound for fVec.
 
VectorubBound ()
 upper bound for fVec, writable.
 
const VectorlbBound () const
 lower bound for fVec.
 
VectorlbBound ()
 lower bound for fVec, writable.
 
const VectorfTest () const
 Violations of fVec.
 
UpdateVectorcoPvec () const
 copricing vector.
 
const VectorcoPrhs () const
 Right-hand side vector for coPvec.
 
const VectorucBound () const
 
VectorucBound ()
 upper bound for coPvec.
 
const VectorlcBound () const
 
VectorlcBound ()
 lower bound for coPvec.
 
const VectorcoTest () const
 violations of coPvec.
 
UpdateVectorpVec () const
 pricing vector.
 
const VectorupBound () const
 
VectorupBound ()
 upper bound for pVec.
 
const VectorlpBound () const
 
VectorlpBound ()
 lower bound for pVec.
 
const Vectortest () const
 Violations of pVec.
 
Real computePvec (int i)
 compute and return pVec()[i].
 
void computePvec ()
 compute entire pVec().
 
Real computeTest (int i)
 compute and return test()[i] in ENTERing Simplex.
 
void computeTest ()
 compute test vector in ENTERing Simplex.
 
void testVecs ()
 
Access
int version () const
 return the version of SPxSolver as number like 123 for 1.2.3
 
int subversion () const
 return the internal subversion of SPxSolver as number
 
Representation rep () const
 return the current basis representation.
 
Type type () const
 return current Type.
 
Pricing pricing () const
 return current Pricing.
 
SPxStarterstarter () const
 return current starter.
 
Setup

Before solving an LP with an instance of SPxSolver, the following steps must be performed:

  1. Load the LP by copying an external LP or reading it from an input stream.
  2. Setup the pricer to use by loading an SPxPricer object (if not already done in a previous call).
  3. Setup the ratio test method to use by loading an SPxRatioTester object (if not already done in a previous call).
  4. Setup the linear system solver to use by loading an SLinSolver object (if not already done in a previous call).
  5. Optionally setup an start basis generation method by loading an SPxStarter object.
  6. Optionally setup a start basis by loading a SPxBasis::Desc object.
  7. Optionally switch to another basis Representation by calling method setRep().
  8. Optionally switch to another algorithm Type by calling method setType().

Now the solver is ready for execution. If the loaded LP is to be solved again from scratch, this can be done with method reLoad(). Finally, clear() removes the LP from the solver.

virtual bool read (std::istream &in, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
 read LP from input stream.
 
virtual void loadLP (const SPxLP &LP)
 copy LP.
 
virtual void setSolver (SLinSolver *slu, const bool destroy=false)
 setup linear solver to use. If destroy is true, slusolver will be freed in destructor.
 
virtual void setPricer (SPxPricer *pricer, const bool destroy=false)
 setup pricer to use. If destroy is true, pricer will be freed in destructor.
 
virtual void setTester (SPxRatioTester *tester, const bool destroy=false)
 setup ratio-tester to use. If destroy is true, tester will be freed in destructor.
 
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.
 
virtual void loadBasis (const SPxBasis::Desc &)
 set a start basis.
 
void initRep (Representation p_rep)
 initialize ROW or COLUMN representation.
 
void setRep (Representation p_rep)
 switch to ROW or COLUMN representation if not already used.
 
void setType (Type tp)
 set LEAVE or ENTER algorithm.
 
void setPricing (Pricing pr)
 set FULL or PARTIAL pricing.
 
virtual void reLoad ()
 reload LP.
 
virtual void clear ()
 clear all data in solver.
 
virtual bool readBasisFile (const char *filename, const NameSet *rowNames, const NameSet *colNames)
 
virtual bool writeBasisFile (const char *filename, const NameSet *rowNames, const NameSet *colNames, const bool cpxFormat=false) const
 
virtual bool writeState (const char *filename, const NameSet *rowNames=NULL, const NameSet *colNames=NULL, const bool cpxFormat=false) const
 
Solving LPs
virtual Status solve ()
 solve loaded LP.
 
Status status () const
 Status of solution process.
 
virtual Real value ()
 current objective value.
 
bool updateNonbasicValue (Real objChange)
 
void forceRecompNonbasicValue ()
 
virtual Status getPrimal (Vector &vector) const
 get solution vector for primal variables.
 
virtual Status getSlacks (Vector &vector) const
 get vector of slack variables.
 
virtual Status getDual (Vector &vector) const
 get current solution vector for dual variables.
 
virtual Status getRedCost (Vector &vector) const
 get vector of reduced costs.
 
virtual Status getPrimalray (Vector &vector) const
 get primal ray in case of unboundedness.
 
virtual Status getDualfarkas (Vector &vector) const
 get dual farkas proof of infeasibility.
 
virtual void printDisplayLine (const bool force=false)
 print display line of flying table
 
virtual bool terminate ()
 Termination criterion.
 
Control Parameters
Real epsilon () const
 values $|x| < \epsilon$ are considered to be 0.
 
Real entertol () const
 feasibility tolerance maintained by ratio test during ENTER algorithm.
 
Real leavetol () const
 feasibility tolerance maintained by ratio test during LEAVE algorithm.
 
Real feastol () const
 allowed primal feasibility tolerance.
 
Real opttol () const
 allowed optimality, i.e., dual feasibility tolerance.
 
Real delta () const
 guaranteed primal and dual bound violation for optimal solution, returning the maximum of feastol() and opttol(), i.e., the less tight tolerance.
 
void setFeastol (Real d)
 set parameter feastol.
 
void setOpttol (Real d)
 set parameter opttol.
 
void setDelta (Real d)
 set parameter delta, i.e., set feastol and opttol to same value.
 
void setTiming (Timer::TYPE ttype)
 set timing type
 
Timer::TYPE getTiming ()
 set timing type
 
void setDisplayFreq (int freq)
 set display frequency
 
void setSparsePricingFactor (Real fac)
 
void hyperPricing (bool h)
 enable or disable hyper sparse pricing
 
int maxCycle () const
 maximum number of degenerate simplex steps before we detect cycling.
 
int numCycle () const
 actual number of degenerate simplex steps encountered so far.
 
Modification
virtual void changeObj (const Vector &newObj)
 
virtual void changeObj (int i, const Real &newVal)
 
virtual void changeObj (SPxColId p_id, const Real &p_newVal)
 
virtual void changeMaxObj (const Vector &newObj)
 
virtual void changeMaxObj (int i, const Real &newVal)
 
virtual void changeMaxObj (SPxColId p_id, const Real &p_newVal)
 
virtual void changeRowObj (const Vector &newObj)
 
virtual void changeRowObj (int i, const Real &newVal)
 
virtual void changeRowObj (SPxRowId p_id, const Real &p_newVal)
 
virtual void clearRowObjs ()
 
virtual void changeLowerStatus (int i, Real newLower, Real oldLower=0.0)
 
virtual void changeLower (const Vector &newLower)
 
virtual void changeLower (int i, const Real &newLower)
 
virtual void changeLower (SPxColId p_id, const Real &p_newLower)
 
virtual void changeUpperStatus (int i, Real newUpper, Real oldLower=0.0)
 
virtual void changeUpper (const Vector &newUpper)
 
virtual void changeUpper (int i, const Real &newUpper)
 
virtual void changeUpper (SPxColId p_id, const Real &p_newUpper)
 
virtual void changeBounds (const Vector &newLower, const Vector &newUpper)
 
virtual void changeBounds (int i, const Real &newLower, const Real &newUpper)
 
virtual void changeBounds (SPxColId p_id, const Real &p_newLower, const Real &p_newUpper)
 
virtual void changeLhsStatus (int i, Real newLhs, Real oldLhs=0.0)
 
virtual void changeLhs (const Vector &newLhs)
 
virtual void changeLhs (int i, const Real &newLhs)
 
virtual void changeLhs (SPxRowId p_id, const Real &p_newLhs)
 
virtual void changeRhsStatus (int i, Real newRhs, Real oldRhs=0.0)
 
virtual void changeRhs (const Vector &newRhs)
 
virtual void changeRhs (int i, const Real &newRhs)
 
virtual void changeRhs (SPxRowId p_id, const Real &p_newRhs)
 
virtual void changeRange (const Vector &newLhs, const Vector &newRhs)
 
virtual void changeRange (int i, const Real &newLhs, const Real &newRhs)
 
virtual void changeRange (SPxRowId p_id, const Real &p_newLhs, const Real &p_newRhs)
 
virtual void changeRow (int i, const LPRow &newRow)
 
virtual void changeRow (SPxRowId p_id, const LPRow &p_newRow)
 
virtual void changeCol (int i, const LPCol &newCol)
 
virtual void changeCol (SPxColId p_id, const LPCol &p_newCol)
 
virtual void changeElement (int i, int j, const Real &val)
 
virtual void changeElement (SPxRowId rid, SPxColId cid, const Real &val)
 
virtual void changeSense (SPxSense sns)
 
Dimension and codimension
int dim () const
 dimension of basis matrix.
 
int coDim () const
 codimension.
 
Variables and Covariables

Class SPxLP introduces SPxIds to identify row or column data of an LP. SPxSolver uses this concept to access data with respect to the chosen representation.

SPxId id (int i) const
 id of i 'th vector.
 
SPxId coId (int i) const
 id of i 'th covector.
 
bool isId (const SPxId &p_id) const
 Is p_id an SPxId ?
 
bool isCoId (const SPxId &p_id) const
 Is p_id a CoId.
 
Vectors and Covectors
const SVectorvector (int i) const
 i 'th vector.
 
const SVectorvector (const SPxRowId &rid) const
 
const SVectorvector (const SPxColId &cid) const
 
const SVectorvector (const SPxId &p_id) const
 vector associated to p_id.
 
const SVectorcoVector (int i) const
 i 'th covector of LP.
 
const SVectorcoVector (const SPxRowId &rid) const
 
const SVectorcoVector (const SPxColId &cid) const
 
const SVectorcoVector (const SPxId &p_id) const
 coVector associated to p_id.
 
const SVectorunitVector (int i) const
 return i 'th unit vector.
 
Variable status

The Simplex basis assigns a Status to each variable and covariable. Depending on the representation, the status indicates that the corresponding vector is in the basis matrix or not.

SPxBasis::Desc::Status varStatus (int i) const
 Status of i 'th variable.
 
SPxBasis::Desc::Status covarStatus (int i) const
 Status of i 'th covariable.
 
bool isBasic (SPxBasis::Desc::Status stat) const
 does stat describe a basic index ?
 
bool isBasic (const SPxId &p_id) const
 is the p_id 'th vector basic ?
 
bool isBasic (const SPxRowId &rid) const
 is the rid 'th vector basic ?
 
bool isBasic (const SPxColId &cid) const
 is the cid 'th vector basic ?
 
bool isRowBasic (int i) const
 is the i 'th row vector basic ?
 
bool isColBasic (int i) const
 is the i 'th column vector basic ?
 
bool isBasic (int i) const
 is the i 'th vector basic ?
 
bool isCoBasic (int i) const
 is the i 'th covector basic ?
 
Shifting

The task of the ratio test (implemented in SPxRatioTester classes) is to select a variable for the basis update, such that the basis remains priced (i.e. both, the pricing and copricing vectors satisfy their bounds) or feasible (i.e. the feasibility vector satisfies its bounds). However, this can lead to numerically instable basis matrices or – after accumulation of various errors – even to a singular basis matrix.

The key to overcome this problem is to allow the basis to become "a bit" infeasible or unpriced, in order provide a better choice for the ratio test to select a stable variable. This is equivalent to enlarging the bounds by a small amount. This is referred to as shifting.

These methods serve for shifting feasibility bounds, either in order to maintain numerical stability or initially for computation of phase 1. The sum of all shifts applied to any bound is stored in theShift.

The following methods are used to shift individual bounds. They are mainly intended for stable implenentations of SPxRatioTester.

void shiftFvec ()
 Perform initial shifting to optain an feasible or pricable basis.
 
void shiftPvec ()
 Perform initial shifting to optain an feasible or pricable basis.
 
void shiftUBbound (int i, Real to)
 shift i 'th ubBound to to.
 
void shiftLBbound (int i, Real to)
 shift i 'th lbBound to to.
 
void shiftUPbound (int i, Real to)
 shift i 'th upBound to to.
 
void shiftLPbound (int i, Real to)
 shift i 'th lpBound to to.
 
void shiftUCbound (int i, Real to)
 shift i 'th ucBound to to.
 
void shiftLCbound (int i, Real to)
 shift i 'th lcBound to to.
 
void testBounds () const
 
virtual Real shift () const
 total current shift amount.
 
virtual void unShift (void)
 remove shift as much as possible.
 
virtual void qualConstraintViolation (Real &maxviol, Real &sumviol) const
 get violation of constraints.
 
virtual void qualBoundViolation (Real &maxviol, Real &sumviol) const
 get violations of bounds.
 
virtual void qualSlackViolation (Real &maxviol, Real &sumviol) const
 get the residuum |Ax-b|.
 
virtual void qualRedCostViolation (Real &maxviol, Real &sumviol) const
 get violation of optimality criterion.
 
SPxRowId rowId (int i) const
 RowId of i 'th inequality.
 
SPxColId colId (int i) const
 ColId of i 'th column.
 
 SPxSolver (Type type=LEAVE, Representation rep=ROW, Timer::TYPE ttype=Timer::USER_TIME)
 default constructor.
 
virtual ~SPxSolver ()
 
bool isConsistent () const
 check consistency.
 
SPxSolveroperator= (const SPxSolver &base)
 assignment operator
 
 SPxSolver (const SPxSolver &base)
 copy constructor
 
- Public Member Functions inherited from SPxLPBase< Real >
void setOutstream (SPxOut &newOutstream)
 
 SPxLPBase ()
 Default constructor.
 
 SPxLPBase (const SPxLPBase< Real > &old)
 Copy constructor.
 
 SPxLPBase (const SPxLPBase< S > &old)
 Copy constructor.
 
virtual ~SPxLPBase ()
 Destructor.
 
SPxLPBase< Real > & operator= (const SPxLPBase< Real > &old)
 Assignment operator.
 
SPxLPBase< Real > & operator= (const SPxLPBase< S > &old)
 Assignment operator.
 
int nRows () const
 Returns number of rows in LP.
 
int nCols () const
 Returns number of columns in LP.
 
int nNzos () const
 Returns number of nonzeros in LP.
 
Real minAbsNzo () const
 Absolute smallest non-zero element in LP.
 
Real maxAbsNzo () const
 Absolute biggest non-zero element in LP.
 
void getRow (int i, LPRowBase< Real > &row) const
 Gets i 'th row.
 
void getRow (const SPxRowId &id, LPRowBase< Real > &row) const
 Gets row with identifier id.
 
void getRows (int start, int end, LPRowSetBase< Real > &set) const
 Gets rows start, ... end.
 
const SVectorBase< Real > & rowVector (int i) const
 Gets row vector of row i.
 
const SVectorBase< Real > & rowVector (const SPxRowId &id) const
 Gets row vector of row with identifier id.
 
const VectorBase< Real > & rhs () const
 Returns right hand side vector.
 
const Realrhs (int i) const
 
const Realrhs (const SPxRowId &id) const
 Returns right hand side of row with identifier id.
 
const VectorBase< Real > & lhs () const
 Returns left hand side vector.
 
const Reallhs (int i) const
 
const Reallhs (const SPxRowId &id) const
 Returns left hand side of row with identifier id.
 
void getRowObj (VectorBase< Real > &prowobj) const
 Gets row objective function vector.
 
Real rowObj (int i) const
 
Real rowObj (const SPxRowId &id) const
 Returns row objective function value of row with identifier id.
 
const VectorBase< Real > & maxRowObj () const
 
const RealmaxRowObj (int i) const
 
const RealmaxRowObj (const SPxRowId &id) const
 Returns row objective function value of row with identifier id.
 
LPRowBase< Real >::Type rowType (int i) const
 Returns the inequality type of the i'th LPRow.
 
LPRowBase< Real >::Type rowType (const SPxRowId &id) const
 Returns the inequality type of the row with identifier key.
 
void getCol (int i, LPColBase< Real > &col) const
 Gets i 'th column.
 
void getCol (const SPxColId &id, LPColBase< Real > &col) const
 Gets column with identifier id.
 
void getCols (int start, int end, LPColSetBase< Real > &set) const
 Gets columns start, ..., end.
 
const SVectorBase< Real > & colVector (int i) const
 Returns column vector of column i.
 
const SVectorBase< Real > & colVector (const SPxColId &id) const
 Returns column vector of column with identifier id.
 
void getObj (VectorBase< Real > &pobj) const
 Gets objective vector.
 
Real obj (int i) const
 Returns objective value of column i.
 
Real obj (const SPxColId &id) const
 Returns objective value of column with identifier id.
 
const VectorBase< Real > & maxObj () const
 Returns objective vector for maximization problem.
 
const RealmaxObj (int i) const
 Returns objective value of column i for maximization problem.
 
const RealmaxObj (const SPxColId &id) const
 Returns objective value of column with identifier id for maximization problem.
 
const VectorBase< Real > & upper () const
 Returns upper bound vector.
 
const Realupper (int i) const
 Returns upper bound of column i.
 
const Realupper (const SPxColId &id) const
 Returns upper bound of column with identifier id.
 
const VectorBase< Real > & lower () const
 Returns lower bound vector.
 
const Reallower (int i) const
 Returns lower bound of column i.
 
const Reallower (const SPxColId &id) const
 Returns lower bound of column with identifier id.
 
SPxSense spxSense () const
 Returns the optimization sense.
 
const RealobjOffset () const
 Returns the objective function value offset.
 
int number (const SPxRowId &id) const
 Returns the row number of the row with identifier id.
 
int number (const SPxColId &id) const
 Returns the column number of the column with identifier id.
 
int number (const SPxId &id) const
 Returns the row or column number for identifier id.
 
SPxRowId rId (int n) const
 Returns the row identifier for row n.
 
SPxColId cId (int n) const
 Returns the column identifier for column n.
 
virtual void addRow (const LPRowBase< Real > &row)
 
virtual void addRow (const Real &lhsValue, const SVectorBase< Real > &rowVec, const Real &rhsValue)
 
void addRow (const S *lhsValue, const S *rowValues, const int *rowIndices, int rowSize, const S *rhsValue)
 
virtual void addRow (SPxRowId &id, const LPRowBase< Real > &row)
 Adds row to LPRowSetBase.
 
virtual void addRows (const LPRowSetBase< Real > &pset)
 
void addRows (const S *lhsValues, const S *rowValues, const int *rowIndices, const int *rowStarts, const int *rowLengths, const int numRows, const int numValues, const S *rhsValues)
 
virtual void addRows (SPxRowId id[], const LPRowSetBase< Real > &set)
 adds all LPRowBases of pset to LPRowSetBase.
 
virtual void addCol (const LPColBase< Real > &col)
 
virtual void addCol (const Real &objValue, const Real &lowerValue, const SVectorBase< Real > &colVec, const Real &upperValue)
 
void addCol (const S *objValue, const S *lowerValue, const S *colValues, const int *colIndices, int colSize, const S *upperValue)
 
virtual void addCol (SPxColId &id, const LPColBase< Real > &col)
 Adds col to LPColSetVBase.
 
virtual void addCols (const LPColSetBase< Real > &pset)
 
void addCols (const S *objValue, const S *lowerValues, const S *colValues, const int *colIndices, const int *colStarts, const int *colLengths, const int numCols, const int numValues, const S *upperValues)
 
virtual void addCols (SPxColId id[], const LPColSetBase< Real > &set)
 Adds all LPColBases of set to LPColSetBase.
 
virtual void removeRow (int i)
 Removes i 'th row.
 
virtual void removeRow (SPxRowId id)
 Removes row with identifier id.
 
virtual void removeRows (int perm[])
 Removes multiple rows.
 
virtual void removeRows (SPxRowId id[], int n, int perm[]=0)
 
virtual void removeRows (int nums[], int n, int perm[]=0)
 Removes n LPRowBases.
 
virtual void removeRowRange (int start, int end, int perm[]=0)
 Removes rows from start to end (including both).
 
virtual void removeCol (int i)
 Removes i 'th column.
 
virtual void removeCol (SPxColId id)
 Removes column with identifier id.
 
virtual void removeCols (int perm[])
 Removes multiple columns.
 
virtual void removeCols (SPxColId id[], int n, int perm[]=0)
 
virtual void removeCols (int nums[], int n, int perm[]=0)
 Removes n LPCols.
 
virtual void removeColRange (int start, int end, int perm[]=0)
 Removes columns from start to end (including both).
 
virtual bool readLPF (std::istream &in, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
 Reads LP in LP format from input stream in.
 
virtual bool readMPS (std::istream &in, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
 Reads an LP in MPS format from input stream in.
 
virtual bool readFile (const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
 Reads LP from a file.
 
virtual void writeLPF (std::ostream &out, const NameSet *rowNames, const NameSet *colNames, const DIdxSet *p_intvars=0) const
 
virtual void writeMPS (std::ostream &out, const NameSet *rowNames, const NameSet *colNames, const DIdxSet *p_intvars=0) const
 Writes a file in MPS format to out.
 
virtual void writeFile (const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *p_intvars=0) const
 Write loaded LP to filename.
 
void printProblemStatistics (std::ostream &os)
 
virtual void changeObj (const VectorBase< Real > &newObj)
 Changes objective vector to newObj.
 
void changeObj (int i, const S *newVal)
 changes i 'th objective vector element to newVal.
 
virtual void changeMaxObj (const VectorBase< Real > &newObj)
 Changes objective vector to newObj.
 
void changeMaxObj (int i, const S *newVal)
 changes i 'th objective vector element to newVal.
 
virtual void changeLower (const VectorBase< Real > &newLower)
 Changes vector of lower bounds to newLower.
 
void changeLower (int i, const S *newLower)
 changes i 'th lower bound to newLower.
 
virtual void changeUpper (const VectorBase< Real > &newUpper)
 Changes vector of upper bounds to newUpper.
 
void changeUpper (int i, const S *newUpper)
 Changes i 'th upper bound to newUpper.
 
virtual void changeBounds (const VectorBase< Real > &newLower, const VectorBase< Real > &newUpper)
 Changes variable bounds to newLower and newUpper.
 
void changeBounds (int i, const S *newLower, const S *newUpper)
 Changes bounds of column i to newLower and newUpper.
 
virtual void changeLhs (const VectorBase< Real > &newLhs)
 Changes left hand side vector for constraints to newLhs.
 
void changeLhs (int i, const S *newLhs)
 Changes i 'th left hand side value to newLhs.
 
virtual void changeRhs (const VectorBase< Real > &newRhs)
 Changes right hand side vector for constraints to newRhs.
 
virtual void changeRange (const VectorBase< Real > &newLhs, const VectorBase< Real > &newRhs)
 Changes left and right hand side vectors.
 
void changeRange (int i, const S *newLhs, const S *newRhs)
 Changes left and right hand side of row i.
 
virtual void changeRowObj (const VectorBase< Real > &newRowObj)
 Changes row objective function vector to newRowObj.
 
virtual void changeRow (int n, const LPRowBase< Real > &newRow)
 Replaces i 'th row of LP with newRow.
 
virtual void changeRow (SPxRowId id, const LPRowBase< Real > &newRow)
 Replaces row with identifier id with newRow.
 
virtual void changeCol (int n, const LPColBase< Real > &newCol)
 Replaces i 'th column of LP with newCol.
 
virtual void changeCol (SPxColId id, const LPColBase< Real > &newCol)
 Replaces column with identifier id with newCol.
 
void changeElement (int i, int j, const S *val)
 Changes LP element (i, j) to val.
 
virtual void changeSense (SPxSense sns)
 Changes optimization sense to sns.
 
virtual void changeObjOffset (const Real &o)
 
virtual void computePrimalActivity (const VectorBase< Real > &primal, VectorBase< Real > &activity) const
 Computes activity of the rows for a given primal vector; activity does not need to be zero.
 
virtual void addPrimalActivity (const SVectorBase< Real > &primal, VectorBase< Real > &activity) const
 Updates activity of the rows for a given primal vector; activity does not need to be zero.
 
virtual void computeDualActivity (const VectorBase< Real > &dual, VectorBase< Real > &activity) const
 Computes "dual" activity of the columns for a given dual vector, i.e., y^T A; activity does not need to be zero.
 
virtual void addDualActivity (const SVectorBase< Real > &dual, VectorBase< Real > &activity) const
 Updates "dual" activity of the columns for a given dual vector, i.e., y^T A; activity does not need to be zero.
 
virtual void subDualActivity (const VectorBase< Real > &dual, VectorBase< Real > &activity) const
 Updates "dual" activity of the columns for a given dual vector, i.e., y^T A; activity does not need to be zero.
 
bool isConsistent () const
 Consistency check.
 

Public Attributes

DIdxSet infeasibilities
 
DIdxSet infeasibilitiesCo
 
DIdxSet updateViols
 store indices that were changed in the previous iteration and must be checked in hyper pricing
 
DIdxSet updateViolsCo
 
DataArray< int > isInfeasible
 0: index not violated, 1: index violated, 2: index violated and among candidate list
 
DataArray< int > isInfeasibleCo
 0: index not violated, 1: index violated, 2: index violated and among candidate list
 
bool sparsePricingLeave
 These values enable or disable sparse pricing.
 
bool sparsePricingEnter
 true if sparsePricing is turned on in the entering Simplex for slack variables
 
bool sparsePricingEnterCo
 true if sparsePricing is turned on in the entering Simplex
 
bool hyperPricingLeave
 true if hyper sparse pricing is turned on in the leaving Simplex
 
bool hyperPricingEnter
 true if hyper sparse pricing is turned on in the entering Simplex
 
int remainingRoundsLeave
 number of dense rounds/refactorizations until sparsePricing is enabled again
 
int remainingRoundsEnter
 
int remainingRoundsEnterCo
 
SPxOutspxout
 message handler
 
- Public Attributes inherited from SPxLPBase< Real >
SPxOutspxout
 

Protected Member Functions

Precision
virtual bool precisionReached (Real &newpricertol) const
 is the solution precise enough, or should we increase delta() ?
 
Protected helpers
virtual void addedRows (int n)
 
virtual void addedCols (int n)
 
virtual void doRemoveRow (int i)
 
virtual void doRemoveRows (int perm[])
 
virtual void doRemoveCol (int i)
 
virtual void doRemoveCols (int perm[])
 
void clearDualBounds (SPxBasis::Desc::Status, Real &, Real &) const
 
void setDualColBounds ()
 
void setDualRowBounds ()
 
void setPrimalBounds ()
 setup feasibility bounds for entering algorithm
 
void setEnterBound4Col (int, int)
 
void setEnterBound4Row (int, int)
 
virtual void setEnterBounds ()
 
void setLeaveBound4Row (int i, int n)
 
void setLeaveBound4Col (int i, int n)
 
virtual void setLeaveBounds ()
 
- Protected Member Functions inherited from SPxLPBase< Real >
Realrhs_w (int i)
 Returns right hand side of row i.
 
Reallhs_w (int i)
 Returns left hand side of row i.
 
RealmaxRowObj_w (int i)
 Returns objective function value of row i.
 
RealmaxObj_w (int i)
 Returns objective value of column i for maximization problem.
 
Realupper_w (int i)
 Returns upper bound of column i.
 
Reallower_w (int i)
 Returns lower bound of column i.
 
const LPRowSetBase< Real > * lprowset () const
 Returns the LP as an LPRowSetBase.
 
const LPColSetBase< Real > * lpcolset () const
 Returns the LP as an LPColSetBase.
 
void added2Set (SVSetBase< Real > &set, const SVSetBase< Real > &addset, int n)
 
- Protected Member Functions inherited from LPRowSetBase< Real >
 LPRowSetBase (int pmax=-1, int pmemmax=-1)
 Default constructor.
 
 LPRowSetBase (const LPRowSetBase< Real > &rs)
 Copy constructor.
 
 LPRowSetBase (const LPRowSetBase< S > &rs)
 Copy constructor.
 
LPRowSetBase< Real > & operator= (const LPRowSetBase< Real > &rs)
 Assignment operator.
 
LPRowSetBase< Real > & operator= (const LPRowSetBase< S > &rs)
 Assignment operator.
 
virtual ~LPRowSetBase ()
 Destructor.
 
int num () const
 Returns the number of LPRowBases in LPRowSetBase.
 
int max () const
 Returns the maximum number of LPRowBases that fit.
 
const VectorBase< Real > & lhs () const
 Returns the vector of lhs values.
 
const Reallhs (int i) const
 Returns the lhs of the i 'th LPRowBase.
 
const Reallhs (const DataKey &k) const
 Returns the lhs of the LPRowBase with DataKey k in LPRowSetBase.
 
VectorBase< Real > & lhs_w ()
 Returns the vector of lhs values.
 
Reallhs_w (int i)
 Returns the lhs of the i 'th LPRowBase.
 
Reallhs_w (const DataKey &k)
 Returns the lhs of the LPRowBase with DataKey k in LPRowSetBase.
 
const VectorBase< Real > & rhs () const
 Returns the vector of rhs values.
 
const Realrhs (int i) const
 Returns the rhs of the i 'th LPRowBase.
 
const Realrhs (const DataKey &k) const
 Returns the rhs of the LPRowBase with DataKey k in LPRowSetBase.
 
VectorBase< Real > & rhs_w ()
 Returns the vector of rhs values (writeable).
 
Realrhs_w (int i)
 Returns the rhs of the i 'th LPRowBase (writeable).
 
Realrhs_w (const DataKey &k)
 Returns the rhs of the LPRowBase with DataKey k in LPRowSetBase (writeable).
 
const VectorBase< Real > & obj () const
 Returns the vector of objective coefficients.
 
const Realobj (int i) const
 Returns the objective coefficient of the i 'th LPRowBase.
 
const Realobj (const DataKey &k) const
 Returns the objective coefficient of the LPRowBase with DataKey k in LPRowSetBase.
 
VectorBase< Real > & obj_w ()
 Returns the vector of objective coefficients (writeable).
 
Realobj_w (int i)
 Returns the objective coefficient of the i 'th LPRowBase (writeable).
 
Realobj_w (const DataKey &k)
 Returns the objective coefficient of the LPRowBase with DataKey k in LPRowSetBase (writeable).
 
SVectorBase< Real > & rowVector_w (int i)
 Returns a writable rowVector of the i 'th LPRowBase.
 
SVectorBase< Real > & rowVector_w (const DataKey &k)
 Returns a writable rowVector of the LPRowBase with DataKey k.
 
const SVectorBase< Real > & rowVector (int i) const
 Returns the rowVector of the i 'th LPRowBase.
 
const SVectorBase< Real > & rowVector (const DataKey &k) const
 Returns the rowVector of the LPRowBase with DataKey k.
 
LPRowBase< Real >::Type type (int i) const
 Returns the inequalitiy type of the i 'th LPRowBase.
 
LPRowBase< Real >::Type type (const DataKey &k) const
 Returns the inequality type of the LPRowBase with DataKey k.
 
void setType (int i, typename LPRowBase< Real >::Type t)
 Changes the inequality type of row i to type.
 
const Realvalue (int i) const
 Returns the value of the i'th LPRowBase.
 
const Realvalue (const DataKey &k) const
 Returns the value of the LPRowBase with DataKey k.
 
DataKey key (int i) const
 Returns the DataKey of the i 'th LPRowBase in LPRowSetBase.
 
int number (const DataKey &k) const
 Returns the number of the LPRowBase with DataKey k in LPRowSetBase.
 
bool has (const DataKey &k) const
 does DataKey k belong to LPRowSetBase ?
 
void add (const LPRowBase< Real > &row)
 
void add (DataKey &pkey, const LPRowBase< Real > &prow)
 Adds row to LPRowSetBase.
 
void add (const Real &plhs, const SVectorBase< Real > &prowVector, const Real &prhs, const Real &pobj=0)
 Adds LPRowBase consisting of left hand side lhs, row vector rowVector, and right hand side rhs to LPRowSetBase.
 
void add (const S *lhsValue, const S *rowValues, const int *rowIndices, int rowSize, const S *rhsValue, const S *objValue=0)
 Adds LPRowBase consisting of left hand side lhs, row vector rowVector, and right hand side rhs to LPRowSetBase.
 
void add (DataKey &newkey, const S *lhsValue, const S *rowValues, const int *rowIndices, int rowSize, const S *rhsValue, const S *objValue=0)
 Adds LPRowBase consisting of left hand side lhs, row vector rowVector, and right hand side rhs to LPRowSetBase, with DataKey key.
 
void add (DataKey &newkey, const Real &newlhs, const SVectorBase< Real > &newrowVector, const Real &newrhs, const Real &newobj=0)
 Adds LPRowBase consisting of left hand side lhs, row vector rowVector, and right hand side rhs to LPRowSetBase, with DataKey key.
 
void add (const LPRowSetBase< Real > &newset)
 
void add (DataKey keys[], const LPRowSetBase< Real > &set)
 Adds all LPRowBases of set to LPRowSetBase.
 
void xtend (int n, int newmax)
 Extends row n to fit newmax nonzeros.
 
void xtend (const DataKey &pkey, int pnewmax)
 Extends row with DataKey key to fit newmax nonzeros.
 
void add2 (const DataKey &k, int n, const int idx[], const Realval[])
 Adds n nonzero (idx, val)-pairs to rowVector with DataKey k.
 
void add2 (int i, int n, const int idx[], const Realval[])
 Adds n nonzero (idx, val)-pairs to i 'th rowVector.
 
void add2 (int i, int n, const int idx[], const S val[])
 Adds n nonzero (idx, val)-pairs to i 'th rowVector.
 
SVectorBase< Real > & create (int pnonzeros=0, const Real &plhs=0, const Real &prhs=1, const Real &pobj=0)
 Creates new LPRowBase with specified parameters and returns a reference to its row vector.
 
SVectorBase< Real > & create (DataKey &newkey, int nonzeros=0, const Real &newlhs=0, const Real &newrhs=1, const Real &newobj=0)
 Creates new LPRowBase with specified parameters and returns a reference to its row vector.
 
void remove (int i)
 Removes i 'th LPRowBase.
 
void remove (const DataKey &k)
 Removes LPRowBase with DataKey k.
 
void remove (int perm[])
 Removes multiple LPRowBases.
 
void remove (const int nums[], int n)
 Removes n LPRowBases with row numbers given by nums.
 
void remove (const int nums[], int n, int *perm)
 Removes n LPRowBases with row numbers given by nums, Stores permutation of row indices in perm.
 
void clear ()
 Removes all LPRowBases.
 
void reMax (int newmax=0)
 Reallocates memory to be able to store newmax LPRowBases.
 
int memSize () const
 Returns number of used nonzero entries.
 
int memMax () const
 Returns length of nonzero memory.
 
void memRemax (int newmax)
 Reallocates memory to be able to store newmax nonzeros.
 
void memPack ()
 Garbage collection in nonzero memory.
 
bool isConsistent () const
 Checks consistency.
 
const SVSetBase< Real > * rowSet () const
 Returns the complete SVSet.
 
- Protected Member Functions inherited from LPColSetBase< Real >
 LPColSetBase (int pmax=-1, int pmemmax=-1)
 Default constructor.
 
 LPColSetBase (const LPColSetBase< Real > &rs)
 Copy constructor.
 
 LPColSetBase (const LPColSetBase< S > &rs)
 Copy constructor.
 
LPColSetBase< Real > & operator= (const LPColSetBase< Real > &rs)
 Assignment operator.
 
LPColSetBase< Real > & operator= (const LPColSetBase< S > &rs)
 Assignment operator.
 
virtual ~LPColSetBase ()
 Destructor.
 
int num () const
 Returns the number of LPColBases currently in LPColSetBase.
 
int max () const
 Returns maximum number of LPColBases currently fitting into LPColSetBase.
 
const VectorBase< Real > & maxObj () const
 
const RealmaxObj (int i) const
 
const RealmaxObj (const DataKey &k) const
 
VectorBase< Real > & maxObj_w ()
 Returns vector of objective values w.r.t. maximization.
 
RealmaxObj_w (int i)
 Returns objective value (w.r.t. maximization) of i 'th LPColBase in LPColSetBase.
 
RealmaxObj_w (const DataKey &k)
 Returns objective value (w.r.t. maximization) of LPColBase with DataKey k in LPColSetBase.
 
const VectorBase< Real > & lower () const
 
const Reallower (int i) const
 
const Reallower (const DataKey &k) const
 
VectorBase< Real > & lower_w ()
 Returns vector of lower bound values.
 
Reallower_w (int i)
 Returns lower bound of i 'th LPColBase in LPColSetBase.
 
Reallower_w (const DataKey &k)
 Returns lower bound of LPColBase with DataKey k in LPColSetBase.
 
const VectorBase< Real > & upper () const
 
const Realupper (int i) const
 
const Realupper (const DataKey &k) const
 
VectorBase< Real > & upper_w ()
 Returns vector of upper bound values.
 
Realupper_w (int i)
 Returns upper bound of i 'th LPColBase in LPColSetBase.
 
Realupper_w (const DataKey &k)
 Returns upper bound of LPColBase with DataKey k in LPColSetBase.
 
SVectorBase< Real > & colVector_w (int i)
 
SVectorBase< Real > & colVector_w (const DataKey &k)
 Returns writeable colVector of LPColBase with DataKey k in LPColSetBase.
 
const SVectorBase< Real > & colVector (int i) const
 Returns colVector of i 'th LPColBase in LPColSetBase.
 
const SVectorBase< Real > & colVector (const DataKey &k) const
 Returns colVector of LPColBase with DataKey k in LPColSetBase.
 
DataKey key (int i) const
 Returns DataKey of i 'th LPColBase in LPColSetBase.
 
int number (const DataKey &k) const
 Returns number of LPColBase with DataKey k in LPColSetBase.
 
bool has (const DataKey &k) const
 Does DataKey k belong to LPColSetBase ?
 
void add (const LPColBase< Real > &pcol)
 
void add (DataKey &pkey, const LPColBase< Real > &pcol)
 Adds p pcol to LPColSetBase.
 
void add (const Real &pobj, const Real &plower, const SVectorBase< Real > &pcolVector, const Real &pupper)
 
void add (DataKey &newkey, const Real &obj, const Real &newlower, const SVectorBase< Real > &newcolVector, const Real &newupper)
 Adds LPColBase consisting of objective value obj, lower bound lower, column vector colVector and upper bound upper to LPColSetBase.
 
void add (const S *obj, const S *lowerValue, const S *colValues, const int *colIndices, int colSize, const S *upperValue)
 Adds LPColBase consisting of left hand side lhs, column vector colVector, and right hand side rhs to LPColSetBase.
 
void add (DataKey &newkey, const S *objValue, const S *lowerValue, const S *colValues, const int *colIndices, int colSize, const S *upperValue)
 Adds LPColBase consisting of left hand side lhs, column vector colVector, and right hand side rhs to LPColSetBase, with DataKey key.
 
void add (const LPColSetBase< Real > &newset)
 
void add (DataKey keys[], const LPColSetBase< Real > &newset)
 Adds all LPColBases of set to LPColSetBase.
 
void xtend (int n, int newmax)
 Extends column n to fit newmax nonzeros.
 
void xtend (const DataKey &pkey, int pnewmax)
 Extends column with DataKey key to fit newmax nonzeros.
 
void add2 (const DataKey &k, int n, const int idx[], const Realval[])
 
void add2 (int i, int n, const int idx[], const Realval[])
 Adds n nonzero (idx, val)-pairs to i 'th colVector.
 
void add2 (int i, int n, const int idx[], const S val[])
 Adds n nonzero (idx, val)-pairs to i 'th colVector.
 
SVectorBase< Real > & create (int pnonzeros=0, const Real &pobj=1, const Real &plw=0, const Real &pupp=1)
 
SVectorBase< Real > & create (DataKey &newkey, int nonzeros=0, const Real &obj=1, const Real &newlow=0, const Real &newup=1)
 Creates new LPColBase with specified arguments and returns a reference to its column vector.
 
void remove (int i)
 Removes i 'th LPColBase.
 
void remove (const DataKey &k)
 Removes LPColBase with DataKey k.
 
void remove (int perm[])
 Removes multiple elements.
 
void remove (const int nums[], int n)
 Removes LPColBases with numbers nums, where n is the length of the array nums.
 
void remove (const int nums[], int n, int *perm)
 Removes LPColBases with numbers nums, where n is the length of the array nums, and stores the index permutation in array perm.
 
void clear ()
 Removes all LPColBases from the set.
 
void reMax (int newmax=0)
 Reallocates memory to be able to store newmax LPColBases.
 
int memSize () const
 Returns used nonzero memory.
 
int memMax () const
 Returns length of nonzero memory.
 
void memRemax (int newmax)
 Resets length of nonzero memory.
 
void memPack ()
 Garbage collection in nonzero memory.
 
bool isConsistent () const
 Checks consistency.
 
const SVSetBase< Real > * colSet () const
 Returns the complete SVSetBase.
 
- Protected Member Functions inherited from SPxBasis
SPxStatus status () const
 returns current SPxStatus.
 
void setStatus (SPxStatus stat)
 sets basis SPxStatus to stat.
 
void setMaxUpdates (int maxUp)
 change maximum number of iterations until a refactorization is performed
 
int getMaxUpdates () const
 returns maximum number of updates before a refactorization is performed
 
const Descdesc () const
 
Descdesc ()
 returns current basis Descriptor.
 
Desc::Status dualColStatus (int i) const
 dual Status for the i'th column variable of the loaded LP.
 
Desc::Status dualStatus (const SPxColId &id) const
 dual Status for the column variable with ID id of the loaded LP.
 
Desc::Status dualRowStatus (int i) const
 dual Status for the i'th row variable of the loaded LP.
 
Desc::Status dualStatus (const SPxRowId &id) const
 dual Status for the row variable with ID id of the loaded LP.
 
Desc::Status dualStatus (const SPxId &id) const
 dual Status for the variable with ID id of the loaded LP.
 
SPxIdbaseId (int i)
 
SPxId baseId (int i) const
 returns the Id of the i'th basis vector.
 
const SVectorbaseVec (int i) const
 returns the i'th basic vector.
 
SPxId lastEntered () const
 returns SPxId of last vector included to the basis.
 
SPxId lastLeft () const
 returns SPxId of last vector that left the basis.
 
int lastIndex () const
 returns index in basis where last update was done.
 
int lastUpdate () const
 returns number of basis changes since last refactorization.
 
int iteration () const
 returns number of basis changes since last load().
 
SPxSolversolver () const
 returns loaded solver.
 
VectormultBaseWith (Vector &x) const
 Basis-vector product.
 
void multBaseWith (SSVector &x, SSVector &result) const
 Basis-vector product.
 
VectormultWithBase (Vector &x) const
 Vector-basis product.
 
void multWithBase (SSVector &x, SSVector &result) const
 Vector-basis product.
 
Real condition (int maxiters=10, Real tolerance=1e-6)
 
Real getEstimatedCondition ()
 
Real getExactCondition ()
 
Real stability () const
 returns the stability of the basis matrix.
 
void solve (Vector &x, const Vector &rhs)
 
void solve (SSVector &x, const SVector &rhs)
 
void solve4update (SSVector &x, const SVector &rhs)
 solves linear system with basis matrix.
 
void solve4update (SSVector &x, Vector &y, const SVector &rhsx, SSVector &rhsy)
 solves two systems in one call.
 
void solve4update (SSVector &x, SSVector &y, const SVector &rhsx, SSVector &rhsy)
 solves two systems in one call using only sparse data structures
 
void solve4update (SSVector &x, Vector &y, Vector &y2, const SVector &rhsx, SSVector &rhsy, SSVector &rhsy2)
 solves three systems in one call.
 
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
 
void coSolve (Vector &x, const Vector &rhs)
 Cosolves linear system with basis matrix.
 
void coSolve (SSVector &x, const SVector &rhs)
 Sparse version of coSolve.
 
void coSolve (SSVector &x, Vector &y, const SVector &rhsx, SSVector &rhsy)
 solves two systems in one call.
 
void coSolve (SSVector &x, SSVector &y, const SVector &rhsx, SSVector &rhsy)
 Sparse version of solving two systems in one call.
 
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 coSolve (SSVector &x, SSVector &y, SSVector &z, const SVector &rhsx, SSVector &rhsy, SSVector &rhsz)
 Sparse version of solving three systems in one call.
 
void addedRows (int n)
 inform SPxBasis, that n new rows had been added.
 
void removedRow (int i)
 inform SPxBasis that row i had been removed.
 
void removedRows (const int perm[])
 inform SPxBasis that rows in perm with negative entry were removed.
 
void addedCols (int n)
 inform SPxBasis that n new columns had been added.
 
void removedCol (int i)
 inform SPxBasis that column i had been removed.
 
void removedCols (const int perm[])
 inform SPxBasis that columns in perm with negative entry were removed.
 
void changedRow (int)
 inform SPxBasis that a row had been changed.
 
void changedCol (int)
 inform SPxBasis that a column had been changed.
 
void changedElement (int, int)
 inform SPxBasis that a matrix entry had been changed.
 
virtual void change (int i, SPxId &id, const SVector *enterVec, const SSVector *eta=0)
 performs basis update.
 
virtual bool readBasis (std::istream &in, const NameSet *rowNames, const NameSet *colNames)
 
virtual void writeBasis (std::ostream &os, const NameSet *rownames, const NameSet *colnames, const bool cpxFormat=false) const
 
virtual void printMatrix () const
 
void printMatrixMTX (int number)
 
virtual bool isDescValid (const Desc &ds)
 checks if a Descriptor is valid for the current LP w.r.t. its bounds
 
virtual void loadDesc (const Desc &)
 sets up basis.
 
virtual void loadSolver (SLinSolver *solver, const bool destroy=false)
 sets up linear solver to use.
 
virtual void load (SPxSolver *lp)
 loads the LP lp to the basis.
 
virtual void unLoad ()
 unloads the LP from the basis.
 
void invalidate ()
 invalidates actual basis.
 
void restoreInitialBasis ()
 Restores initial basis.
 
void dump ()
 output basis entries.
 
bool isConsistent () const
 consistency check.
 
Real getTotalUpdateTime () const
 time spent in updates
 
int getTotalUpdateCount () const
 number of updates performed
 
std::string statistics () const
 returns statistical information in form of a string.
 
void setOutstream (SPxOut &newOutstream)
 
 SPxBasis (Timer::TYPE ttype=Timer::USER_TIME)
 default constructor.
 
 SPxBasis (const SPxBasis &old)
 copy constructor
 
SPxBasisoperator= (const SPxBasis &rhs)
 assignment operator
 
virtual ~SPxBasis ()
 destructor.
 
void loadMatrixVecs ()
 loads matrix according to the SPxIds stored in theBaseId.
 
void reDim ()
 resizes internal arrays.
 
void setRep ()
 sets descriptor representation according to loaded LP.
 

Protected Attributes

Protected data
Array< UnitVectorunitVecs
 array of unit vectors
 
const SVSetthevectors
 the LP vectors according to representation
 
const SVSetthecovectors
 the LP coVectors according to representation
 
DVector primRhs
 rhs vector for computing the primal vector
 
UpdateVector primVec
 primal vector
 
DVector dualRhs
 rhs vector for computing the dual vector
 
UpdateVector dualVec
 dual vector
 
UpdateVector addVec
 storage for thePvec = &addVec
 
DVector theURbound
 Upper Row Feasibility bound.
 
DVector theLRbound
 Lower Row Feasibility bound.
 
DVector theUCbound
 Upper Column Feasibility bound.
 
DVector theLCbound
 Lower Column Feasibility bound.
 
DVector theUBbound
 Upper Basic Feasibility bound.
 
DVector theLBbound
 Lower Basic Feasibility bound.
 
DVectortheFrhs
 
UpdateVectortheFvec
 
DVectortheCoPrhs
 
UpdateVectortheCoPvec
 
UpdateVectorthePvec
 
UpdateVectortheRPvec
 row pricing vector
 
UpdateVectortheCPvec
 column pricing vector
 
DVectortheUbound
 Upper bound for vars.
 
DVectortheLbound
 Lower bound for vars.
 
DVectortheCoUbound
 Upper bound for covars.
 
DVectortheCoLbound
 Lower bound for covars.
 
DVector theCoTest
 
DVector theTest
 
DSVector primalRay
 stores primal ray in case of unboundedness
 
DSVector dualFarkas
 stores dual farkas proof in case of infeasibility
 
int leaveCount
 number of LEAVE iterations
 
int enterCount
 number of ENTER iterations
 
int primalCount
 number of primal iterations
 
int boundflips
 number of performed bound flips
 
int totalboundflips
 total number of bound flips
 
SPxPricerthepricer
 
SPxRatioTestertheratiotester
 
SPxStarterthestarter
 

Private Member Functions

Private helpers
void localAddRows (int start)
 
void localAddCols (int start)
 
void setPrimal (Vector &p_vector)
 
void setSlacks (Vector &p_vector)
 
void setDual (Vector &p_vector)
 
void setRedCost (Vector &p_vector)
 
Perturbation
void perturbMin (const UpdateVector &vec, Vector &low, Vector &up, Real eps, Real delta, int start=0, int incr=1)
 
void perturbMax (const UpdateVector &vec, Vector &low, Vector &up, Real eps, Real delta, int start=0, int incr=1)
 
Real perturbMin (const UpdateVector &uvec, Vector &low, Vector &up, Real eps, Real delta, const SPxBasis::Desc::Status *stat, int start, int incr) const
 
Real perturbMax (const UpdateVector &uvec, Vector &low, Vector &up, Real eps, Real delta, const SPxBasis::Desc::Status *stat, int start, int incr) const
 

Private Attributes

Private data
Type theType
 entering or leaving algortihm.
 
Pricing thePricing
 full or partial pricing.
 
Representation theRep
 row or column representation.
 
TimertheTime
 time spent in last call to method solve()
 
Timer::TYPE timerType
 type of timer (user or wallclock)
 
Real theCumulativeTime
 cumulative time spent in all calls to method solve()
 
int maxIters
 maximum allowed iterations.
 
Real maxTime
 maximum allowed time.
 
int nClckSkipsLeft
 remaining number of times the clock can be safely skipped
 
long nCallsToTimelim
 
Real objLimit
 < the number of calls to the method isTimeLimitReached()
 
Status m_status
 status of algorithm.
 
Real m_nonbasicValue
 nonbasic part of current objective value
 
bool m_nonbasicValueUpToDate
 true, if the stored objValue is up to date
 
Real m_entertol
 feasibility tolerance maintained during entering algorithm
 
Real m_leavetol
 feasibility tolerance maintained during leaving algorithm
 
Real theShift
 sum of all shifts applied to any bound.
 
Real lastShift
 for forcing feasibility.
 
int m_maxCycle
 maximum steps before cycling is detected.
 
int m_numCycle
 actual number of degenerate steps so far.
 
bool initialized
 true, if all vectors are setup.
 
SSVectorsolveVector2
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorsolveVector2rhs
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorsolveVector3
 when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)
 
SSVectorsolveVector3rhs
 when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)
 
SSVectorcoSolveVector2
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorcoSolveVector2rhs
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorcoSolveVector3
 when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)
 
SSVectorcoSolveVector3rhs
 when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)
 
bool freePricer
 true iff thepricer should be freed inside of object
 
bool freeRatioTester
 true iff theratiotester should be freed inside of object
 
bool freeStarter
 true iff thestarter should be freed inside of object
 
int instableLeaveNum
 
bool instableLeave
 
Real instableLeaveVal
 
SPxId instableEnterId
 
bool instableEnter
 
Real instableEnterVal
 
int displayLine
 
int displayFreq
 
Real sparsePricingFactor
 enable sparse pricing when viols < factor * dim()
 

Friends

class SoPlexLegacy
 
class SPxFastRT
 
class SPxBoundFlippingRT
 

The Simplex Loop

We now present a set of methods that may be usefull when implementing own SPxPricer or SPxRatioTester classes. Here is, how SPxSolver will call methods from its loaded SPxPricer and SPxRatioTester.

For the entering Simplex:

  1. SPxPricer::selectEnter()
  2. SPxRatioTester::selectLeave()
  3. SPxPricer::entered4()

For the leaving Simplex:

  1. SPxPricer::selectLeave()
  2. SPxRatioTester::selectEnter()
  3. SPxPricer::left4()
void setup4solve (SSVector *p_y, SSVector *p_rhs)
 Setup vectors to be solved within Simplex loop.
 
void setup4solve2 (SSVector *p_y2, SSVector *p_rhs2)
 Setup vectors to be solved within Simplex loop.
 
void setup4coSolve (SSVector *p_y, SSVector *p_rhs)
 Setup vectors to be cosolved within Simplex loop.
 
void setup4coSolve2 (SSVector *p_z, SSVector *p_rhs)
 Setup vectors to be cosolved within Simplex loop.
 
virtual Real maxInfeas () const
 maximal infeasibility of basis
 
const SPxBasisbasis () const
 Return current basis.
 
SPxBasisbasis ()
 
const SPxPricerpricer () const
 return loaded SPxPricer.
 
const SLinSolverslinSolver () const
 return loaded SLinSolver.
 
const SPxRatioTesterratiotester () const
 return loaded SPxRatioTester.
 
virtual void factorize ()
 Factorize basis matrix.
 
bool leave (int i)
 
bool enter (SPxId &id)
 
Real coTest (int i, SPxBasis::Desc::Status stat) const
 test coVector i with status stat.
 
void computeCoTest ()
 compute coTest vector.
 
void updateCoTest ()
 recompute coTest vector.
 
Real test (int i, SPxBasis::Desc::Status stat) const
 test vector i with status stat.
 
void updateTest ()
 recompute test vector.
 
void computeFtest ()
 compute basis feasibility test vector.
 
void updateFtest ()
 update basis feasibility test vector.
 

Parallelization

In this section we present the methods, that are provided in order to allow a parallel version to be implemented as a derived class, thereby inheriting most of the code of SPxSolver.

Initialization
These methods are used to setup all the vectors used in the Simplex loop, that where described in the previous sectios.
bool isInitialized () const
 has the internal data been initialized?
 
void resetClockStats ()
 resets clock average statistics
 
virtual void unInit ()
 uninitialize data structures.
 
virtual void reinitializeVecs ()
 setup all vecs fresh
 
virtual void reDim ()
 reset dimensions of vectors according to loaded LP.
 
void computeFrhs ()
 compute feasibility vector from scratch.
 
virtual void computeFrhsXtra ()
 
virtual void computeFrhs1 (const Vector &, const Vector &)
 
void computeFrhs2 (const Vector &, const Vector &)
 
virtual void computeEnterCoPrhs ()
 compute theCoPrhs for entering Simplex.
 
void computeEnterCoPrhs4Row (int i, int n)
 
void computeEnterCoPrhs4Col (int i, int n)
 
virtual void computeLeaveCoPrhs ()
 compute theCoPrhs for leaving Simplex.
 
void computeLeaveCoPrhs4Row (int i, int n)
 
void computeLeaveCoPrhs4Col (int i, int n)
 
Real nonbasicValue ()
 Compute part of objective value.
 
virtual const SVectorenterVector (const SPxId &p_id)
 Get pointer to the id 'th vector.
 
virtual void getLeaveVals (int i, SPxBasis::Desc::Status &leaveStat, SPxId &leaveId, Real &leaveMax, Real &leavebound, int &leaveNum, Real &objChange)
 
virtual void getLeaveVals2 (Real leaveMax, SPxId enterId, Real &enterBound, Real &newUBbound, Real &newLBbound, Real &newCoPrhs, Real &objChange)
 
virtual void getEnterVals (SPxId id, Real &enterTest, Real &enterUB, Real &enterLB, Real &enterVal, Real &enterMax, Real &enterPric, SPxBasis::Desc::Status &enterStat, Real &enterRO, Real &objChange)
 
virtual void getEnterVals2 (int leaveIdx, Real enterMax, Real &leaveBound, Real &objChange)
 
virtual void ungetEnterVal (SPxId enterId, SPxBasis::Desc::Status enterStat, Real leaveVal, const SVector &vec, Real &objChange)
 
virtual void rejectEnter (SPxId enterId, Real enterTest, SPxBasis::Desc::Status enterStat)
 
virtual void rejectLeave (int leaveNum, SPxId leaveId, SPxBasis::Desc::Status leaveStat, const SVector *newVec=0)
 
virtual void setupPupdate (void)
 
virtual void doPupdate (void)
 
virtual void clearUpdateVecs (void)
 
virtual void perturbMinEnter (void)
 
virtual void perturbMaxEnter (void)
 perturb basis bounds.
 
virtual void perturbMinLeave (void)
 
virtual void perturbMaxLeave (void)
 perturb nonbasic bounds.
 
virtual void init ()
 intialize data structures.
 
VarStatus basisStatusToVarStatus (SPxBasis::Desc::Status stat) const
 converts basis status to VarStatus
 
SPxBasis::Desc::Status varStatusToBasisStatusRow (int row, VarStatus stat) const
 converts VarStatus to basis status for rows
 
SPxBasis::Desc::Status varStatusToBasisStatusCol (int col, VarStatus stat) const
 converts VarStatus to basis status for columns
 
virtual void setTerminationTime (Real time=infinity)
 set time limit.
 
virtual Real terminationTime () const
 return time limit.
 
virtual void setTerminationIter (int iteration=-1)
 set iteration limit.
 
virtual int terminationIter () const
 return iteration limit.
 
virtual void setTerminationValue (Real value=infinity)
 set objective limit.
 
virtual Real terminationValue () const
 return objective limit.
 
virtual Real objValue ()
 get objective value of current solution.
 
Status getResult (Real *value=0, Vector *primal=0, Vector *slacks=0, Vector *dual=0, Vector *reduCost=0)
 get all results of last solve.
 
VarStatus getBasisRowStatus (int row) const
 gets basis status for a single row
 
VarStatus getBasisColStatus (int col) const
 gets basis status for a single column
 
Status getBasis (VarStatus rows[], VarStatus cols[], const int rowsSize=-1, const int colsSize=-1) const
 get current basis, and return solver status.
 
SPxBasis::SPxStatus getBasisStatus () const
 gets basis status
 
bool isBasisValid (DataArray< VarStatus > rows, DataArray< VarStatus > cols)
 check a given basis for validity.
 
void setBasis (const VarStatus rows[], const VarStatus cols[])
 set the lp solver's basis.
 
void setBasisStatus (SPxBasis::SPxStatus stat)
 set the lp solver's basis status.
 
void getNdualNorms (int &nnormsRow, int &nnormsCol) const
 get number of dual norms
 
bool getDualNorms (int &nnormsRow, int &nnormsCol, Real *norms) const
 get dual norms
 
bool setDualNorms (int nnormsRow, int nnormsCol, Real *norms)
 set dual norms
 
void resetCumulativeTime ()
 reset cumulative time counter to zero.
 
int boundFlips () const
 get number of bound flips.
 
int iterations () const
 get number of iterations of current solution.
 
int primalIterations ()
 return number of iterations done with primal algorithm
 
int dualIterations ()
 return number of iterations done with primal algorithm
 
Real time () const
 time spent in last call to method solve().
 
bool isTimeLimitReached (const bool forceCheck=false)
 returns whether current time limit is reached; call to time() may be skipped unless forceCheck is true
 
Real cumulativeTime () const
 cumulative time spent in all calls to method solve().
 
const LPRowSetrows () const
 return const lp's rows if available.
 
const LPColSetcols () const
 return const lp's cols if available.
 
void getLower (Vector &p_low) const
 copy lower bound vector to p_low.
 
void getUpper (Vector &p_up) const
 copy upper bound vector to p_up.
 
void getLhs (Vector &p_lhs) const
 copy lhs value vector to p_lhs.
 
void getRhs (Vector &p_rhs) const
 copy rhs value vector to p_rhs.
 
SPxSense sense () const
 optimization sense.
 
std::string statistics () const
 returns statistical information in form of a string.
 

Additional Inherited Members

- Protected Types inherited from SPxBasis
enum  SPxStatus {
  NO_PROBLEM = -2, SINGULAR = -1, REGULAR = 0, DUAL = 1,
  PRIMAL = 2, OPTIMAL = 3, UNBOUNDED = 4, INFEASIBLE = 5
}
 basis status. More...
 

Detailed Description

Sequential object-oriented SimPlex.

SPxSolver is an LP solver class using the revised Simplex algorithm. It provids two basis representations, namely a column basis and a row basis (see Representation). For both representations, a primal and dual algorithm is available (see Type).

In addition, SPxSolver can be custumized with various respects:

SPxSolver is derived from SPxLP that is used to store the LP to be solved. Hence, the LPs solved with SPxSolver have the general format

\[ \begin{array}{rl} \hbox{max} & \mbox{maxObj}^T x \\ \hbox{s.t.} & \mbox{lhs} \le Ax \le \mbox{rhs} \\ & \mbox{low} \le x \le \mbox{up} \end{array} \]

Also, SPxLP provide all manipulation methods for the LP. They allow SPxSolver to be used within cutting plane algorithms.

Definition at line 84 of file spxsolver.h.

Member Enumeration Documentation

enum Pricing

Pricing type.

In case of the ENTERing Simplex algorithm, for performance reasons it may be advisable not to compute and maintain up to date vectors pVec() and test() and instead compute only some of its elements explicitely. This is controled by the Pricing type.

Enumerator
FULL 

Full pricing.

If FULL pricing in selected for the ENTERing Simplex, vectors pVec() and test() are kept up to date by SPxSolver. An SPxPricer only needs to select an Id such that the test() or coTest() value is < 0.

PARTIAL 

Partial pricing.

When PARTIAL pricing in selected for the ENTERing Simplex, vectors pVec() and test() are not set up and updated by SPxSolver. However, vectors coPvec() and coTest() are still kept up to date by SPxSolver. An SPxPricer object needs to compute the values for pVec() and test() itself in order to select an appropriate pivot with test() < 0. Methods computePvec(i) and computeTest(i) will assist the used to do so. Note that it may be feasible for a pricer to return an Id with test() > 0; such will be rejected by SPxSolver.

Definition at line 152 of file spxsolver.h.

LP basis representation.

Solving LPs with the Simplex algorithm requires the definition of a basis. A basis can be defined as a set of column vectors or a set of row vectors building a nonsingular matrix. We will refer to the first case as the columnwise representation and the latter case will be called the rowwise representation.

Type Representation determines the representation of SPxSolver, i.e. a columnwise (COLUMN == 1) or rowwise (ROW == -1) one.

Enumerator
ROW 

rowwise representation.

COLUMN 

columnwise representation.

Definition at line 105 of file spxsolver.h.

enum Status
Todo:
In spxchange, change the status to if (m_status > 0) m_status = REGULAR;
Enumerator
ERROR 

an error occured.

NO_RATIOTESTER 

No ratiotester loaded.

NO_PRICER 

No pricer loaded.

NO_SOLVER 

No linear solver loaded.

NOT_INIT 

not initialised error

ABORT_CYCLING 

solve() aborted due to detection of cycling.

ABORT_TIME 

solve() aborted due to time limit.

ABORT_ITER 

solve() aborted due to iteration limit.

ABORT_VALUE 

solve() aborted due to objective limit.

SINGULAR 

Basis is singular, numerical troubles?

NO_PROBLEM 

No Problem has been loaded.

REGULAR 

LP has a usable Basis (maybe LP is changed).

RUNNING 

algorithm is running

UNKNOWN 

nothing known on loaded problem.

OPTIMAL 

LP has been solved to optimality.

UNBOUNDED 

LP has been proven to be primal unbounded.

INFEASIBLE 

LP has been proven to be primal infeasible.

INForUNBD 

LP is primal infeasible or unbounded.

Definition at line 190 of file spxsolver.h.

enum Type

Algorithmic type.

SPxSolver uses the reviesed Simplex algorithm to solve LPs. Mathematically, one distinguishes the primal from the dual algorihm. Algorithmically, these relate to the two types ENTER or LEAVE. How they relate, depends on the chosen basis representation. This is desribed by the following table:

 ENTER LEAVE
ROW DUAL PRIMAL
COLUMNPRIMALDUAL
Enumerator
ENTER 

Entering Simplex.

The Simplex loop for the entering Simplex can be sketched as follows:

  • Pricing : Select a variable to ENTER the basis.
  • Ratio-Test : Select variable to LEAVE the basis such that the basis remains feasible.
  • Perform the basis update.
LEAVE 

Leaving Simplex.

The Simplex loop for the leaving Simplex can be sketched as follows:

  • Pricing: Select a variable to LEAVE the basis.
  • Ratio-Test: Select variable to ENTER the basis such that the basis remains priced.
  • Perform the basis update.

Definition at line 124 of file spxsolver.h.

enum VarStatus
Enumerator
ON_UPPER 

variable set to its upper bound.

ON_LOWER 

variable set to its lower bound.

FIXED 

variable fixed to identical bounds.

ZERO 

free variable fixed to zero.

BASIC 

variable is basic.

UNDEFINED 

nothing known about basis status (possibly due to a singular basis in transformed problem)

Definition at line 177 of file spxsolver.h.

Constructor & Destructor Documentation

SPxSolver ( Type  type = LEAVE,
Representation  rep = ROW,
Timer::TYPE  ttype = Timer::USER_TIME 
)
explicit

default constructor.

Constructors / destructors

Definition at line 900 of file spxsolver.cpp.

References TimerFactory::createTimer(), DEFAULT_BND_VIOL, SPxSolver::initRep(), SPxSolver::setDelta(), SPxBasis::theLP, SPxSolver::theTime, and SPxSolver::timerType.

Member Function Documentation

void addedCols ( int  n)
protectedvirtual
void addedRows ( int  n)
protectedvirtual
const SPxBasis& basis ( ) const

Return current basis.

Note
The basis can be used to solve linear systems or use any other of its (const) methods. It is, however, encuraged to use methods setup4solve() and setup4coSolve() for solving systems, since this is likely to have perfomance advantages.

Definition at line 1606 of file spxsolver.h.

Referenced by SoPlex::_addColReal(), SoPlex::_addColsReal(), SoPlex::_addRowReal(), SoPlex::_addRowsReal(), SoPlex::_changeBoundsReal(), SoPlex::_changeColReal(), SoPlex::_changeElementReal(), SoPlex::_changeLhsReal(), SoPlex::_changeLowerReal(), SoPlex::_changeRangeReal(), SoPlex::_changeRhsReal(), SoPlex::_changeRowReal(), SoPlex::_changeUpperReal(), SoPlex::_ensureRealLPLoaded(), SoPlex::_evaluateSolutionReal(), SoPlex::_performOptIRStable(), SoPlex::_removeColReal(), SoPlex::_removeColsReal(), SoPlex::_removeRowReal(), SoPlex::_removeRowsReal(), SoPlex::_restoreLPReal(), SoPlex::_solveRational(), SoPlex::_storeSolutionReal(), SPxWeightPR::computeLeavePenalty(), SPxSteepPR::entered4(), SPxBoundFlippingRT::flipAndUpdate(), SoPlex::getBasisInd(), SoPlex::getBasisInverseColReal(), SoPlex::getBasisInverseRowReal(), SoPlex::getBasisInverseTimesVecReal(), SoPlex::getEstimatedCondition(), SoPlex::getExactCondition(), SPxSteepPR::isConsistent(), SoPlexLegacy::iteration(), SPxSolver::leave(), SPxSteepPR::left4(), SoPlex::readBasisFile(), SPxWeightPR::selectEnter(), SPxSteepPR::selectEnter(), SPxFastRT::selectEnter(), SPxBoundFlippingRT::selectEnter(), SPxDevexPR::selectEnterX(), SPxSteepPR::selectEnterX(), SPxDevexPR::selectLeave(), SPxSteepPR::selectLeave(), SPxFastRT::selectLeave(), SPxBoundFlippingRT::selectLeave(), SoPlex::setBasis(), soplex::setDualStatus(), SoPlex::setIntParam(), SPxSteepPR::setupWeights(), SoPlexLegacy::solve(), SPxSolver::solve(), and SPxSolver::writeState().

SPxBasis& basis ( )

Definition at line 1611 of file spxsolver.h.

int boundFlips ( ) const

get number of bound flips.

Definition at line 1903 of file spxsolver.h.

Referenced by SoPlex::_solveRealLPAndRecordStatistics().

void changeBounds ( const Vector newLower,
const Vector newUpper 
)
virtual

Definition at line 942 of file changesoplex.cpp.

References SPxSolver::changeLower(), and SPxSolver::changeUpper().

Referenced by SPxSolver::changeBounds().

void changeBounds ( int  i,
const Real newLower,
const Real newUpper 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 949 of file changesoplex.cpp.

References SPxSolver::changeLower(), and SPxSolver::changeUpper().

virtual void changeBounds ( SPxColId  p_id,
const Real p_newLower,
const Real p_newUpper 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 864 of file spxsolver.h.

References SPxSolver::changeBounds(), and SPxLPBase< Real >::number().

void changeCol ( int  i,
const LPCol newCol 
)
virtual
virtual void changeCol ( SPxColId  p_id,
const LPCol p_newCol 
)
virtual

Definition at line 911 of file spxsolver.h.

void changeElement ( int  i,
int  j,
const Real val 
)
virtual
virtual void changeElement ( SPxRowId  rid,
SPxColId  cid,
const Real val 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 918 of file spxsolver.h.

References SPxSolver::changeElement(), and SPxLPBase< Real >::number().

void changeLhs ( int  i,
const Real newLhs 
)
virtual
virtual void changeLhs ( SPxRowId  p_id,
const Real p_newLhs 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 876 of file spxsolver.h.

void changeLower ( int  i,
const Real newLower 
)
virtual
virtual void changeLower ( SPxColId  p_id,
const Real p_newLower 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 844 of file spxsolver.h.

void changeMaxObj ( const Vector newObj)
virtual
Todo:
Factorization remains valid, we do not need a reDim() pricing vectors should be recomputed.

Definition at line 685 of file changesoplex.cpp.

References SPxLPBase< Real >::changeMaxObj(), SPxSolver::forceRecompNonbasicValue(), and SPxSolver::unInit().

void changeMaxObj ( int  i,
const Real newVal 
)
virtual
Todo:
Factorization remains valid, we do not need a reDim() pricing vectors should be recomputed.

Reimplemented from SPxLPBase< Real >.

Definition at line 697 of file changesoplex.cpp.

References SPxLPBase< Real >::changeMaxObj(), SPxSolver::forceRecompNonbasicValue(), and SPxSolver::unInit().

virtual void changeMaxObj ( SPxColId  p_id,
const Real p_newVal 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 818 of file spxsolver.h.

void changeObj ( const Vector newObj)
virtual
Todo:
Factorization remains valid, we do not need a reDim() pricing vectors should be recomputed.

Definition at line 660 of file changesoplex.cpp.

References SPxLPBase< Real >::changeObj(), SPxSolver::forceRecompNonbasicValue(), and SPxSolver::unInit().

Referenced by SoPlex::_performOptIRStable().

void changeObj ( int  i,
const Real newVal 
)
virtual
Todo:
Factorization remains valid, we do not need a reDim() pricing vectors should be recomputed.

Reimplemented from SPxLPBase< Real >.

Definition at line 672 of file changesoplex.cpp.

References SPxLPBase< Real >::changeObj(), SPxSolver::forceRecompNonbasicValue(), and SPxSolver::unInit().

virtual void changeObj ( SPxColId  p_id,
const Real p_newVal 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 809 of file spxsolver.h.

virtual void changeRange ( SPxRowId  p_id,
const Real p_newLhs,
const Real p_newRhs 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 896 of file spxsolver.h.

References SPxSolver::changeRange(), and SPxLPBase< Real >::number().

void changeRhs ( int  i,
const Real newRhs 
)
virtual
virtual void changeRhs ( SPxRowId  p_id,
const Real p_newRhs 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 887 of file spxsolver.h.

void changeRow ( int  i,
const LPRow newRow 
)
virtual
virtual void changeRow ( SPxRowId  p_id,
const LPRow p_newRow 
)
virtual

Definition at line 904 of file spxsolver.h.

void changeRowObj ( const Vector newObj)
virtual
Todo:
Factorization remains valid, we do not need a reDim() pricing vectors should be recomputed.

Definition at line 709 of file changesoplex.cpp.

References SPxLPBase< Real >::changeRowObj(), SPxSolver::forceRecompNonbasicValue(), and SPxSolver::unInit().

Referenced by SoPlex::_performOptIRStable().

void changeRowObj ( int  i,
const Real newVal 
)
virtual
Todo:
Factorization remains valid, we do not need a reDim() pricing vectors should be recomputed.

Reimplemented from SPxLPBase< Real >.

Definition at line 721 of file changesoplex.cpp.

References SPxLPBase< Real >::changeRowObj(), SPxSolver::forceRecompNonbasicValue(), and SPxSolver::unInit().

virtual void changeRowObj ( SPxRowId  p_id,
const Real p_newVal 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 827 of file spxsolver.h.

void changeSense ( SPxSense  sns)
virtual

Definition at line 1230 of file changesoplex.cpp.

References SPxLPBase< Real >::changeSense(), and SPxSolver::unInit().

void changeUpper ( int  i,
const Real newUpper 
)
virtual
virtual void changeUpper ( SPxColId  p_id,
const Real p_newUpper 
)
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 855 of file spxsolver.h.

void clearDualBounds ( SPxBasis::Desc::Status  stat,
Real upp,
Real lw 
) const
protected

The following methods serve for initializing the bounds for dual or primal Simplex algorithm of entering or leaving type.

Seting up the basis for dual simplex requires to install upper and lower feasibility bounds for dual variables (|Lbound| and |Ubound|). Here is a list of how these must be set for inequalities of type $l \le a^Tx \le u$:

\[ \begin{tabular}{cccc} $l$ & $u$ & |Lbound| & |Ubound| \\ \hline $-\infty=l$ & $u=\infty$ & 0 & 0 \\ $-\infty<l$ & $u=\infty$ & 0 & $\infty$ \\ $-\infty=l$ & $u<\infty$ & $-\infty$ & 0 \\ \multicolumn{2}{c}{ $-\infty<l \ne u<\infty$} & 0 & 0 \\ \multicolumn{2}{c}{ $-\infty<l = u<\infty$} & $-\infty$ & $\infty$ \\ \end{tabular} \]

The case $l = -\infty$, $u = \infty$ occurs for unbounded primal variables. Such must be treated differently from the general case.

Given possible upper and lower bounds to a dual variable with |Status stat|, this function clears the bounds according to |stat| by setting them to $\infty$ or $-\infty$, respectively.

Definition at line 76 of file spxbounds.cpp.

References SPxBasis::Desc::D_FREE, SPxBasis::Desc::D_ON_LOWER, SPxBasis::Desc::D_ON_UPPER, soplex::infinity, SPxBasis::Desc::P_ON_LOWER, and SPxBasis::Desc::P_ON_UPPER.

Referenced by SPxSolver::setDualColBounds(), SPxSolver::setDualRowBounds(), and SPxSolver::unShift().

virtual void clearRowObjs ( )
virtual

Reimplemented from SPxLPBase< Real >.

Definition at line 832 of file spxsolver.h.

Referenced by SoPlex::_performOptIRStable().

SPxColId colId ( int  i) const

ColId of i 'th column.

Definition at line 2004 of file spxsolver.h.

Referenced by SPxBasis::readBasis().

const LPColSet& cols ( ) const

return const lp's cols if available.

Definition at line 1949 of file spxsolver.h.

void computeEnterCoPrhs4Row ( int  i,
int  n 
)
protected

Computing the right hand side vector for |theCoPvec| depends on the type of the simplex algorithm. In entering algorithms, the values are taken from the inequality's right handside or the column's objective value.

In contrast to this leaving algorithms take the values from vectors |theURbound| and so on.

We reflect this difference by providing two pairs of methods |computeEnterCoPrhs(n, stat)| and |computeLeaveCoPrhs(n, stat)|. The first pair operates for entering algorithms, while the second one is intended for leaving algorithms. The return value of these methods is the right hand side value for the $n$-th row or column id, respectively, if it had the passed |Status| for both.

Both methods are again split up into two methods named |...4Row(i,n)| and |...4Col(i,n)|, respectively. They do their job for the |i|-th basis variable, being the |n|-th row or column.

Definition at line 329 of file spxvecs.cpp.

References SPxBasis::baseId(), SPxBasis::desc(), soplex::infinity, SPxLPBase< Real >::lhs(), SPxLPBase< Real >::maxRowObj(), SPxLPBase< Real >::number(), SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::rep(), SPxLPBase< Real >::rhs(), and SPxSolver::ROW.

Referenced by SPxSolver::computeEnterCoPrhs().

void computeFrhs ( )
protected

compute feasibility vector from scratch.

Initialize Vectors

Computing the right hand side vector for the feasibility vector depends on the chosen representation and type of the basis.

In columnwise case, |theFvec| = $x_B = A_B^{-1} (- A_N x_N)$, where $x_N$ are either upper or lower bounds for the nonbasic variables (depending on the variables |Status|). If these values remain unchanged throughout the simplex algorithm, they may be taken directly from LP. However, in the entering type algorith they are changed and, hence, retreived from the column or row upper or lower bound vectors.

In rowwise case, |theFvec| = $\pi^T_B = (c^T - 0^T A_N) A_B^{-1}$. However, this applies only to leaving type algorithm, where no bounds on dual variables are altered. In entering type algorithm they are changed and, hence, retreived from the column or row upper or lower bound vectors.

Todo:
put this into a separate method

Definition at line 42 of file spxvecs.cpp.

References VectorBase< R >::clear(), SPxSolver::COLUMN, SPxSolver::computeFrhs1(), SPxSolver::computeFrhs2(), SPxSolver::computeFrhsXtra(), SPxBasis::Desc::D_FREE, SPxBasis::Desc::D_ON_LOWER, SPxBasis::Desc::D_ON_UPPER, SPxBasis::desc(), SPxSolver::ENTER, soplex::infinity, SPxSolver::isBasic(), SPxSolver::LEAVE, SPxLPBase< Real >::lhs(), SPxLPBase< Real >::maxObj(), SPxLPBase< Real >::maxRowObj(), MSG_ERROR, VectorBase< R >::multAdd(), SPxLPBase< Real >::nRows(), SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::rep(), SPxLPBase< Real >::rhs(), SPxSolver::ROW, SPxBasis::Desc::rowStatus(), SPxSolver::theCoLbound, SPxSolver::theCoUbound, SPxSolver::theFrhs, SPxSolver::theLbound, SPxSolver::theUbound, SPxSolver::type(), and SPxSolver::vector().

Referenced by SPxSolver::factorize(), SPxSolver::init(), SPxSolver::leave(), SPxSolver::reinitializeVecs(), and SPxSolver::terminate().

void computeFrhs1 ( const Vector ufb,
const Vector lfb 
)
protectedvirtual

This methods subtracts $A_N x_N$ or $\pi_N^T A_N$ from |theFrhs| as specified by the |Status| of all nonbasic variables. The values of $x_N$ or $\pi_N$ are taken from the passed arrays.

Parameters
ufbupper feasibility bound for variables
lfblower feasibility bound for variables

Definition at line 198 of file spxvecs.cpp.

References SPxSolver::coDim(), SPxBasis::Desc::D_FREE, SPxBasis::Desc::D_ON_LOWER, SPxBasis::Desc::D_ON_UPPER, SPxBasis::Desc::D_UNDEFINED, SPxBasis::desc(), soplex::infinity, SPxSolver::isBasic(), MSG_ERROR, VectorBase< R >::multAdd(), SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxBasis::Desc::status(), SPxSolver::theFrhs, and SPxSolver::vector().

Referenced by SPxSolver::computeFrhs().

void computeFrhs2 ( const Vector coufb,
const Vector colfb 
)
protected

This methods subtracts $A_N x_N$ or $\pi_N^T A_N$ from |theFrhs| as specified by the |Status| of all nonbasic variables. The values of $x_N$ or $\pi_N$ are taken from the passed arrays.

Parameters
coufbupper feasibility bound for covariables
colfblower feasibility bound for covariables

Definition at line 254 of file spxvecs.cpp.

References SPxBasis::Desc::coStatus(), SPxBasis::Desc::D_FREE, SPxBasis::Desc::D_ON_BOTH, SPxBasis::Desc::D_ON_LOWER, SPxBasis::Desc::D_ON_UPPER, SPxBasis::Desc::D_UNDEFINED, SPxBasis::desc(), SPxSolver::dim(), soplex::infinity, SPxSolver::isBasic(), MSG_ERROR, MSG_WARNING, SPxBasis::Desc::P_FIXED, SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, and SPxSolver::spxout.

Referenced by SPxSolver::computeFrhs().

Real computePvec ( int  i)

compute and return pVec()[i].

Definition at line 168 of file enter.cpp.

References SPxSolver::thePvec, and SPxSolver::vector().

Referenced by SPxParMultPR::selectEnter().

void computePvec ( )

compute entire pVec().

When computing the copricing vector, we expect the pricing vector to be setup correctly. Then computing the copricing vector is nothing but computing all scalar products of the pricing vector with the vectors of the LPs constraint matrix.

Definition at line 491 of file spxvecs.cpp.

References SPxSolver::coDim(), SPxSolver::thePvec, and SPxSolver::vector().

Referenced by SPxSolver::enter(), SPxSolver::factorize(), SPxSolver::init(), SPxSolver::qualRedCostViolation(), SPxSolver::reinitializeVecs(), SPxSolver::setPricing(), and SPxSolver::terminate().

Real computeTest ( int  i)

compute and return test()[i] in ENTERing Simplex.

Definition at line 174 of file enter.cpp.

References SPxBasis::desc(), SPxSolver::isBasic(), SPxBasis::Desc::status(), SPxSolver::test(), and SPxSolver::theTest.

Referenced by SPxParMultPR::selectEnter().

const Vector& coPrhs ( ) const

Right-hand side vector for coPvec.

The vector coPvec is computed by solving a linear system with the basis matrix and coPrhs as the right-hand side vector. For column basis representation, coPrhs is build up of the objective vector elements of all basic variables. For a row basis, it consists of the thight bounds of all basic constraints.

Definition at line 1267 of file spxsolver.h.

Referenced by SPxSolver::factorize(), and SPxSolver::value().

SPxBasis::Desc::Status covarStatus ( int  i) const

Status of i 'th covariable.

Definition at line 1113 of file spxsolver.h.

const SVector& coVector ( int  i) const

i 'th covector of LP.

Returns
a reference to the i 'th, 0 <= i < dim(), covector of the loaded LP (with respect to the chosen representation).

Definition at line 1057 of file spxsolver.h.

Referenced by SPxWeightST::generate().

const SVector& coVector ( const SPxRowId rid) const

Definition at line 1062 of file spxsolver.h.

const SVector& coVector ( const SPxColId cid) const

Definition at line 1070 of file spxsolver.h.

const SVector& coVector ( const SPxId p_id) const

coVector associated to p_id.

Returns
a reference to the covector of the loaded LP corresponding to p_id (with respect to the chosen representation). If p_id is a coid, a covector of the constraint matrix is returned, otherwise the corresponding unit vector is returned.

Definition at line 1084 of file spxsolver.h.

Real cumulativeTime ( ) const

cumulative time spent in all calls to method solve().

Definition at line 1938 of file spxsolver.h.

Referenced by SPxSolver::isTimeLimitReached().

Real delta ( ) const

guaranteed primal and dual bound violation for optimal solution, returning the maximum of feastol() and opttol(), i.e., the less tight tolerance.

Definition at line 700 of file spxsolver.h.

Referenced by SPxHarrisRT::degenerateEps(), SoPlexLegacy::delta(), SPxSolver::enter(), and SPxSolver::leave().

int dim ( ) const

dimension of basis matrix.

Definition at line 931 of file spxsolver.h.

Referenced by SPxDevexPR::addedCoVecs(), SPxSteepPR::addedCoVecs(), SPxSolver::computeCoTest(), SPxSolver::computeEnterCoPrhs(), SPxSolver::computeFrhs2(), SPxSolver::computeFtest(), SPxSolver::computeLeaveCoPrhs(), SPxBasis::dump(), SPxSolver::enter(), SPxBoundFlippingRT::flipAndUpdate(), SPxWeightST::generate(), SPxPricer::getDualNorms(), SPxPricer::getNdualNorms(), SPxSolver::getPrimal(), SPxSolver::getRedCost(), SPxSolver::getSlacks(), SPxSolver::hyperPricing(), SPxDevexPR::init(), SPxSolver::init(), SPxSolver::isBasisValid(), SPxDevexPR::isConsistent(), SPxSteepPR::isConsistent(), SPxBasis::isConsistent(), SPxSolver::isConsistent(), SPxSolver::leave(), SPxParMultPR::load(), SPxSteepPR::load(), SPxBasis::loadDesc(), SPxBasis::loadMatrixVecs(), SPxSolver::maxInfeas(), SPxBasis::multBaseWith(), SPxBasis::multWithBase(), SPxSolver::qualRedCostViolation(), SPxBasis::reDim(), SPxSolver::reDim(), SPxBasis::removedCol(), SPxSteepPR::removedCoVec(), SPxSteepPR::removedCoVecs(), SPxBasis::removedRow(), SPxParMultPR::selectEnter(), SPxDantzigPR::selectEnterDenseDim(), SPxSteepPR::selectEnterDenseDim(), SPxDantzigPR::selectLeave(), SPxParMultPR::selectLeave(), SPxWeightPR::selectLeave(), SPxSteepPR::selectLeaveX(), SPxSolver::setEnterBounds(), SPxSolver::setLeaveBounds(), SPxSolver::setPrimal(), SPxSolver::setRedCost(), SPxDevexPR::setRep(), SPxSteepPR::setRep(), SPxSolver::setSlacks(), SPxHybridPR::setType(), SPxWeightPR::setType(), SPxSteepPR::setType(), SPxSteepPR::setupPrefs(), SPxSteepPR::setupWeights(), SPxSolver::shiftFvec(), SPxSolver::shiftPvec(), SPxSolver::solve(), SPxSolver::terminate(), SPxSolver::testBounds(), SPxSolver::testVecs(), and SPxSolver::unShift().

void doPupdate ( void  )
protectedvirtual
int dualIterations ( )

return number of iterations done with primal algorithm

Definition at line 1922 of file spxsolver.h.

bool enter ( SPxId id)
private

let id enter the basis and manage leaving of another one.

Returns
false if LP is unbounded/infeasible.
Todo:
if shift() is not zero, we must not conclude primal unboundedness

Definition at line 1030 of file enter.cpp.

References DSVectorBase< R >::add(), SPxBasis::baseId(), SPxBasis::baseVec(), SPxSolver::boundflips, SPxBasis::change(), SVectorBase< R >::clear(), SPxSolver::COLUMN, SPxSolver::computeCoTest(), SPxSolver::computePvec(), SPxSolver::computeTest(), SPxBasis::coSolve(), SPxSolver::coSolveVector2, SPxSolver::coSolveVector2rhs, SPxSolver::coSolveVector3, SPxSolver::coSolveVector3rhs, SPxBasis::Desc::D_FREE, UpdateVector::delta(), SPxSolver::delta(), SPxBasis::desc(), SSVectorBase< R >::dim(), SPxSolver::dim(), SPxSolver::doPupdate(), SPxSolver::dualFarkas, SPxSolver::ENTER, SPxSolver::entertol(), SPxSolver::enterVector(), SPxSolver::epsilon(), SPxSolver::factorize(), SPxSolver::FULL, SPxSolver::fVec(), SPxSolver::getEnterVals(), SPxSolver::getEnterVals2(), SPxBasis::INFEASIBLE, soplex::infinity, SPxSolver::initialized, SPxSolver::instableEnter, SPxSolver::instableEnterId, SPxSolver::instableEnterVal, UpdateVector::isConsistent(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), SPxId::isSPxColId(), SPxId::isSPxRowId(), SPxId::isValid(), SPxBasis::lastUpdate(), VectorBase< R >::length(), SPxSolver::m_maxCycle, SPxSolver::m_numCycle, MSG_DEBUG, MSG_INFO2, MSG_INFO3, VectorBase< R >::multAdd(), SPxBasis::multBaseWith(), SPxLPBase< Real >::number(), SPxBasis::Desc::P_FIXED, SPxBasis::Desc::P_FREE, SPxSolver::perturbMaxEnter(), SPxSolver::perturbMinEnter(), SPxSolver::pricing(), SPxSolver::primalRay, SPxSolver::rejectEnter(), SPxSolver::rep(), SPxSolver::ROW, SPxRatioTester::selectLeave(), SPxSolver::setBasisStatus(), DSVectorBase< R >::setMax(), SPxSolver::setupPupdate(), soplex::sign(), SSVectorBase< R >::size(), ClassArray< Nonzero< Real > >::size(), SPxBasis::solve4update(), soplex::spxAbs(), SPxSolver::spxout, SPxSolver::theCoPrhs, SPxSolver::theCoPvec, SPxSolver::thecovectors, SPxSolver::theFrhs, SPxSolver::theFvec, SPxSolver::theLBbound, SPxSolver::thePvec, SPxSolver::theratiotester, SPxSolver::theUBbound, SPxSolver::totalboundflips, SPxSolver::type(), SPxBasis::UNBOUNDED, SPxSolver::ungetEnterVal(), SPxSolver::unitVecs, UpdateVector::update(), SPxSolver::updateCoTest(), SPxSolver::updateNonbasicValue(), SPxSolver::updateTest(), UpdateVector::value(), and SPxSolver::value().

Referenced by SPxSolver::solve().

virtual const SVector* enterVector ( const SPxId p_id)
protectedvirtual

Get pointer to the id 'th vector.

Definition at line 1741 of file spxsolver.h.

Referenced by SPxSolver::enter(), and SPxSolver::leave().

const Vector& fRhs ( ) const

right-hand side vector for fVec

The feasibility vector is computed by solving a linear system with the basis matrix. The right-hand side vector of this system is referred to as feasibility, right-hand side vector fRhs().

For a row basis, fRhs() is the objective vector (ignoring shifts). For a column basis, it is the sum of all nonbasic vectors scaled by the factor of their bound.

Definition at line 1192 of file spxsolver.h.

Referenced by SPxSolver::factorize(), SPxSolver::leave(), SPxSolver::solve(), and SPxSolver::value().

const Vector& fTest ( ) const

Violations of fVec.

For the leaving Simplex algorithm, pricing involves selecting a variable from fVec that violates its bounds that is to leave the basis. When a SPxPricer is called to select such a leaving variable, fTest() contains the vector of violations: For fTest()[i] < 0, the i 'th basic variable violates one of its bounds by the given value. Otherwise no bound is violated.

Definition at line 1241 of file spxsolver.h.

Referenced by SPxDevexPR::buildBestPriceVectorLeave(), SPxSteepPR::buildBestPriceVectorLeave(), SPxSolver::qualRedCostViolation(), SPxBoundFlippingRT::selectEnter(), SPxDantzigPR::selectLeave(), SPxParMultPR::selectLeave(), SPxWeightPR::selectLeave(), SPxDevexPR::selectLeaveHyper(), SPxSteepPR::selectLeaveHyper(), SPxDantzigPR::selectLeaveSparse(), SPxDevexPR::selectLeaveSparse(), SPxSteepPR::selectLeaveSparse(), SPxDevexPR::selectLeaveX(), SPxSteepPR::selectLeaveX(), SPxSolver::solve(), and SPxSolver::updateFtest().

SPxSolver::VarStatus getBasisColStatus ( int  col) const

gets basis status for a single column

Definition at line 1653 of file spxsolver.cpp.

References SPxSolver::basisStatusToVarStatus(), SPxBasis::desc(), and SPxLPBase< Real >::nCols().

Referenced by SoPlex::basisColStatus(), and SoPlexLegacy::getBasisColStatus().

SPxSolver::VarStatus getBasisRowStatus ( int  row) const

gets basis status for a single row

Definition at line 1647 of file spxsolver.cpp.

References SPxSolver::basisStatusToVarStatus(), SPxBasis::desc(), and SPxLPBase< Real >::nRows().

Referenced by SoPlex::basisRowStatus(), and SoPlexLegacy::getBasisRowStatus().

SPxBasis::SPxStatus getBasisStatus ( ) const

gets basis status

Definition at line 1868 of file spxsolver.h.

Referenced by SoPlexLegacy::getBasis(), SoPlexLegacy::getBasisColStatus(), and SoPlexLegacy::getBasisRowStatus().

SPxSolver::Status getDual ( Vector vector) const
virtual

get current solution vector for dual variables.

This method returns the Status of the basis. If it is REGULAR or better, the vector of dual variables of the current basis will be copied to the argument vector. Hence, vector must be of dimension nRows().

Warning
Even though mathematically, each range constraint would account for two dual variables (one for each inequaility), only nRows() dual variables are setup via the following construction: Given a range constraint, there are three possible situations:
  • None of its inequalities is tight: The dual variables for both are 0. However, when shifting (see below) occurs, it may be set to a value other than 0, which models a perturbed objective vector.
  • Both of its inequalities are tight: In this case the range constraint models an equality and we adopt the standard definition.
  • One of its inequalities is tight while the other is not: In this case only the dual variable for the tight constraint is given with the standard definition, while the other constraint is implicitely set to 0.
Exceptions
SPxStatusExceptionif no problem loaded

Definition at line 1266 of file spxsolve.cpp.

References SPxBasis::baseId(), SPxSolver::coPvec(), SPxSolver::fVec(), SPxSolver::isInitialized(), SPxLPBase< Real >::maxRowObj(), SPxLPBase< Real >::nCols(), SPxSolver::NO_PROBLEM, SPxLPBase< Real >::number(), SPxSolver::rep(), SPxSolver::ROW, SPxLPBase< Real >::spxSense(), and SPxSolver::status().

Referenced by SoPlex::_resolveWithoutPreprocessing(), SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), SoPlexLegacy::getDual(), SPxSolver::getResult(), and SoPlexLegacy::unsimplify().

SPxSolver::Status getDualfarkas ( Vector vector) const
virtual
bool getDualNorms ( int &  nnormsRow,
int &  nnormsCol,
Real norms 
) const

get dual norms

Definition at line 1757 of file spxsolver.cpp.

References SPxPricer::getDualNorms(), and SPxSolver::thepricer.

Referenced by SoPlex::getDualNorms().

void getLhs ( Vector p_lhs) const

copy lhs value vector to p_lhs.

Definition at line 1966 of file spxsolver.h.

void getLower ( Vector p_low) const

copy lower bound vector to p_low.

Definition at line 1955 of file spxsolver.h.

void getNdualNorms ( int &  nnormsRow,
int &  nnormsCol 
) const

get number of dual norms

Definition at line 1751 of file spxsolver.cpp.

References SPxPricer::getNdualNorms(), and SPxSolver::thepricer.

Referenced by SoPlex::getNdualNorms().

SPxSolver::Status getPrimalray ( Vector vector) const
virtual

get primal ray in case of unboundedness.

Exceptions
SPxStatusExceptionif no problem loaded

Definition at line 1340 of file spxsolve.cpp.

References VectorBase< R >::clear(), SPxSolver::isInitialized(), SPxSolver::primalRay, SPxBasis::status(), SPxSolver::status(), and SPxBasis::UNBOUNDED.

Referenced by SoPlex::_storeSolutionReal(), and SoPlexLegacy::getPrimalray().

SPxSolver::Status getRedCost ( Vector vector) const
virtual

get vector of reduced costs.

This method returns the Status of the basis. If it is REGULAR or better, the vector of reduced costs of the current basis will be copied to the argument vector. Hence, vector must be of dimension nCols().

Let d denote the vector of dual variables, as defined above, and A the LPs constraint matrix. Then the reduced cost vector r is defined as $r^T = c^T - d^TA$.

Exceptions
SPxStatusExceptionif no problem loaded

Definition at line 1297 of file spxsolve.cpp.

References SPxBasis::baseId(), VectorBase< R >::clear(), SPxSolver::dim(), SPxSolver::fVec(), SPxSolver::isInitialized(), SPxLPBase< Real >::maxObj(), SPxLPBase< Real >::MINIMIZE, SPxLPBase< Real >::number(), SPxSolver::pVec(), SPxSolver::rep(), SPxSolver::ROW, SPxLPBase< Real >::spxSense(), and SPxSolver::status().

Referenced by SoPlex::_resolveWithoutPreprocessing(), SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), SoPlexLegacy::getRedCost(), SPxSolver::getResult(), and SoPlexLegacy::unsimplify().

SPxSolver::Status getResult ( Real value = 0,
Vector primal = 0,
Vector slacks = 0,
Vector dual = 0,
Vector reduCost = 0 
)
void getRhs ( Vector p_rhs) const

copy rhs value vector to p_rhs.

Definition at line 1972 of file spxsolver.h.

SPxSolver::Status getSlacks ( Vector vector) const
virtual

get vector of slack variables.

This method returns the Status of the basis. If it is REGULAR or better, the slack variables of the current basis will be copied to the argument vector. Hence, vector must be of dimension nRows().

Warning
Because SPxSolver supports range constraints as its default, slack variables are defined in a nonstandard way: Let x be the current solution vector and A the constraint matrix. Then the vector of slack variables is defined as $s = Ax$.
Exceptions
SPxStatusExceptionif no problem loaded

Definition at line 1376 of file spxsolve.cpp.

References SPxBasis::baseId(), SPxSolver::COLUMN, SPxBasis::Desc::D_FREE, SPxBasis::Desc::D_ON_BOTH, SPxBasis::Desc::D_ON_LOWER, SPxBasis::Desc::D_ON_UPPER, SPxBasis::Desc::D_UNDEFINED, SPxBasis::desc(), SPxSolver::dim(), SPxSolver::isInitialized(), SPxLPBase< Real >::lhs(), SPxLPBase< Real >::nRows(), SPxLPBase< Real >::number(), SPxBasis::Desc::P_FIXED, SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::pVec(), SPxSolver::rep(), SPxLPBase< Real >::rhs(), SPxBasis::Desc::rowStatus(), and SPxSolver::status().

Referenced by SoPlex::_resolveWithoutPreprocessing(), SoPlex::_solveRealForRational(), SoPlex::_storeSolutionReal(), SPxSolver::getResult(), SoPlexLegacy::getSlacks(), SPxSolver::qualSlackViolation(), and SoPlexLegacy::unsimplify().

Timer::TYPE getTiming ( )

set timing type

Definition at line 720 of file spxsolver.h.

void getUpper ( Vector p_up) const

copy upper bound vector to p_up.

Definition at line 1960 of file spxsolver.h.

void hyperPricing ( bool  h)
void init ( )
virtual

intialize data structures.

If SPxSolver is not initialized, the method solve() calls init() to setup all vectors and internal data structures. Most of the other methods within this section are called by init().

Derived classes should add the initialization of additional data structures by overriding this method. Don't forget, however, to call SPxSolver::init().

Definition at line 318 of file spxsolver.cpp.

References SPxSolver::coDim(), SPxSolver::COLUMN, SPxSolver::computeCoTest(), SPxSolver::computeEnterCoPrhs(), SPxSolver::computeFrhs(), SPxSolver::computeFtest(), SPxSolver::computeLeaveCoPrhs(), SPxSolver::computePvec(), SPxSolver::computeTest(), SPxBasis::coSolve(), SPxBasis::desc(), SPxSolver::dim(), SPxBasis::DUAL, SPxSolver::ENTER, SPxSolver::entertol(), SPxBasis::factorize(), SPxBasis::factorized, SPxSolver::infeasibilities, SPxSolver::infeasibilitiesCo, SPxSolver::initialized, SPxSolver::isInfeasible, SPxSolver::isInfeasibleCo, SPxSolver::lastShift, SPxSolver::leavetol(), SPxRatioTester::load(), SPxPricer::load(), SPxBasis::load(), SPxBasis::loadDesc(), SPxSolver::m_numCycle, SPxBasis::matrixIsSetup, SPxBasis::NO_PROBLEM, SPxBasis::PRIMAL, SPxSolver::reDim(), SPxSolver::rep(), DataArray< T >::reSize(), SPxSolver::ROW, SPxSolver::setBasisStatus(), SPxRatioTester::setDelta(), SPxSolver::setDualColBounds(), SPxSolver::setDualRowBounds(), SPxSolver::setEnterBounds(), SPxSolver::setLeaveBounds(), DIdxSet::setMax(), SPxSolver::setPrimalBounds(), SPxSolver::shiftFvec(), SPxSolver::shiftPvec(), SPxBasis::SINGULAR, SPxBasis::solve(), SPxBasis::solver(), SPxBasis::status(), SPxSolver::theCoPrhs, SPxSolver::theCoPvec, SPxSolver::theFrhs, SPxSolver::theFvec, SPxSolver::thepricer, SPxSolver::theratiotester, SPxSolver::theShift, and SPxSolver::type().

Referenced by SPxSolver::factorize(), SPxWeightST::generate(), and SPxSolver::solve().

bool isBasic ( const SPxId p_id) const

is the p_id 'th vector basic ?

Definition at line 1125 of file spxsolver.h.

bool isBasic ( const SPxRowId rid) const

is the rid 'th vector basic ?

Definition at line 1134 of file spxsolver.h.

bool isBasic ( const SPxColId cid) const

is the cid 'th vector basic ?

Definition at line 1140 of file spxsolver.h.

bool isBasic ( int  i) const

is the i 'th vector basic ?

Definition at line 1158 of file spxsolver.h.

bool isCoId ( const SPxId p_id) const

Is p_id a CoId.

This method returns wheather or not p_id identifies a coVector with respect to the chosen representation.

Definition at line 1000 of file spxsolver.h.

Referenced by SPxSteepPR::left4(), SPxFastRT::maxReEnter(), SPxFastRT::minReEnter(), SPxFastRT::selectEnter(), and SPxFastRT::shortEnter().

bool isColBasic ( int  i) const
bool isId ( const SPxId p_id) const

Is p_id an SPxId ?

This method returns wheather or not p_id identifies a vector with respect to the chosen representation.

Definition at line 991 of file spxsolver.h.

Referenced by SPxSteepPR::left4(), SPxFastRT::maxReEnter(), SPxFastRT::minReEnter(), SPxSolver::rejectEnter(), SPxParMultPR::selectEnter(), SPxSteepPR::setupWeights(), and SPxFastRT::shortEnter().

bool isInitialized ( ) const
protected

has the internal data been initialized?

As long as an instance of SPxSolver is not initialized, no member contains setup data. Initialization is performed via method init(). Afterwards all data structures are kept up to date (even for all manipulation methods), until unInit() is called. However, some manipulation methods call unInit() themselfs.

Definition at line 1695 of file spxsolver.h.

Referenced by SPxSolver::doRemoveCol(), SPxSolver::doRemoveCols(), SPxSolver::doRemoveRow(), SPxSolver::doRemoveRows(), SPxSolver::getDual(), SPxSolver::getDualfarkas(), SPxSolver::getPrimal(), SPxSolver::getPrimalray(), SPxSolver::getRedCost(), SPxSolver::getSlacks(), SPxSolver::reDim(), SPxSolver::setDual(), SPxSolver::setPricer(), SPxSolver::setPrimal(), SPxSolver::setRedCost(), SPxSolver::setSlacks(), SPxSolver::setTester(), SPxSolver::solve(), SPxSolver::unShift(), and SPxSolver::value().

bool isRowBasic ( int  i) const
bool isTimeLimitReached ( const bool  forceCheck = false)

returns whether current time limit is reached; call to time() may be skipped unless forceCheck is true

Definition at line 1440 of file spxsolver.cpp.

References SPxSolver::cumulativeTime(), soplex::infinity, MAXNCLCKSKIPS, SPxSolver::maxTime, SPxSolver::nCallsToTimelim, SPxSolver::nClckSkipsLeft, NINITCALLS, SAFETYFACTOR, and SPxSolver::time().

Referenced by SPxSolver::terminate().

int iterations ( ) const

get number of iterations of current solution.

Definition at line 1909 of file spxsolver.h.

Referenced by SoPlex::_solveRealLPAndRecordStatistics(), SPxAutoPR::setActivePricer(), and SPxSolver::solve().

Vector& lbBound ( )

lower bound for fVec, writable.

This method returns the lower bound for the feasibility vector. It may only be called for the ENTERing Simplex.

For the ENTERing Simplex algorithms, the feasibility vector is maintained to fullfill its bounds. As fVec itself, also its bound depend on the chosen representation. Further, they may need to be shifted (see below).

Definition at line 1228 of file spxsolver.h.

Vector& lcBound ( )

lower bound for coPvec.

This method returns the lower bound for coPvec. It may only be called for the leaving Simplex algorithm.

For the leaving Simplex algorithms coPvec is maintained to fullfill its bounds. As coPvec itself, also its bound depend on the chosen representation. Further, they may need to be shifted (see below).

Definition at line 1308 of file spxsolver.h.

bool leave ( int  i)
private

let index i leave the basis and manage entering of another one.

Returns
false if LP is unbounded/infeasible.
Todo:
if shift() is not zero we must not conclude unboundedness

Definition at line 595 of file leave.cpp.

References DSVectorBase< R >::add(), SPxBasis::baseId(), SPxBasis::baseVec(), SPxSolver::basis(), SPxSolver::boundflips, SPxBasis::change(), SVectorBase< R >::clear(), SSVectorBase< R >::clear(), SPxBasis::Desc::colStatus(), SPxSolver::COLUMN, SPxSolver::computeFrhs(), SPxSolver::computeFtest(), SPxSolver::coPvec(), SPxBasis::coSolve(), SPxBasis::Desc::D_FREE, UpdateVector::delta(), SPxSolver::delta(), SPxBasis::desc(), SPxSolver::dim(), SPxSolver::doPupdate(), SPxSolver::dualFarkas, SPxSolver::entertol(), SPxSolver::enterVector(), SPxSolver::epsilon(), SPxSolver::factorize(), SPxSolver::forceRecompNonbasicValue(), SPxSolver::fRhs(), SPxSolver::fVec(), SPxSolver::getLeaveVals(), SPxSolver::getLeaveVals2(), SPxBasis::INFEASIBLE, soplex::infinity, SPxSolver::initialized, SPxSolver::instableLeave, SPxSolver::instableLeaveNum, SPxSolver::instableLeaveVal, SPxSolver::isBasic(), UpdateVector::isConsistent(), SSVectorBase< R >::isConsistent(), SSVectorBase< R >::isSetup(), SPxId::isSPxRowId(), SPxId::isValid(), SPxBasis::iteration(), SPxBasis::lastUpdate(), SPxSolver::LEAVE, SPxSolver::leavetol(), VectorBase< R >::length(), SSVectorBase< R >::length(), SPxSolver::m_maxCycle, SPxSolver::m_numCycle, MSG_DEBUG, MSG_INFO2, MSG_INFO3, VectorBase< R >::multAdd(), SPxBasis::multBaseWith(), SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::perturbMaxLeave(), SPxSolver::perturbMinLeave(), SPxSolver::primalRay, SPxSolver::primVec, soplex::reject_leave_tol, SPxSolver::rejectLeave(), SPxSolver::rep(), SPxSolver::ROW, SPxBasis::Desc::rowStatus(), SPxRatioTester::selectEnter(), SPxSolver::setBasisStatus(), DSVectorBase< R >::setMax(), SPxSolver::setupPupdate(), soplex::sign(), SSVectorBase< R >::size(), ClassArray< Nonzero< Real > >::size(), SPxBasis::solve(), SPxBasis::solve4update(), SPxSolver::solveVector2, SPxSolver::solveVector2rhs, SPxSolver::solveVector3, SPxSolver::solveVector3rhs, soplex::spxAbs(), SPxSolver::spxout, SPxSolver::theCoPvec, SPxSolver::theCoTest, SPxSolver::theFrhs, SPxSolver::theFvec, SPxSolver::theLBbound, SPxSolver::theLCbound, SPxSolver::theLRbound, SPxSolver::thePvec, SPxSolver::theratiotester, SPxSolver::theShift, SPxSolver::theUBbound, SPxSolver::theUCbound, SPxSolver::theURbound, SPxSolver::totalboundflips, SPxSolver::type(), SPxBasis::UNBOUNDED, SPxSolver::unitVecs, UpdateVector::update(), SPxSolver::updateFtest(), SPxSolver::updateNonbasicValue(), UpdateVector::value(), and SPxSolver::value().

Referenced by SPxSolver::solve().

void localAddCols ( int  start)
private
void localAddRows ( int  start)
private
Vector& lpBound ( )

lower bound for pVec.

This method returns the lower bound for pVec. It may only be called for the leaving Simplex algorithm.

For the leaving Simplex algorithms pVec is maintained to fullfill its bounds. As pVec itself, also its bound depend on the chosen representation. Further, they may need to be shifted (see below).

Definition at line 1374 of file spxsolver.h.

int maxCycle ( ) const

maximum number of degenerate simplex steps before we detect cycling.

SPxSolver considers a Simplex step as degenerate if the steplength does not exceed epsilon(). Cycling occurs if only degenerate steps are taken. To prevent this situation, SPxSolver perturbs the problem such that nondegenerate steps are ensured.

maxCycle() controls how agressive such perturbation is performed, since no more than maxCycle() degenerate steps are accepted before perturbing the LP. The current number of consecutive degenerate steps is counted by numCycle().

Definition at line 750 of file spxsolver.h.

Referenced by SPxHarrisRT::degenerateEps().

Real maxInfeas ( ) const
virtual

maximal infeasibility of basis

This method is called before concluding optimality. Since it is possible that some stable implementation of class SPxRatioTester yielded a slightly infeasible (or unpriced) basis, this must be checked before terminating with an optimal solution.

Definition at line 625 of file spxsolver.cpp.

References SPxSolver::coDim(), SPxSolver::dim(), SPxSolver::ENTER, SPxSolver::LEAVE, MAXIMUM, SPxSolver::theCoLbound, SPxSolver::theCoPvec, SPxSolver::theFvec, SPxSolver::theLBbound, SPxSolver::theLbound, SPxSolver::thePvec, SPxSolver::theUBbound, and SPxSolver::type().

Referenced by SPxSolver::solve(), and SPxSolver::terminate().

int numCycle ( ) const

actual number of degenerate simplex steps encountered so far.

Definition at line 755 of file spxsolver.h.

Referenced by SPxHarrisRT::degenerateEps().

virtual Real objValue ( )
virtual

get objective value of current solution.

Definition at line 1832 of file spxsolver.h.

Referenced by SoPlex::_storeSolutionReal().

SPxSolver & operator= ( const SPxSolver base)

assignment operator

assignment operator and copy constructor

Definition at line 993 of file spxsolver.cpp.

References SPxSolver::addVec, SPxStarter::clone(), SPxRatioTester::clone(), SPxPricer::clone(), LPColSetBase< Real >::colSet(), SPxSolver::COLUMN, SPxSolver::displayFreq, SPxSolver::dualFarkas, SPxSolver::dualRhs, SPxSolver::dualVec, SPxSolver::enterCount, SPxSolver::freePricer, SPxSolver::freeRatioTester, SPxSolver::freeStarter, SPxSolver::hyperPricingEnter, SPxSolver::hyperPricingLeave, SPxSolver::infeasibilities, SPxSolver::infeasibilitiesCo, SPxSolver::initialized, SPxSolver::instableEnter, SPxSolver::instableEnterId, SPxSolver::instableLeave, SPxSolver::instableLeaveNum, SPxSolver::isConsistent(), SPxSolver::isInfeasible, SPxSolver::isInfeasibleCo, SPxSolver::lastShift, SPxSolver::leaveCount, SPxRatioTester::load(), SPxPricer::load(), SPxSolver::m_entertol, SPxSolver::m_leavetol, SPxSolver::m_maxCycle, SPxSolver::m_numCycle, SPxSolver::m_status, SPxSolver::maxIters, SPxSolver::maxTime, SPxSolver::objLimit, SPxBasis::operator=(), SPxLPBase< Real >::operator=(), SPxSolver::primalRay, SPxSolver::primRhs, SPxSolver::primVec, SPxSolver::remainingRoundsEnter, SPxSolver::remainingRoundsEnterCo, SPxSolver::remainingRoundsLeave, SPxSolver::ROW, LPRowSetBase< Real >::rowSet(), SPxSolver::sparsePricingEnter, SPxSolver::sparsePricingEnterCo, SPxSolver::sparsePricingFactor, SPxSolver::sparsePricingLeave, SPxSolver::theCoLbound, SPxSolver::theCoPrhs, SPxSolver::theCoPvec, SPxSolver::theCoTest, SPxSolver::theCoUbound, SPxSolver::thecovectors, SPxSolver::theCPvec, SPxSolver::theCumulativeTime, SPxSolver::theFrhs, SPxSolver::theFvec, SPxSolver::theLBbound, SPxSolver::theLbound, SPxSolver::theLCbound, SPxBasis::theLP, SPxSolver::theLRbound, SPxSolver::thepricer, SPxSolver::thePricing, SPxSolver::thePvec, SPxSolver::theratiotester, SPxSolver::theRep, SPxSolver::theRPvec, SPxSolver::theShift, SPxSolver::thestarter, SPxSolver::theTest, SPxSolver::theType, SPxSolver::theUBbound, SPxSolver::theUbound, SPxSolver::theUCbound, SPxSolver::theURbound, SPxSolver::thevectors, SPxSolver::timerType, and SPxSolver::unitVecs.

Real perturbMax ( const UpdateVector uvec,
Vector low,
Vector up,
Real  eps,
Real  delta,
const SPxBasis::Desc::Status stat,
int  start,
int  incr 
) const
private
Real perturbMin ( const UpdateVector uvec,
Vector low,
Vector up,
Real  eps,
Real  delta,
const SPxBasis::Desc::Status stat,
int  start,
int  incr 
) const
private
bool precisionReached ( Real newpricertol) const
protectedvirtual

is the solution precise enough, or should we increase delta() ?

Todo:
check separately for ENTER and LEAVE algorithm

Definition at line 37 of file spxsolve.cpp.

References SPxPricer::epsilon(), SPxSolver::feastol(), MSG_INFO3, SPxSolver::opttol(), SPxSolver::qualBoundViolation(), SPxSolver::qualConstraintViolation(), SPxSolver::qualRedCostViolation(), SPxSolver::spxout, and SPxSolver::thepricer.

Referenced by SPxSolver::solve().

const SPxPricer* pricer ( ) const

return loaded SPxPricer.

Definition at line 1616 of file spxsolver.h.

Referenced by SoPlex::_solveRealStable(), SoPlex::getPricerName(), and SPxSolver::writeState().

Pricing pricing ( ) const
int primalIterations ( )

return number of iterations done with primal algorithm

Definition at line 1915 of file spxsolver.h.

Referenced by SoPlex::_solveRealLPAndRecordStatistics().

void qualBoundViolation ( Real maxviol,
Real sumviol 
) const
virtual
void qualRedCostViolation ( Real maxviol,
Real sumviol 
) const
virtual
void qualSlackViolation ( Real maxviol,
Real sumviol 
) const
virtual
const SPxRatioTester* ratiotester ( ) const
bool read ( std::istream &  in,
NameSet rowNames = 0,
NameSet colNames = 0,
DIdxSet intVars = 0 
)
virtual
bool readBasisFile ( const char *  filename,
const NameSet rowNames,
const NameSet colNames 
)
virtual

Load basis from filename in MPS format. If rowNames and colNames are NULL, default names are used for the constraints and variables.

Definition at line 24 of file spxfileio.cpp.

References SPxBasis::readBasis().

Referenced by SoPlexLegacy::readBasisFile(), and SoPlex::readBasisFile().

void rejectEnter ( SPxId  enterId,
Real  enterTest,
SPxBasis::Desc::Status  enterStat 
)
protectedvirtual
Representation rep ( ) const

return the current basis representation.

Definition at line 401 of file spxsolver.h.

Referenced by SoPlex::_solveRealLPAndRecordStatistics(), SPxBasis::addedCols(), SPxBasis::addedRows(), SPxSolver::changeLhsStatus(), SPxSolver::changeLowerStatus(), SPxSolver::changeRhsStatus(), SPxSolver::changeUpperStatus(), SPxSolver::computeEnterCoPrhs4Col(), SPxSolver::computeEnterCoPrhs4Row(), SPxSolver::computeFrhs(), SPxSolver::computeFrhsXtra(), SPxSolver::coTest(), SPxBasis::Desc::Desc(), SPxSolver::doRemoveCol(), SPxSolver::doRemoveCols(), SPxSolver::doRemoveRow(), SPxSolver::doRemoveRows(), SPxSolver::enter(), SPxBoundFlippingRT::flipAndUpdate(), SPxWeightST::generate(), SoPlex::getBasisInd(), SoPlex::getBasisInverseColReal(), SoPlex::getBasisInverseRowReal(), SoPlex::getBasisInverseTimesVecReal(), SPxSolver::getDual(), SPxPricer::getDualNorms(), SPxSolver::getLeaveVals(), SPxSolver::getLeaveVals2(), SPxPricer::getNdualNorms(), SPxSolver::getPrimal(), SPxSolver::getRedCost(), SPxSolver::getSlacks(), SPxSolver::init(), SPxSolver::isConsistent(), SPxSolver::leave(), SPxDevexPR::load(), SPxSolver::nonbasicValue(), SPxSolver::perturbMax(), SPxSolver::perturbMin(), SPxSolver::reinitializeVecs(), SPxBasis::removedCol(), SPxBasis::removedCols(), SPxBasis::removedRow(), SPxBasis::removedRows(), SoPlexLegacy::rep(), SPxBasis::restoreInitialBasis(), SPxWeightPR::selectEnter(), SPxBoundFlippingRT::selectEnter(), SPxWeightPR::selectLeave(), SPxBoundFlippingRT::selectLeave(), SPxSolver::setDual(), SPxSolver::setDualColBounds(), SPxPricer::setDualNorms(), SPxSolver::setDualRowBounds(), SPxSolver::setLeaveBound4Row(), SPxSolver::setPrimal(), SPxSolver::setPrimalBounds(), SPxSolver::setRedCost(), SPxBasis::setRep(), SPxSolver::setSlacks(), SPxSteepPR::setupPrefsX(), SPxWeightST::setupWeights(), SPxSolver::solve(), SPxSolver::terminate(), SPxSolver::test(), SPxSolver::unShift(), SPxSolver::value(), and SPxSolver::writeState().

void resetClockStats ( )
protected

resets clock average statistics

Definition at line 311 of file spxsolver.cpp.

References SPxSolver::nCallsToTimelim, SPxSolver::nClckSkipsLeft, and SPxSolver::theCumulativeTime.

Referenced by SPxSolver::loadLP().

void resetCumulativeTime ( )

reset cumulative time counter to zero.

Definition at line 1897 of file spxsolver.h.

SPxRowId rowId ( int  i) const

RowId of i 'th inequality.

Mapping between numbers and Ids

Definition at line 1999 of file spxsolver.h.

Referenced by SPxBasis::readBasis().

const LPRowSet& rows ( ) const

return const lp's rows if available.

Definition at line 1943 of file spxsolver.h.

SPxSense sense ( ) const

optimization sense.

Definition at line 1978 of file spxsolver.h.

void setDelta ( Real  d)

set parameter delta, i.e., set feastol and opttol to same value.

Definition at line 879 of file spxsolver.cpp.

References SPxSolver::m_entertol, and SPxSolver::m_leavetol.

Referenced by SoPlex::_solveRealStable(), SoPlexLegacy::setDelta(), and SPxSolver::SPxSolver().

void setDisplayFreq ( int  freq)

set display frequency

Definition at line 727 of file spxsolver.h.

Referenced by SoPlex::setIntParam().

bool setDualNorms ( int  nnormsRow,
int  nnormsCol,
Real norms 
)

set dual norms

Definition at line 1763 of file spxsolver.cpp.

References SPxPricer::setDualNorms(), and SPxSolver::thepricer.

Referenced by SoPlex::setDualNorms().

void setEnterBound4Row ( int  i,
int  n 
)
protected

This sets up the bounds for basic variables for entering simplex algorithms. It requires, that all upper lower feasibility bounds have allready been setup. Method |setEnterBound4Row(i, n)| does so for the |i|-th basis variable being row index |n|. Equivalently, method |setEnterBound4Col(i, n)| does so for the |i|-th basis variable being column index |n|.

Definition at line 165 of file spxbounds.cpp.

References SPxBasis::baseId(), SPxBasis::desc(), soplex::infinity, SPxLPBase< Real >::number(), SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::theLBbound, SPxSolver::theLRbound, SPxSolver::theUBbound, and SPxSolver::theURbound.

Referenced by SPxSolver::setEnterBounds().

void setLeaveBound4Row ( int  i,
int  n 
)
protected

This sets up the bounds for basic variables for leaving simplex algorithms. While method |setLeaveBound4Row(i,n)| does so for the |i|-th basic variable being the |n|-th row, |setLeaveBound4Col(i,n)| does so for the |i|-th basic variable being the |n|-th column.

Definition at line 229 of file spxbounds.cpp.

References SPxBasis::baseId(), SPxSolver::COLUMN, SPxBasis::desc(), soplex::infinity, SPxLPBase< Real >::lhs(), SPxLPBase< Real >::maxRowObj(), SPxLPBase< Real >::number(), SPxBasis::Desc::P_FREE, SPxBasis::Desc::P_ON_LOWER, SPxBasis::Desc::P_ON_UPPER, SPxSolver::rep(), SPxLPBase< Real >::rhs(), SPxSolver::theLBbound, and SPxSolver::theUBbound.

Referenced by SPxSolver::setLeaveBounds().

void setOutstream ( SPxOut newOutstream)

Definition at line 382 of file spxsolver.h.

Referenced by SoPlex::operator=(), SoPlex::SoPlex(), and SoPlexLegacy::SoPlexLegacy().

void setPricer ( SPxPricer pricer,
const bool  destroy = false 
)
virtual

setup pricer to use. If destroy is true, pricer will be freed in destructor.

Definition at line 102 of file spxsolver.cpp.

References SPxPricer::clear(), SPxSolver::freePricer, SPxSolver::FULL, SPxSolver::isInitialized(), SPxPricer::load(), SPxSolver::setPricing(), and SPxSolver::thepricer.

Referenced by SoPlex::setIntParam(), SoPlexLegacy::setPricer(), and SoPlexLegacy::SoPlexLegacy().

void setPrimalBounds ( )
protected

setup feasibility bounds for entering algorithm

Setting up the feasiblity bound for normal primal variables is straightforward. However, slack variables need some more details on how we treate them. This is slightly different from usual textbook versions. Let $l_i \le A_i^T x \le u_i$. This can be transformed to $A_i^Tx + s_i = 0$, with $-u_i \le s_i \le -l_i$. Hence, with this definition of slack variables $s_i$, we can directly use vectors $l$ and $u$ as feasibility bounds.

Definition at line 32 of file spxbounds.cpp.

References SPxLPBase< Real >::lhs(), SPxLPBase< Real >::lower(), SPxSolver::rep(), SPxLPBase< Real >::rhs(), SPxSolver::ROW, SPxSolver::theLCbound, SPxSolver::theLRbound, SPxSolver::theUCbound, SPxSolver::theURbound, and SPxLPBase< Real >::upper().

Referenced by SPxSolver::init(), and SPxSolver::reinitializeVecs().

void setRep ( Representation  p_rep)

switch to ROW or COLUMN representation if not already used.

Definition at line 257 of file spxsolver.cpp.

References SPxSolver::initRep(), and SPxSolver::theRep.

Referenced by SoPlex::_solveRealLPAndRecordStatistics(), and SoPlexLegacy::setRep().

void setSolver ( SLinSolver slu,
const bool  destroy = false 
)
virtual

setup linear solver to use. If destroy is true, slusolver will be freed in destructor.

Definition at line 84 of file spxsolver.cpp.

References SPxBasis::loadSolver(), SLinSolver::spxout, and SPxSolver::spxout.

Referenced by SoPlexLegacy::operator=(), SoPlex::operator=(), SoPlex::SoPlex(), and SoPlexLegacy::SoPlexLegacy().

void setSparsePricingFactor ( Real  fac)

Definition at line 732 of file spxsolver.h.

Referenced by SoPlex::_solveRealLPAndRecordStatistics().

void setStarter ( SPxStarter starter,
const bool  destroy = false 
)
virtual

setup starting basis generator to use. If destroy is true, starter will be freed in destructor.

Definition at line 155 of file spxsolver.cpp.

References SPxSolver::freeStarter, and SPxSolver::thestarter.

Referenced by SoPlexLegacy::setStarter(), and SoPlexLegacy::SoPlexLegacy().

void setTerminationIter ( int  iteration = -1)
virtual

set iteration limit.

Definition at line 1427 of file spxsolver.cpp.

References SPxSolver::maxIters.

Referenced by SoPlex::_solveRealLPAndRecordStatistics(), and SoPlexLegacy::setTerminationIter().

void setTerminationTime ( Real  time = infinity)
virtual

set time limit.

Limits and status inquiry

Definition at line 1415 of file spxsolver.cpp.

References soplex::infinity, and SPxSolver::maxTime.

Referenced by SoPlex::_solveRealLPAndRecordStatistics(), and SoPlexLegacy::setTerminationTime().

void setTerminationValue ( Real  p_value = infinity)
virtual

set objective limit.

Todo:
A first version for the termination value is implemented. Currently we check if no bound violations (shifting) is present. It might be even possible to use this termination value in case of bound violations (shifting) but in this case it is quite difficult to determine if we already reached the limit.

Definition at line 1479 of file spxsolver.cpp.

References SPxSolver::objLimit.

Referenced by SoPlex::_preprocessAndSolveReal(), SoPlex::_solveRational(), and SoPlexLegacy::setTerminationValue().

void setTester ( SPxRatioTester tester,
const bool  destroy = false 
)
virtual

setup ratio-tester to use. If destroy is true, tester will be freed in destructor.

Definition at line 129 of file spxsolver.cpp.

References SPxRatioTester::clear(), SPxSolver::freeRatioTester, SPxSolver::isInitialized(), SPxRatioTester::load(), and SPxSolver::theratiotester.

Referenced by SoPlex::setIntParam(), SoPlexLegacy::setTester(), and SoPlexLegacy::SoPlexLegacy().

void setTiming ( Timer::TYPE  ttype)

set timing type

Definition at line 714 of file spxsolver.h.

Referenced by SoPlex::setIntParam().

void setup4coSolve ( SSVector p_y,
SSVector p_rhs 
)

Setup vectors to be cosolved within Simplex loop.

Load vector y to be coSolved with the basis matrix during the ENTER Simplex. The system will be solved after SPxSolver's call to SPxRatioTester. The system will be solved along with another system. Solving two linear system at a time has performance advantages over solving the two linear systems seperately.

Definition at line 1572 of file spxsolver.h.

Referenced by SPxSteepPR::selectEnter().

void setup4coSolve2 ( SSVector p_z,
SSVector p_rhs 
)

Setup vectors to be cosolved within Simplex loop.

Load a second vector z to be coSolved with the basis matrix during the ENTER Simplex. The system will be solved after SPxSolver's call to SPxRatioTester. The system will be solved along with two other systems.

Definition at line 1584 of file spxsolver.h.

Referenced by SPxBoundFlippingRT::flipAndUpdate().

void setup4solve ( SSVector p_y,
SSVector p_rhs 
)

Setup vectors to be solved within Simplex loop.

Load vector y to be solved with the basis matrix during the LEAVE Simplex. The system will be solved after SPxSolver's call to SPxRatioTester. The system will be solved along with another system. Solving two linear system at a time has performance advantages over solving the two linear systems seperately.

Definition at line 1544 of file spxsolver.h.

Referenced by SPxSteepPR::selectLeave().

void setup4solve2 ( SSVector p_y2,
SSVector p_rhs2 
)

Setup vectors to be solved within Simplex loop.

Load a second additional vector y2 to be solved with the basis matrix during the LEAVE Simplex. The system will be solved after SPxSolver's call to SPxRatioTester. The system will be solved along with at least one other system. Solving several linear system at a time has performance advantages over solving them seperately.

Definition at line 1558 of file spxsolver.h.

Referenced by SPxBoundFlippingRT::flipAndUpdate().

void shiftLBbound ( int  i,
Real  to 
)
void shiftLCbound ( int  i,
Real  to 
)

shift i 'th lcBound to to.

Definition at line 1467 of file spxsolver.h.

Referenced by SPxBoundFlippingRT::getData(), SPxHarrisRT::selectEnter(), and SPxSolver::shiftPvec().

void shiftLPbound ( int  i,
Real  to 
)

shift i 'th lpBound to to.

Definition at line 1453 of file spxsolver.h.

Referenced by SPxBoundFlippingRT::getData(), SPxHarrisRT::selectEnter(), and SPxSolver::shiftPvec().

void shiftUBbound ( int  i,
Real  to 
)
void shiftUCbound ( int  i,
Real  to 
)

shift i 'th ucBound to to.

Definition at line 1460 of file spxsolver.h.

Referenced by SPxBoundFlippingRT::getData(), SPxHarrisRT::selectEnter(), and SPxSolver::shiftPvec().

void shiftUPbound ( int  i,
Real  to 
)

shift i 'th upBound to to.

Definition at line 1446 of file spxsolver.h.

Referenced by SPxBoundFlippingRT::getData(), SPxHarrisRT::selectEnter(), and SPxSolver::shiftPvec().

const SLinSolver* slinSolver ( ) const

return loaded SLinSolver.

Definition at line 1621 of file spxsolver.h.

Referenced by SPxSolver::printDisplayLine(), and SPxSolver::solve().

SPxSolver::Status solve ( )
virtual

solve loaded LP.

Solves the loaded LP by processing the Simplex iteration until the termination criteria is fullfilled (see terminate()). The SPxStatus of the solver will indicate the reason for termination.

Exceptions
SPxStatusExceptionif either no problem, solver, pricer or ratiotester loaded or if solve is still running when it shouldn't be
Todo:
!= REGULAR is not enough. Also OPTIMAL/DUAL/PRIMAL should be tested and acted accordingly.
Todo:
technically it would be ok to finish already when (priced && maxinfeas + shift() <= entertol()) is satisfied; maybe at least in the case when SoPlex keeps jumping back between ENTER and LEAVE always shifting (looping), we may relax this condition here; note also that unShift may increase shift() slightly due to roundoff errors
Todo:
technically it would be ok to finish already when (priced && maxinfeas + shift() <= entertol()) is satisfied; maybe at least in the case when SoPlex keeps jumping back between ENTER and LEAVE always shifting (looping), we may relax this condition here; note also that unShift may increase shift() slightly due to roundoff errors

Definition at line 73 of file spxsolve.cpp.

References SPxSolver::ABORT_CYCLING, SPxSolver::ABORT_ITER, DIdxSet::addIdx(), SPxBasis::baseId(), SPxSolver::basis(), SPxSolver::boundflips, SPxSolver::clearUpdateVecs(), SPxSolver::coDim(), SPxSolver::COLUMN, SPxSolver::computeCoTest(), SPxSolver::computeFtest(), SPxSolver::computeTest(), SPxSolver::coSolveVector2, SPxSolver::coSolveVector3, SPxBasis::desc(), SPxSolver::dim(), SPxBasis::DUAL, SPxSolver::ENTER, SPxSolver::enter(), SPxSolver::enterCount, SPxPricer::entered4(), SPxSolver::entertol(), SPxPricer::epsilon(), SPxSolver::epsilon(), SPxSolver::ERROR, SPxSolver::factorize(), SPxSolver::feastol(), SPxSolver::forceRecompNonbasicValue(), SPxSolver::fRhs(), SPxSolver::fTest(), SPxSolver::fVec(), SPxStarter::generate(), SPxRatioTester::getDelta(), SPxSolver::getPrimal(), soplex::GT(), SPxSolver::hyperPricingEnter, SPxSolver::hyperPricingLeave, SVectorBase< R >::index(), SPxSolver::infeasibilities, SPxSolver::infeasibilitiesCo, soplex::infinity, SPxSolver::init(), SPxSolver::instableEnter, SPxSolver::instableEnterId, SPxSolver::instableEnterVal, SPxSolver::instableLeave, SPxSolver::instableLeaveNum, SPxSolver::instableLeaveVal, SPxSolver::isColBasic(), SPxSolver::isInfeasible, SPxSolver::isInfeasibleCo, SPxSolver::isInitialized(), SPxSolver::isRowBasic(), SPxId::isSPxColId(), SPxId::isSPxRowId(), SPxId::isValid(), SPxBasis::iteration(), SPxSolver::iterations(), SPxBasis::iterCount, SPxBasis::lastEntered(), SPxBasis::lastIndex(), SPxBasis::lastLeft(), SPxBasis::lastUpdate(), SPxSolver::LEAVE, SPxSolver::leave(), SPxSolver::leaveCount, SPxSolver::leavetol(), SPxPricer::left4(), SPxLPBase< Real >::lhs(), SPxBasis::load(), SPxSolver::loadBasis(), SPxLPBase< Real >::lower(), soplex::LT(), SPxSolver::m_entertol, SPxSolver::m_leavetol, SPxSolver::m_numCycle, SPxSolver::m_status, SPxBasis::matrixIsSetup, MAXCYCLES, SPxSolver::maxInfeas(), SPxSolver::maxIters, MAXREFACPIVOTS, MAXSTALLRECOVERS, MAXSTALLS, MSG_DEBUG, MSG_ERROR, MSG_INFO2, MSG_INFO3, MSG_WARNING, SPxLPBase< Real >::nCols(), SPxSolver::NO_PRICER, SPxSolver::NO_PROBLEM, SPxSolver::NO_RATIOTESTER, SPxSolver::NO_SOLVER, SPxPricer::NOT_VIOLATED, SPxLPBase< Real >::nRows(), SPxLPBase< Real >::number(), SPxBasis::OPTIMAL, SPxSolver::OPTIMAL, SPxSolver::opttol(), SPxSolver::precisionReached(), SPxBasis::PRIMAL, SPxSolver::primalCount, SPxSolver::printDisplayLine(), SPxBasis::REGULAR, SPxSolver::REGULAR, SPxSolver::rep(), Timer::reset(), SPxLPBase< Real >::rhs(), SPxLPBase< Real >::rowVector(), SPxSolver::RUNNING, SPxPricer::selectEnter(), SPxPricer::selectLeave(), SPxSolver::setBasisStatus(), SPxRatioTester::setDelta(), SPxPricer::setEpsilon(), SPxPricer::setType(), SPxRatioTester::setType(), SPxSolver::setType(), SPxSolver::shift(), SPxBasis::SINGULAR, SPxSolver::SINGULAR, SVectorBase< R >::size(), SPxSolver::slinSolver(), SPxRatioTester::solver(), SPxPricer::solver(), SPxSolver::solveVector2, SPxSolver::solveVector3, SPxSolver::sparsePricingEnter, SPxSolver::sparsePricingEnterCo, SPxSolver::sparsePricingLeave, soplex::spxAbs(), SPxSolver::spxout, Timer::start(), SPxBasis::status(), SPxSolver::status(), Timer::stop(), SPxSolver::terminate(), SPxSolver::testBounds(), SPxSolver::theCoTest, SPxSolver::theCumulativeTime, SPxSolver::thepricer, SPxSolver::theratiotester, SPxSolver::thestarter, SPxSolver::theTest, SPxSolver::theTime, SPxSolver::time(), SPxSolver::totalboundflips, SPxSolver::type(), SPxSolver::UNKNOWN, SPxSolver::unShift(), SPxSolver::updateViols, SPxSolver::updateViolsCo, SPxLPBase< Real >::upper(), SVectorBase< R >::value(), SPxSolver::value(), and SPxPricer::VIOLATED.

Referenced by SoPlex::_solveRealLPAndRecordStatistics(), and SoPlexLegacy::solve().

SPxStarter* starter ( ) const

return current starter.

Definition at line 419 of file spxsolver.h.

std::string statistics ( ) const

returns statistical information in form of a string.

Definition at line 1984 of file spxsolver.h.

Referenced by SoPlexLegacy::statistics().

int subversion ( ) const

return the internal subversion of SPxSolver as number

Definition at line 396 of file spxsolver.h.

bool terminate ( )
virtual

Termination criterion.

This method is called in each Simplex iteration to determine, if the algorithm is to terminate. In this case a nonzero value is returned.

This method is declared virtual to allow for implementation of other stopping criteria or using it as callback method within the Simplex loop, by overriding the method in a derived class. However, all implementations must terminate with the statement return SPxSolver::terminate(), if no own termination criteria is encountered.

Note, that the Simplex loop stopped even when terminate() returns 0, if the LP has been solved to optimality (i.e. no further pricing succeeds and no shift is present).

Definition at line 1099 of file spxsolve.cpp.

References SPxSolver::ABORT_TIME, SPxSolver::ABORT_VALUE, SPxSolver::computeEnterCoPrhs(), SPxSolver::computeFrhs(), SPxSolver::computeLeaveCoPrhs(), SPxSolver::computePvec(), SPxSolver::computeTest(), SPxBasis::coSolve(), SPxSolver::dim(), SPxSolver::ENTER, SPxSolver::entertol(), SPxSolver::epsilon(), SPxSolver::factorize(), SPxSolver::FULL, soplex::infinity, SPxSolver::isTimeLimitReached(), SPxBasis::iteration(), SPxSolver::leavetol(), VectorBase< R >::length(), SPxSolver::m_status, SPxSolver::maxInfeas(), SPxSolver::maxTime, MSG_DEBUG, MSG_INFO2, MSG_INFO3, MSG_WARNING, SPxSolver::objLimit, SPxBasis::OPTIMAL, SPxSolver::opttol(), SPxSolver::pricing(), SPxSolver::rep(), SPxSolver::shift(), SPxBasis::SINGULAR, SPxBasis::solve(), SPxSolver::spxout, SPxLPBase< Real >::spxSense(), SPxBasis::status(), SPxSolver::testVecs(), SPxSolver::theCoPrhs, SPxSolver::theCoPvec, SPxSolver::theFrhs, SPxSolver::theFvec, SPxSolver::type(), SPxSolver::UNKNOWN, SPxSolver::unShift(), SPxBasis::updateCount, and SPxSolver::value().

Referenced by SPxSolver::solve(), and SoPlexLegacy::terminate().

int terminationIter ( ) const
virtual

return iteration limit.

Definition at line 1434 of file spxsolver.cpp.

References SPxSolver::maxIters.

Referenced by SoPlexLegacy::terminationIter().

Real terminationTime ( ) const
virtual

return time limit.

Definition at line 1422 of file spxsolver.cpp.

References SPxSolver::maxTime.

Referenced by SoPlexLegacy::terminationTime().

Real terminationValue ( ) const
virtual

return objective limit.

Definition at line 1484 of file spxsolver.cpp.

References SPxSolver::objLimit.

Referenced by SoPlexLegacy::terminationValue().

Real time ( ) const

time spent in last call to method solve().

Definition at line 1928 of file spxsolver.h.

Referenced by SPxSolver::isTimeLimitReached(), SPxSolver::printDisplayLine(), and SPxSolver::solve().

Vector& ubBound ( )

upper bound for fVec, writable.

This method returns the upper bound for the feasibility vector. It may only be called for the ENTERing Simplex.

For the ENTERing Simplex algorithms, the feasibility vector is maintained to fullfill its bounds. As fVec itself, also its bounds depend on the chosen representation. Further, they may need to be shifted (see below).

Definition at line 1210 of file spxsolver.h.

Vector& ucBound ( )

upper bound for coPvec.

This method returns the upper bound for coPvec. It may only be called for the leaving Simplex algorithm.

For the leaving Simplex algorithms coPvec is maintained to fullfill its bounds. As coPvec itself, also its bound depend on the chosen representation. Further, they may need to be shifted (see below).

Definition at line 1287 of file spxsolver.h.

void ungetEnterVal ( SPxId  enterId,
SPxBasis::Desc::Status  enterStat,
Real  leaveVal,
const SVector vec,
Real objChange 
)
protectedvirtual
const SVector& unitVector ( int  i) const
Vector& upBound ( )

upper bound for pVec.

This method returns the upper bound for pVec. It may only be called for the leaving Simplex algorithm.

For the leaving Simplex algorithms pVec is maintained to fullfill its bounds. As pVec itself, also its bound depend on the chosen representation. Further, they may need to be shifted (see below).

Definition at line 1353 of file spxsolver.h.

SPxBasis::Desc::Status varStatus ( int  i) const

Status of i 'th variable.

Definition at line 1107 of file spxsolver.h.

const SVector& vector ( const SPxRowId rid) const

Definition at line 1019 of file spxsolver.h.

const SVector& vector ( const SPxColId cid) const

Definition at line 1027 of file spxsolver.h.

const SVector& vector ( const SPxId p_id) const

vector associated to p_id.

Returns
Returns a reference to the vector of the loaded LP corresponding to id (with respect to the chosen representation). If p_id is an id, a vector of the constraint matrix is returned, otherwise the corresponding unit vector (of the slack variable or bound inequality) is returned.
Todo:
The implementation does not exactly look like it will do what is promised in the describtion.

Definition at line 1044 of file spxsolver.h.

int version ( ) const

return the version of SPxSolver as number like 123 for 1.2.3

Definition at line 391 of file spxsolver.h.

bool writeBasisFile ( const char *  filename,
const NameSet rowNames,
const NameSet colNames,
const bool  cpxFormat = false 
) const
virtual

Write basis to filename in MPS format. If rowNames and colNames are NULL, default names are used for the constraints and variables.

Definition at line 39 of file spxfileio.cpp.

Referenced by SoPlex::writeBasisFile(), and SPxSolver::writeState().

bool writeState ( const char *  filename,
const NameSet rowNames = NULL,
const NameSet colNames = NULL,
const bool  cpxFormat = false 
) const
virtual

Write current LP, basis, and parameter settings. LP is written in MPS format to "\p filename".mps, basis is written in "\p filename".bas, and parameters are written to "\p filename".set. If rowNames and colNames are NULL, default names are used for the constraints and variables.

Definition at line 31 of file spxwritestate.cpp.

References SPxSolver::basis(), SPxSolver::COLUMN, SPxSolver::epsilon(), SPxSolver::feastol(), SPxBasis::getMaxUpdates(), soplex::infinity, SPxSolver::opttol(), SPxSolver::pricer(), SPxSolver::ratiotester(), SPxSolver::rep(), SOPLEX_SUBVERSION, SOPLEX_VERSION, SPxSolver::writeBasisFile(), and SPxLPBase< Real >::writeMPS().

Referenced by SoPlexLegacy::writeState().

Friends And Related Function Documentation

friend class SoPlexLegacy
friend

Definition at line 86 of file spxsolver.h.

friend class SPxBoundFlippingRT
friend

Definition at line 88 of file spxsolver.h.

friend class SPxFastRT
friend

Definition at line 87 of file spxsolver.h.

Member Data Documentation

UpdateVector addVec
protected

storage for thePvec = &addVec

Definition at line 289 of file spxsolver.h.

Referenced by SPxSolver::clear(), SPxSolver::initRep(), SPxSolver::isConsistent(), SPxSolver::operator=(), and SPxSolver::SPxSolver().

int boundflips
protected
SSVector* coSolveVector2
private

when 2 systems are to be solved at a time; typically for speepest edge weights

Definition at line 247 of file spxsolver.h.

Referenced by SPxSolver::clearUpdateVecs(), SPxSolver::enter(), and SPxSolver::solve().

SSVector* coSolveVector2rhs
private

when 2 systems are to be solved at a time; typically for speepest edge weights

Definition at line 248 of file spxsolver.h.

Referenced by SPxSolver::enter().

SSVector* coSolveVector3
private

when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)

Definition at line 249 of file spxsolver.h.

Referenced by SPxSolver::clearUpdateVecs(), SPxSolver::enter(), and SPxSolver::solve().

SSVector* coSolveVector3rhs
private

when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)

Definition at line 250 of file spxsolver.h.

Referenced by SPxSolver::enter().

int displayFreq
private

Definition at line 271 of file spxsolver.h.

Referenced by SPxSolver::operator=(), and SPxSolver::printDisplayLine().

int displayLine
private

Definition at line 270 of file spxsolver.h.

Referenced by SPxSolver::printDisplayLine().

DSVector dualFarkas
protected

stores dual farkas proof in case of infeasibility

Definition at line 326 of file spxsolver.h.

Referenced by SPxSolver::enter(), SPxSolver::getDualfarkas(), SPxSolver::leave(), and SPxSolver::operator=().

DVector dualRhs
protected

rhs vector for computing the dual vector

Definition at line 287 of file spxsolver.h.

Referenced by SPxSolver::clear(), SPxSolver::initRep(), SPxSolver::isConsistent(), SPxSolver::operator=(), and SPxSolver::SPxSolver().

UpdateVector dualVec
protected
int enterCount
protected

number of ENTER iterations

Definition at line 329 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxBoundFlippingRT::selectLeave(), and SPxSolver::solve().

bool freePricer
private

true iff thepricer should be freed inside of object

Definition at line 252 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::setPricer(), SPxSolver::SPxSolver(), and SPxSolver::~SPxSolver().

bool freeRatioTester
private

true iff theratiotester should be freed inside of object

Definition at line 253 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::setTester(), SPxSolver::SPxSolver(), and SPxSolver::~SPxSolver().

bool freeStarter
private

true iff thestarter should be freed inside of object

Definition at line 254 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::setStarter(), SPxSolver::SPxSolver(), and SPxSolver::~SPxSolver().

bool hyperPricingLeave
bool instableEnter
private
SPxId instableEnterId
private
Real instableEnterVal
private
bool instableLeave
private
int instableLeaveNum
private
Real instableLeaveVal
private
Real lastShift
private

for forcing feasibility.

Definition at line 238 of file spxsolver.h.

Referenced by SPxSolver::init(), SPxSolver::operator=(), and SPxSolver::reinitializeVecs().

int leaveCount
protected

number of LEAVE iterations

Definition at line 328 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxBoundFlippingRT::selectEnter(), and SPxSolver::solve().

Real m_entertol
private

feasibility tolerance maintained during entering algorithm

Definition at line 235 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::setDelta(), SPxSolver::setFeastol(), SPxSolver::setOpttol(), and SPxSolver::solve().

Real m_leavetol
private

feasibility tolerance maintained during leaving algorithm

Definition at line 236 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::setDelta(), SPxSolver::setFeastol(), SPxSolver::setOpttol(), and SPxSolver::solve().

int m_maxCycle
private

maximum steps before cycling is detected.

Definition at line 239 of file spxsolver.h.

Referenced by SPxSolver::enter(), SPxSolver::leave(), and SPxSolver::operator=().

Real m_nonbasicValue
private

nonbasic part of current objective value

Definition at line 232 of file spxsolver.h.

Referenced by SPxSolver::nonbasicValue(), and SPxSolver::updateNonbasicValue().

bool m_nonbasicValueUpToDate
private
int m_numCycle
private

actual number of degenerate steps so far.

Definition at line 240 of file spxsolver.h.

Referenced by SPxSolver::enter(), SPxSolver::init(), SPxSolver::leave(), SPxSolver::operator=(), SPxSolver::setType(), and SPxSolver::solve().

Status m_status
private
int maxIters
private

maximum allowed iterations.

Definition at line 225 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::setTerminationIter(), SPxSolver::solve(), and SPxSolver::terminationIter().

long nCallsToTimelim
private

Definition at line 228 of file spxsolver.h.

Referenced by SPxSolver::isTimeLimitReached(), and SPxSolver::resetClockStats().

int nClckSkipsLeft
private

remaining number of times the clock can be safely skipped

Definition at line 227 of file spxsolver.h.

Referenced by SPxSolver::isTimeLimitReached(), and SPxSolver::resetClockStats().

Real objLimit
private

< the number of calls to the method isTimeLimitReached()

objective value limit.

Definition at line 229 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::setTerminationValue(), SPxSolver::terminate(), and SPxSolver::terminationValue().

int primalCount
protected

number of primal iterations

Definition at line 330 of file spxsolver.h.

Referenced by SPxSolver::solve().

DSVector primalRay
protected

stores primal ray in case of unboundedness

Definition at line 325 of file spxsolver.h.

Referenced by SPxSolver::enter(), SPxSolver::getPrimalray(), SPxSolver::leave(), and SPxSolver::operator=().

DVector primRhs
protected

rhs vector for computing the primal vector

Definition at line 285 of file spxsolver.h.

Referenced by SPxSolver::clear(), SPxSolver::initRep(), SPxSolver::isConsistent(), SPxSolver::operator=(), and SPxSolver::SPxSolver().

int remainingRoundsEnter
int remainingRoundsEnterCo
int remainingRoundsLeave

number of dense rounds/refactorizations until sparsePricing is enabled again

Definition at line 375 of file spxsolver.h.

Referenced by SPxSolver::computeFtest(), SPxSolver::operator=(), and SPxSolver::updateFtest().

SSVector* solveVector2
private

when 2 systems are to be solved at a time; typically for speepest edge weights

Definition at line 243 of file spxsolver.h.

Referenced by SPxSolver::clearUpdateVecs(), SPxSolver::leave(), and SPxSolver::solve().

SSVector* solveVector2rhs
private

when 2 systems are to be solved at a time; typically for speepest edge weights

Definition at line 244 of file spxsolver.h.

Referenced by SPxSolver::leave().

SSVector* solveVector3
private

when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)

Definition at line 245 of file spxsolver.h.

Referenced by SPxSolver::clearUpdateVecs(), SPxSolver::leave(), SPxSolver::solve(), and SPxSolver::updateFtest().

SSVector* solveVector3rhs
private

when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)

Definition at line 246 of file spxsolver.h.

Referenced by SPxSolver::leave().

bool sparsePricingEnter
bool sparsePricingEnterCo
Real sparsePricingFactor
private

enable sparse pricing when viols < factor * dim()

Definition at line 272 of file spxsolver.h.

Referenced by SPxSolver::computeCoTest(), SPxSolver::computeFtest(), SPxSolver::computeTest(), and SPxSolver::operator=().

bool sparsePricingLeave

These values enable or disable sparse pricing.

true if sparsePricing is turned on in the leaving Simplex

Definition at line 369 of file spxsolver.h.

Referenced by SPxSolver::computeFtest(), SPxDevexPR::init(), SPxSolver::operator=(), SPxDantzigPR::selectLeave(), SPxDevexPR::selectLeave(), SPxSteepPR::selectLeave(), SPxSteepPR::setType(), SPxSolver::solve(), and SPxSolver::updateFtest().

const SVSet* thecovectors
protected

the LP coVectors according to representation

Definition at line 283 of file spxsolver.h.

Referenced by SPxSolver::enter(), SPxSolver::initRep(), SPxSolver::isConsistent(), SPxSolver::operator=(), SPxSolver::setupPupdate(), and SPxSolver::SPxSolver().

UpdateVector* theCPvec
protected

column pricing vector

Definition at line 312 of file spxsolver.h.

Referenced by SPxSolver::initRep(), SPxSolver::isConsistent(), SPxSolver::operator=(), and SPxSolver::SPxSolver().

Real theCumulativeTime
private

cumulative time spent in all calls to method solve()

Definition at line 224 of file spxsolver.h.

Referenced by SPxSolver::operator=(), SPxSolver::resetClockStats(), and SPxSolver::solve().

Pricing thePricing
private

full or partial pricing.

Definition at line 220 of file spxsolver.h.

Referenced by SPxSolver::operator=(), and SPxSolver::setPricing().

Representation theRep
private
UpdateVector* theRPvec
protected

row pricing vector

Definition at line 311 of file spxsolver.h.

Referenced by SPxSolver::initRep(), SPxSolver::isConsistent(), SPxSolver::operator=(), and SPxSolver::SPxSolver().

Timer* theTime
private

time spent in last call to method solve()

Definition at line 222 of file spxsolver.h.

Referenced by SPxSolver::solve(), SPxSolver::SPxSolver(), and SPxSolver::~SPxSolver().

Type theType
private

entering or leaving algortihm.

Definition at line 219 of file spxsolver.h.

Referenced by SPxSolver::operator=(), and SPxSolver::setType().

DVector theUBbound
protected

Upper Basic Feasibility bound.

In entering Simplex algorithm, the ratio test must ensure that all basic variables remain within their feasibility bounds. To give fast acces to them, the bounds of basic variables are copied into the following two vectors.

Definition at line 301 of file spxsolver.h.

Referenced by SPxSolver::computeFtest(), SPxSolver::enter(), SPxBoundFlippingRT::flipAndUpdate(), SPxSolver::getLeaveVals(), SPxSolver::isConsistent(), SPxSolver::leave(), SPxSolver::maxInfeas(), SPxSolver::operator=(), SPxSolver::reDim(), SPxSolver::setEnterBound4Col(), SPxSolver::setEnterBound4Row(), SPxSolver::setLeaveBound4Col(), SPxSolver::setLeaveBound4Row(), SPxSolver::shiftFvec(), SPxSolver::testBounds(), SPxSolver::unShift(), and SPxSolver::updateFtest().

const SVSet* thevectors
protected

the LP vectors according to representation

Definition at line 282 of file spxsolver.h.

Referenced by SPxSolver::initRep(), SPxSolver::isConsistent(), SPxSolver::operator=(), SPxSolver::setupPupdate(), and SPxSolver::SPxSolver().

Timer::TYPE timerType
private

type of timer (user or wallclock)

Definition at line 223 of file spxsolver.h.

Referenced by SPxSolver::operator=(), and SPxSolver::SPxSolver().

int totalboundflips
protected

total number of bound flips

Definition at line 333 of file spxsolver.h.

Referenced by SPxSolver::enter(), SPxSolver::leave(), and SPxSolver::solve().

Array< UnitVector > unitVecs
protected
DIdxSet updateViols

store indices that were changed in the previous iteration and must be checked in hyper pricing

Definition at line 358 of file spxsolver.h.

Referenced by SPxSolver::hyperPricing(), SPxDevexPR::selectEnterHyperDim(), SPxSteepPR::selectEnterHyperDim(), SPxDevexPR::selectLeaveHyper(), SPxSteepPR::selectLeaveHyper(), SPxSolver::solve(), SPxSolver::updateCoTest(), and SPxSolver::updateFtest().