SoPlex Documentation
Loading...
Searching...
No Matches

Sequential object-oriented SimPlex. More...

#include <spxsolver.h>

Inheritance diagram for SPxSolverBase< R >:
SPxLPBase< R > SPxBasisBase< R > LPRowSetBase< R > LPColSetBase< R > SVSetBase< R > SVSetBase< R > ClassArray< Nonzero< R > > ClassArray< Nonzero< R > >

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 = -15 , NO_RATIOTESTER = -14 , NO_PRICER = -13 , NO_SOLVER = -12 ,
  NOT_INIT = -11 , 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 , OPTIMAL_UNSCALED_VIOLATIONS = 5
}
 
enum  SolutionPolish { POLISH_OFF , POLISH_INTEGRALITY , POLISH_FRACTIONALITY }
 objective for solution polishing More...
 
- Public Types inherited from SPxLPBase< R >
enum  SPxSense { MAXIMIZE = 1 , MINIMIZE = -1 }
 Optimization sense. More...
 

Public Member Functions

void setOutstream (SPxOut &newOutstream)
 
virtual void setTolerances (std::shared_ptr< Tolerances > newTolerances)
 set the _tolerances member variable
 
const std::shared_ptr< Tolerances > & tolerances () const
 returns current tolerances
 
void setNonzeroFactor (R f)
 set refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix
 
void setFillFactor (R f)
 set refactor threshold for fill-in in current factor update compared to fill-in in last factorization
 
void setMemFactor (R f)
 set refactor threshold for memory growth in current factor update compared to the last factorization
 
UpdateVector< R > & fVec () const
 feasibility vector.
 
const VectorBase< R > & fRhs () const
 right-hand side vector for fVec
 
const VectorBase< R > & ubBound () const
 upper bound for fVec.
 
VectorBase< R > & ubBound ()
 upper bound for fVec, writable.
 
const VectorBase< R > & lbBound () const
 lower bound for fVec.
 
VectorBase< R > & lbBound ()
 lower bound for fVec, writable.
 
const VectorBase< R > & fTest () const
 Violations of fVec.
 
UpdateVector< R > & coPvec () const
 copricing vector.
 
const VectorBase< R > & coPrhs () const
 Right-hand side vector for coPvec.
 
const VectorBase< R > & ucBound () const
 
VectorBase< R > & ucBound ()
 upper bound for coPvec.
 
const VectorBase< R > & lcBound () const
 
VectorBase< R > & lcBound ()
 lower bound for coPvec.
 
const VectorBase< R > & coTest () const
 violations of coPvec.
 
UpdateVector< R > & pVec () const
 pricing vector.
 
const VectorBase< R > & upBound () const
 
VectorBase< R > & upBound ()
 upper bound for pVec.
 
const VectorBase< R > & lpBound () const
 
VectorBase< R > & lpBound ()
 lower bound for pVec.
 
const VectorBase< R > & test () const
 Violations of pVec.
 
computePvec (int i)
 compute and return pVec()[i].
 
void computePvec ()
 compute entire pVec().
 
computeTest (int i)
 compute and return test()[i] in ENTERing Simplex.
 
void computeTest ()
 compute test VectorBase<R> in ENTERing Simplex.
 
void testVecs ()
 
Access
int version () const
 return the version of SPxSolverBase as number like 123 for 1.2.3
 
int subversion () const
 return the internal subversion of SPxSolverBase as number
 
Representation rep () const
 return the current basis representation.
 
Type type () const
 return current Type.
 
Pricing pricing () const
 return current Pricing.
 
SPxStarter< R > * starter () const
 return current starter.
 
Setup

Before solving an LP with an instance of SPxSolverBase, 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 SPxBasisBase<R>::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=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
 read LP from input stream.
 
virtual void loadLP (const SPxLPBase< R > &LP, bool initSlackBasis=true)
 copy LP.
 
virtual void setBasisSolver (SLinSolver< R > *slu, const bool destroy=false)
 setup linear solver to use. If destroy is true, slusolver will be freed in destructor.
 
virtual void setPricer (SPxPricer< R > *pricer, const bool destroy=false)
 setup pricer to use. If destroy is true, pricer will be freed in destructor.
 
virtual void setTester (SPxRatioTester< R > *tester, const bool destroy=false)
 setup ratio-tester to use. If destroy is true, tester will be freed in destructor.
 
virtual void setStarter (SPxStarter< R > *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 typename SPxBasisBase< R >::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.
 
void unscaleLPandReloadBasis ()
 unscales the LP and reloads the basis
 
void invalidateBasis ()
 invalidates the basis, triggers refactorization
 
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=nullptr, const NameSet *colNames=nullptr, const bool cpxFormat=false, const bool writeZeroObjective=false) const
 
Solving LPs
virtual Status solve (volatile bool *interrupt=nullptr, bool polish=true)
 solve loaded LP.
 
bool performSolutionPolishing ()
 
void setSolutionPolishing (SolutionPolish _polishObj)
 set objective of solution polishing (0: off, 1: max_basic_slack, 2: min_basic_slack)
 
SolutionPolish getSolutionPolishing ()
 return objective of solution polishing
 
bool isTerminationValueEnabled () const
 true if objective limit should be used in the next solve
 
void toggleTerminationValue (bool enable)
 toggle objective limit for next solve
 
Status status () const
 Status of solution process.
 
virtual R value ()
 current objective value.
 
bool updateNonbasicValue (R objChange)
 
void forceRecompNonbasicValue ()
 
virtual void factorizeAndRecompute ()
 
virtual Status getPrimalSol (VectorBase< R > &vector) const
 get solution vector for primal variables.
 
virtual Status getSlacks (VectorBase< R > &vector) const
 get VectorBase<R> of slack variables.
 
virtual Status getDualSol (VectorBase< R > &vector) const
 get current solution VectorBase<R> for dual variables.
 
virtual Status getRedCostSol (VectorBase< R > &vector) const
 get vector of reduced costs.
 
virtual Status getPrimalray (VectorBase< R > &vector) const
 get primal ray in case of unboundedness.
 
virtual Status getDualfarkas (VectorBase< R > &vector) const
 get dual farkas proof of infeasibility.
 
virtual void printDisplayLine (const bool force=false, const bool forceHead=false)
 print display line of flying table
 
virtual bool terminate ()
 Termination criterion.
 
Control Parameters
epsilon () const
 values \(|x| < \epsilon\) are considered to be 0.
 
entertol () const
 feasibility tolerance maintained by ratio test during ENTER algorithm.
 
leavetol () const
 feasibility tolerance maintained by ratio test during LEAVE algorithm.
 
void scaleEntertol (R d)
 scale the entering tolerance
 
void scaleLeavetol (R d)
 scale the leaving tolerance
 
void scaleTolerances (R d)
 
delta () const
 guaranteed primal and dual bound violation for optimal solution, returning the maximum of floatingPointFeastol() and floatingPointOpttol().
 
void setTiming (Timer::TYPE ttype)
 set timing type
 
Timer::TYPE getTiming ()
 set timing type
 
void setDisplayFreq (int freq)
 set display frequency
 
int getDisplayFreq ()
 get display frequency
 
void setMetricInformation (int type)
 print basis metric within the usual output
 
void setSparsePricingFactor (R fac)
 
void hyperPricing (bool h)
 enable or disable hyper sparse pricing
 
DataArray< VarStatus > & getOldBasisStatusRows ()
 
DataArray< VarStatus > & getOldBasisStatusCols ()
 
void setSolvingForBoosted (bool value)
 
void setStoreBasisFreqForBoosting (int freq)
 
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.
 
void useFullPerturbation (bool full)
 perturb entire problem or only the bounds relevant to the current pivot
 
virtual R getBasisMetric (int type)
 
Modification
virtual void changeObj (const VectorBase< R > &newObj, bool scale=false)
 scale determines whether the new data needs to be scaled according to the existing LP (persistent scaling)
 
virtual void changeObj (int i, const R &newVal, bool scale=false)
 
virtual void changeObj (SPxColId p_id, const R &p_newVal, bool scale=false)
 overloading a virtual function
 
virtual void changeMaxObj (const VectorBase< R > &newObj, bool scale=false)
 
virtual void changeMaxObj (int i, const R &newVal, bool scale=false)
 
virtual void changeMaxObj (SPxColId p_id, const R &p_newVal, bool scale=false)
 overloading a virtual function
 
virtual void changeRowObj (const VectorBase< R > &newObj, bool scale=false)
 
virtual void changeRowObj (int i, const R &newVal, bool scale=false)
 
virtual void changeRowObj (SPxRowId p_id, const R &p_newVal, bool scale=false)
 
virtual void clearRowObjs ()
 
virtual void changeLowerStatus (int i, R newLower, R oldLower=0.0)
 
virtual void changeLower (const VectorBase< R > &newLower, bool scale=false)
 
virtual void changeLower (int i, const R &newLower, bool scale=false)
 
virtual void changeLower (SPxColId p_id, const R &p_newLower, bool scale=false)
 
virtual void changeUpperStatus (int i, R newUpper, R oldLower=0.0)
 
virtual void changeUpper (const VectorBase< R > &newUpper, bool scale=false)
 
virtual void changeUpper (int i, const R &newUpper, bool scale=false)
 
virtual void changeUpper (SPxColId p_id, const R &p_newUpper, bool scale=false)
 overloading virtual function
 
virtual void changeBounds (const VectorBase< R > &newLower, const VectorBase< R > &newUpper, bool scale=false)
 
virtual void changeBounds (int i, const R &newLower, const R &newUpper, bool scale=false)
 
virtual void changeBounds (SPxColId p_id, const R &p_newLower, const R &p_newUpper, bool scale=false)
 
virtual void changeLhsStatus (int i, R newLhs, R oldLhs=0.0)
 
virtual void changeLhs (const VectorBase< R > &newLhs, bool scale=false)
 
virtual void changeLhs (int i, const R &newLhs, bool scale=false)
 
virtual void changeLhs (SPxRowId p_id, const R &p_newLhs, bool scale=false)
 
virtual void changeRhsStatus (int i, R newRhs, R oldRhs=0.0)
 
virtual void changeRhs (const VectorBase< R > &newRhs, bool scale=false)
 
virtual void changeRhs (int i, const R &newRhs, bool scale=false)
 
virtual void changeRhs (SPxRowId p_id, const R &p_newRhs, bool scale=false)
 
virtual void changeRange (const VectorBase< R > &newLhs, const VectorBase< R > &newRhs, bool scale=false)
 
virtual void changeRange (int i, const R &newLhs, const R &newRhs, bool scale=false)
 
virtual void changeRange (SPxRowId p_id, const R &p_newLhs, const R &p_newRhs, bool scale=false)
 
virtual void changeRow (int i, const LPRowBase< R > &newRow, bool scale=false)
 
virtual void changeRow (SPxRowId p_id, const LPRowBase< R > &p_newRow, bool scale=false)
 
virtual void changeCol (int i, const LPColBase< R > &newCol, bool scale=false)
 
virtual void changeCol (SPxColId p_id, const LPColBase< R > &p_newCol, bool scale=false)
 
virtual void changeElement (int i, int j, const R &val, bool scale=false)
 
virtual void changeElement (SPxRowId rid, SPxColId cid, const R &val, bool scale=false)
 
virtual void changeSense (typename SPxLPBase< R >::SPxSense sns)
 
Dimension and codimension
int dim () const
 dimension of basis matrix.
 
int coDim () const
 codimension.
 
Variables and Covariables

Class SPxLPBase<R> introduces SPxIds to identify row or column data of an LP. SPxSolverBase 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 SVectorBase< R > & vector (int i) const
 i 'th vector.
 
const SVectorBase< R > & vector (const SPxRowId &rid) const
 
const SVectorBase< R > & vector (const SPxColId &cid) const
 
const SVectorBase< R > & vector (const SPxId &p_id) const
 VectorBase<R> associated to p_id.
 
const SVectorBase< R > & coVector (int i) const
 i 'th covector of LP.
 
const SVectorBase< R > & coVector (const SPxRowId &rid) const
 
const SVectorBase< R > & coVector (const SPxColId &cid) const
 
const SVectorBase< R > & coVector (const SPxId &p_id) const
 coVector associated to p_id.
 
const SVectorBase< R > & unitVector (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.

SPxBasisBase< R >::Desc::Status varStatus (int i) const
 Status of i 'th variable.
 
SPxBasisBase< R >::Desc::Status covarStatus (int i) const
 Status of i 'th covariable.
 
bool isBasic (typename SPxBasisBase< R >::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, R to)
 shift i 'th ubBound to to.
 
void shiftLBbound (int i, R to)
 shift i 'th lbBound to to.
 
void shiftUPbound (int i, R to)
 shift i 'th upBound to to.
 
void shiftLPbound (int i, R to)
 shift i 'th lpBound to to.
 
void shiftUCbound (int i, R to)
 shift i 'th ucBound to to.
 
void shiftLCbound (int i, R to)
 shift i 'th lcBound to to.
 
void testBounds () const
 
virtual R shift () const
 total current shift amount.
 
virtual void unShift (void)
 remove shift as much as possible.
 
virtual void qualConstraintViolation (R &maxviol, R &sumviol) const
 get violation of constraints.
 
virtual void qualBoundViolation (R &maxviol, R &sumviol) const
 get violations of bounds.
 
virtual void qualSlackViolation (R &maxviol, R &sumviol) const
 get the residuum |Ax-b|.
 
virtual void qualRedCostViolation (R &maxviol, R &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.
 
 SPxSolverBase (Type type=LEAVE, Representation rep=ROW, Timer::TYPE ttype=Timer::USER_TIME)
 default constructor.
 
virtual ~SPxSolverBase ()
 
bool isConsistent () const
 check consistency.
 
SPxSolverBase< R > & operator= (const SPxSolverBase< R > &base)
 assignment operator
 
 SPxSolverBase (const SPxSolverBase< R > &base)
 copy constructor
 
- Public Member Functions inherited from SPxLPBase< R >
void setOutstream (SPxOut &newOutstream)
 
void unscaleLP ()
 unscales the lp and clears basis
 
const std::shared_ptr< Tolerancestolerances () const
 returns current tolerances
 
bool isScaled () const
 Returns true if and only if the LP is scaled.
 
void setScalingInfo (bool scaled)
 set whether the LP is scaled or not
 
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.
 
virtual R minAbsNzo (bool unscaled=true) const
 Absolute smallest non-zero element in (possibly scaled) LP.
 
virtual R maxAbsNzo (bool unscaled=true) const
 Absolute biggest non-zero element in (in rational case possibly scaled) LP.
 
void getRow (int i, LPRowBase< R > &row) const
 Gets i 'th row.
 
void getRow (const SPxRowId &id, LPRowBase< R > &row) const
 Gets row with identifier id.
 
void getRows (int start, int end, LPRowSetBase< R > &set) const
 Gets rows start, ... end.
 
const SVectorBase< R > & rowVector (int i) const
 Gets row vector of row i.
 
const SVectorBase< R > & rowVector (const SPxRowId &id) const
 Gets row vector of row with identifier id.
 
void getRowVectorUnscaled (int i, DSVectorBase< R > &vec) const
 Gets unscaled row vector of row i.
 
const VectorBase< R > & rhs () const
 Returns right hand side vector.
 
const R & rhs (int i) const
 Returns right hand side of row number i.
 
const R & rhs (const SPxRowId &id) const
 Returns right hand side of row with identifier id.
 
void getRhs (VectorBase< R > &vec) const
 Gets (internal and possibly scaled) right hand side vector.
 
void getRhsUnscaled (VectorBase< R > &vec) const
 Gets unscaled right hand side vector.
 
rhsUnscaled (int i) const
 Returns unscaled right hand side of row number i.
 
rhsUnscaled (const SPxRowId &id) const
 Returns unscaled right hand side of row with identifier id.
 
const VectorBase< R > & lhs () const
 Returns left hand side vector.
 
const R & lhs (int i) const
 Returns left hand side of row number i.
 
const R & lhs (const SPxRowId &id) const
 Returns left hand side of row with identifier id.
 
void getRowObj (VectorBase< R > &prowobj) const
 Gets row objective function vector.
 
rowObj (int i) const
 
rowObj (const SPxRowId &id) const
 Returns row objective function value of row with identifier id.
 
const VectorBase< R > & maxRowObj () const
 
const R & maxRowObj (int i) const
 
const R & maxRowObj (const SPxRowId &id) const
 Returns row objective function value of row with identifier id.
 
void getLhsUnscaled (VectorBase< R > &vec) const
 Returns unscaled left hand side vector.
 
lhsUnscaled (int i) const
 Returns unscaled left hand side of row number i.
 
lhsUnscaled (const SPxRowId &id) const
 Returns left hand side of row with identifier id.
 
LPRowBase< R >::Type rowType (int i) const
 Returns the inequality type of the i'th LPRow.
 
LPRowBase< R >::Type rowType (const SPxRowId &id) const
 Returns the inequality type of the row with identifier key.
 
void getCol (int i, LPColBase< R > &col) const
 Gets i 'th column.
 
void getCol (const SPxColId &id, LPColBase< R > &col) const
 Gets column with identifier id.
 
void getCols (int start, int end, LPColSetBase< R > &set) const
 Gets columns start, ..., end.
 
const SVectorBase< R > & colVector (int i) const
 Returns column vector of column i.
 
const SVectorBase< R > & colVector (const SPxColId &id) const
 Returns column vector of column with identifier id.
 
void getColVectorUnscaled (int i, DSVectorBase< R > &vec) const
 Gets column vector of column i.
 
void getColVectorUnscaled (const SPxColId &id, DSVectorBase< R > &vec) const
 Gets column vector of column with identifier id.
 
void getObjUnscaled (VectorBase< R > &pobj) const
 Gets unscaled objective vector.
 
void getObj (VectorBase< R > &pobj) const
 Gets objective vector.
 
obj (int i) const
 Returns objective value of column i.
 
obj (const SPxColId &id) const
 Returns objective value of column with identifier id.
 
objUnscaled (int i) const
 Returns unscaled objective value of column i.
 
objUnscaled (const SPxColId &id) const
 Returns unscaled objective value of column with identifier id.
 
const VectorBase< R > & maxObj () const
 Returns objective vector for maximization problem.
 
const R & maxObj (int i) const
 Returns objective value of column i for maximization problem.
 
const R & maxObj (const SPxColId &id) const
 Returns objective value of column with identifier id for maximization problem.
 
void maxObjUnscaled (VectorBase< R > &vec) const
 Returns unscaled objective vector for maximization problem.
 
maxObjUnscaled (int i) const
 Returns unscaled objective value of column i for maximization problem.
 
maxObjUnscaled (const SPxColId &id) const
 Returns unscaled objective value of column with identifier id for maximization problem.
 
const VectorBase< R > & upper () const
 Returns upper bound vector.
 
const R & upper (int i) const
 Returns upper bound of column i.
 
const R & upper (const SPxColId &id) const
 Returns upper bound of column with identifier id.
 
void getUpperUnscaled (VectorBase< R > &vec) const
 Gets unscaled upper bound vector.
 
upperUnscaled (int i) const
 Returns unscaled upper bound of column i.
 
upperUnscaled (const SPxColId &id) const
 Returns unscaled upper bound of column with identifier id.
 
const VectorBase< R > & lower () const
 Returns (internal and possibly scaled) lower bound vector.
 
const R & lower (int i) const
 Returns (internal and possibly scaled) lower bound of column i.
 
const R & lower (const SPxColId &id) const
 Returns (internal and possibly scaled) lower bound of column with identifier id.
 
void getLowerUnscaled (VectorBase< R > &vec) const
 Gets unscaled lower bound vector.
 
lowerUnscaled (int i) const
 Returns unscaled lower bound of column i.
 
lowerUnscaled (const SPxColId &id) const
 Returns unscaled lower bound of column with identifier id.
 
SPxSense spxSense () const
 Returns the optimization sense.
 
const R & objOffset () 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.
 
bool has (const SPxRowId &id) const
 Returns the row number of the row with identifier id.
 
bool has (const SPxColId &id) const
 Returns the column number of the column with identifier id.
 
bool has (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< R > &row, bool scale=false)
 
virtual void addRow (const R &lhsValue, const SVectorBase< R > &rowVec, const R &rhsValue, bool scale=false)
 
template<class S >
void addRow (const S *lhsValue, const S *rowValues, const int *rowIndices, int rowSize, const S *rhsValue)
 
virtual void addRow (SPxRowId &id, const LPRowBase< R > &row, bool scale=false)
 Adds row to LPRowSetBase.
 
virtual void addRows (const LPRowSetBase< R > &pset, bool scale=false)
 
template<class S >
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< R > &set, bool scale=false)
 adds all LPRowBases of pset to LPRowSetBase.
 
virtual void addCol (const LPColBase< R > &col, bool scale=false)
 
virtual void addCol (const R &objValue, const R &lowerValue, const SVectorBase< R > &colVec, const R &upperValue, bool scale=false)
 
template<class S >
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< R > &col, bool scale=false)
 Adds col to LPColSetVBase.
 
virtual void addCols (const LPColSetBase< R > &pset, bool scale=false)
 
template<class S >
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< R > &set, bool scale=false)
 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[]=nullptr)
 
virtual void removeRows (int nums[], int n, int perm[]=nullptr)
 Removes n LPRowBases.
 
virtual void removeRowRange (int start, int end, int perm[]=nullptr)
 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[]=nullptr)
 
virtual void removeCols (int nums[], int n, int perm[]=nullptr)
 Removes n LPCols.
 
virtual void removeColRange (int start, int end, int perm[]=nullptr)
 Removes columns from start to end (including both).
 
virtual bool readLPF (std::istream &in, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
 Reads LP in LP format from input stream in.
 
virtual bool readMPS (std::istream &in, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
 Reads an LP in MPS format from input stream in.
 
virtual bool readFile (const char *filename, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
 Reads LP from a file.
 
virtual void writeLPF (std::ostream &out, const NameSet *rowNames, const NameSet *colNames, const DIdxSet *p_intvars=nullptr, const bool writeZeroObjective=false) const
 
virtual void writeMPS (std::ostream &out, const NameSet *rowNames, const NameSet *colNames, const DIdxSet *p_intvars=nullptr, const bool writeZeroObjective=false) const
 Writes a file in MPS format to out.
 
virtual void writeFileLPBase (const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *p_intvars=nullptr, const bool writeZeroObjective=false) const
 Write loaded LP to filename.
 
void printProblemStatistics (std::ostream &os)
 
template<class S >
void changeObj (int i, const S *newVal)
 changes i 'th objective vector element to newVal.
 
template<class S >
void changeMaxObj (int i, const S *newVal)
 changes i 'th objective vector element to newVal.
 
template<class S >
void changeLower (int i, const S *newLower)
 changes i 'th lower bound to newLower.
 
template<class S >
void changeUpper (int i, const S *newUpper)
 Changes i 'th upper bound to newUpper.
 
template<class S >
void changeBounds (int i, const S *newLower, const S *newUpper)
 Changes bounds of column i to newLower and newUpper.
 
template<class S >
void changeLhs (int i, const S *newLhs)
 Changes i 'th left hand side value to newLhs.
 
template<class S >
void changeRange (int i, const S *newLhs, const S *newRhs)
 Changes left and right hand side of row i.
 
template<class S >
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.
 
template<typename T >
void changeObjOffset (const T &o)
 
virtual void computePrimalActivity (const VectorBase< R > &primal, VectorBase< R > &activity, const bool unscaled=true) const
 Computes activity of the rows for a given primal vector; activity does not need to be zero.
 
virtual void addPrimalActivity (const SVectorBase< R > &primal, VectorBase< R > &activity) const
 Updates activity of the rows for a given primal vector; activity does not need to be zero.
 
virtual void computeDualActivity (const VectorBase< R > &dual, VectorBase< R > &activity, const bool unscaled=true) 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< R > &dual, VectorBase< R > &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< R > &dual, VectorBase< R > &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 buildDualProblem (SPxLPBase< R > &dualLP, SPxRowId primalRowIds[]=nullptr, SPxColId primalColIds[]=nullptr, SPxRowId dualRowIds[]=nullptr, SPxColId dualColIds[]=nullptr, int *nprimalrows=nullptr, int *nprimalcols=nullptr, int *ndualrows=nullptr, int *ndualcols=nullptr)
 Building the dual problem from a given LP.
 
bool isConsistent () const
 Consistency check.
 
 SPxLPBase ()
 Default constructor.
 
virtual ~SPxLPBase ()
 Destructor.
 
 SPxLPBase (const SPxLPBase< R > &old)
 Copy constructor.
 
template<class S >
 SPxLPBase (const SPxLPBase< S > &old)
 Copy constructor.
 
SPxLPBase< R > & operator= (const SPxLPBase< R > &old)
 Assignment operator.
 
template<class S >
SPxLPBase< R > & operator= (const SPxLPBase< S > &old)
 Assignment operator.
 

Public Attributes

Random random
 The random number generator used throughout the whole computation. Its seed can be modified.
 
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
 
VectorBase< R > weights
 dual pricing norms
 
VectorBase< R > coWeights
 store dual norms
 
bool weightsAreSetup
 are the dual norms already set up?
 
TimermultTimeSparse
 time spent in setupPupdate() exploiting sparsity
 
TimermultTimeFull
 time spent in setupPupdate() ignoring sparsity
 
TimermultTimeColwise
 time spent in setupPupdate(), columnwise multiplication
 
TimermultTimeUnsetup
 time spent in setupPupdate() w/o sparsity information
 
int multSparseCalls
 number of products exploiting sparsity
 
int multFullCalls
 number of products ignoring sparsity
 
int multColwiseCalls
 number of products, columnwise multiplication
 
int multUnsetupCalls
 number of products w/o sparsity information
 
SPxOutspxout
 message handler
 
DataArray< int > integerVariables
 supplementary variable information, 0: continous variable, 1: integer variable
 
- Public Attributes inherited from SPxLPBase< R >
SPxOutspxout
 

Protected Member Functions

Precision
virtual bool precisionReached (R &newpricertol) const
 is the solution precise enough, or should we increase delta() ?
 
void calculateProblemRanges ()
 determine ranges of problem values for bounds, sides and objective to assess numerical difficulties
 
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 (typename SPxBasisBase< R >::Desc::Status, R &, R &) 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 ()
 
void computePrimalray4Col (R direction, SPxId enterId)
 
void computePrimalray4Row (R direction)
 
void computeDualfarkas4Col (R direction)
 
void computeDualfarkas4Row (R direction, SPxId enterId)
 
- Protected Member Functions inherited from SPxLPBase< R >
R & rhs_w (int i)
 Returns right hand side of row i.
 
R & lhs_w (int i)
 Returns left hand side of row i.
 
R & maxRowObj_w (int i)
 Returns objective function value of row i.
 
R & maxObj_w (int i)
 Returns objective value of column i for maximization problem.
 
R & upper_w (int i)
 Returns upper bound of column i.
 
R & lower_w (int i)
 Returns lower bound of column i.
 
const LPRowSetBase< R > * lprowset () const
 Returns the LP as an LPRowSetBase.
 
const LPColSetBase< R > * lpcolset () const
 Returns the LP as an LPColSetBase.
 
void added2Set (SVSetBase< R > &set, const SVSetBase< R > &addset, int n)
 
- Protected Member Functions inherited from LPRowSetBase< R >
const SVSetBase< R > * rowSet () const
 Returns the complete SVSet.
 
int num () const
 Returns the number of LPRowBases in LPRowSetBase.
 
int max () const
 Returns the maximum number of LPRowBases that fit.
 
const VectorBase< R > & lhs () const
 Returns the vector of lhs values.
 
VectorBase< R > & lhs_w ()
 Returns the vector of lhs values.
 
const R & lhs (int i) const
 Returns the lhs of the i 'th LPRowBase.
 
R & lhs_w (int i)
 Returns the lhs of the i 'th LPRowBase.
 
const R & lhs (const DataKey &k) const
 Returns the lhs of the LPRowBase with DataKey k in LPRowSetBase.
 
R & lhs_w (const DataKey &k)
 Returns the lhs of the LPRowBase with DataKey k in LPRowSetBase.
 
const VectorBase< R > & rhs () const
 Returns the vector of rhs values.
 
VectorBase< R > & rhs_w ()
 Returns the vector of rhs values (writeable).
 
const R & rhs (int i) const
 Returns the rhs of the i 'th LPRowBase.
 
R & rhs_w (int i)
 Returns the rhs of the i 'th LPRowBase (writeable).
 
const R & rhs (const DataKey &k) const
 Returns the rhs of the LPRowBase with DataKey k in LPRowSetBase.
 
R & rhs_w (const DataKey &k)
 Returns the rhs of the LPRowBase with DataKey k in LPRowSetBase (writeable).
 
const VectorBase< R > & obj () const
 Returns the vector of objective coefficients.
 
VectorBase< R > & obj_w ()
 Returns the vector of objective coefficients (writeable).
 
const R & obj (int i) const
 Returns the objective coefficient of the i 'th LPRowBase.
 
R & obj_w (int i)
 Returns the objective coefficient of the i 'th LPRowBase (writeable).
 
const R & obj (const DataKey &k) const
 Returns the objective coefficient of the LPRowBase with DataKey k in LPRowSetBase.
 
R & obj_w (const DataKey &k)
 Returns the objective coefficient of the LPRowBase with DataKey k in LPRowSetBase (writeable).
 
SVectorBase< R > & rowVector_w (int i)
 Returns a writable rowVector of the i 'th LPRowBase.
 
const SVectorBase< R > & rowVector (int i) const
 Returns the rowVector of the i 'th LPRowBase.
 
SVectorBase< R > & rowVector_w (const DataKey &k)
 Returns a writable rowVector of the LPRowBase with DataKey k.
 
const SVectorBase< R > & rowVector (const DataKey &k) const
 Returns the rowVector of the LPRowBase with DataKey k.
 
LPRowBase< R >::Type type (int i) const
 Returns the inequalitiy type of the i 'th LPRowBase.
 
LPRowBase< R >::Type type (const DataKey &k) const
 Returns the inequality type of the LPRowBase with DataKey k.
 
void setType (int i, typename LPRowBase< R >::Type t)
 Changes the inequality type of row i to type.
 
const R & value (int i) const
 Returns the value of the i'th LPRowBase.
 
const R & value (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< R > &row)
 
void add (DataKey &pkey, const LPRowBase< R > &prow)
 Adds row to LPRowSetBase.
 
void add (const R &plhs, const SVectorBase< R > &prowVector, const R &prhs, const R &pobj=0, const int &pscaleExp=0)
 Adds LPRowBase consisting of left hand side lhs, row vector rowVector, and right hand side rhs to LPRowSetBase.
 
template<class S >
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.
 
template<class S >
void add (DataKey &newkey, const S *lhsValue, const S *rowValues, const int *rowIndices, int rowSize, const S *rhsValue, const S *objValue=nullptr)
 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 R &newlhs, const SVectorBase< R > &newrowVector, const R &newrhs, const R &newobj=0, const int &newscaleExp=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< R > &newset)
 
void add (DataKey keys[], const LPRowSetBase< R > &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 R val[])
 Adds n nonzero (idx, val)-pairs to rowVector with DataKey k.
 
void add2 (int i, int n, const int idx[], const R val[])
 Adds n nonzero (idx, val)-pairs to i 'th rowVector.
 
template<class S >
void add2 (int i, int n, const int idx[], const S val[])
 Adds n nonzero (idx, val)-pairs to i 'th rowVector.
 
SVectorBase< R > & create (int pnonzeros=0, const R &plhs=0, const R &prhs=1, const R &pobj=0, const int &pscaleExp=0)
 Creates new LPRowBase with specified parameters and returns a reference to its row vector.
 
SVectorBase< R > & create (DataKey &newkey, int nonzeros=0, const R &newlhs=0, const R &newrhs=1, const R &newobj=0, const int &newscaleExp=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.
 
 LPRowSetBase (int pmax=-1, int pmemmax=-1)
 Default constructor.
 
LPRowSetBase< R > & operator= (const LPRowSetBase< R > &rs)
 Assignment operator.
 
template<class S >
LPRowSetBase< R > & operator= (const LPRowSetBase< S > &rs)
 Assignment operator.
 
 LPRowSetBase (const LPRowSetBase< R > &rs)
 Copy constructor.
 
template<class S >
 LPRowSetBase (const LPRowSetBase< S > &rs)
 Copy constructor.
 
virtual ~LPRowSetBase ()
 Destructor.
 
- Protected Member Functions inherited from SVSetBase< R >
void add (const SVectorBase< R > &svec)
 Adds svec to the set.
 
void add (DataKey &nkey, const SVectorBase< R > &svec)
 Adds svec to SVSetBase.
 
template<class S >
void add (DataKey &nkey, const S *rowValues, const int *rowIndices, int rowSize)
 Adds svec to SVSetBase.
 
void add (const SVectorBase< R > svec[], int n)
 Adds all n SVectorBases in the array svec to the set.
 
void add (DataKey nkey[], const SVectorBase< R > svec[], int n)
 Adds n SVectorBases to SVSetBase.
 
template<class S >
void add (const SVSetBase< S > &pset)
 Adds all SVectorBases in pset to SVSetBase.
 
template<class S >
void add (DataKey nkey[], const SVSetBase< S > &pset)
 Adds all SVectorBases of pset to SVSetBase.
 
SVectorBase< R > * create (int idxmax=0)
 Creates new SVectorBase in set.
 
SVectorBase< R > * create (DataKey &nkey, int idxmax=-1)
 Creates new SVectorBase in set.
 
void xtend (SVectorBase< R > &svec, int newmax)
 Extends svec to fit newmax nonzeros.
 
void add2 (SVectorBase< R > &svec, int idx, R val)
 Adds nonzero (idx, val) to svec of this SVSetBase.
 
void add2 (SVectorBase< R > &svec, int n, const int idx[], const R val[])
 Adds n nonzeros to svec of this SVSetBase.
 
template<class S >
void add2 (SVectorBase< R > &svec, int n, const int idx[], const S val[])
 Adds n nonzeros to svec of this SVSetBase.
 
void remove (const DataKey &removekey)
 Removes the vector with key removekey from the set.
 
void remove (int removenum)
 Removes the vector with number removenum from the set.
 
void remove (const SVectorBase< R > *svec)
 Removes one SVectorBase from set.
 
void remove (int perm[])
 Removes multiple elements.
 
void remove (const DataKey keys[], int n)
 Removes n SVectorBases from set.
 
void remove (const int nums[], int n)
 Removes n SVectorBases from set.
 
void remove (const DataKey keys[], int n, int *perm)
 
void remove (const int nums[], int n, int *perm)
 
void clear (int minNewSize=-1)
 Removes all SVectorBases from set.
 
SVectorBase< R > & operator[] (int n)
 Gets SVectorBase by number, writeable.
 
const SVectorBase< R > & operator[] (int n) const
 Gets SVectorBase by number.
 
SVectorBase< R > & operator[] (const DataKey &k)
 Gets SVectorBase by DataKey, writeable.
 
const SVectorBase< R > & operator[] (const DataKey &k) const
 Gets SVectorBase by DataKey.
 
int num () const
 Current number of SVectorBases.
 
int max () const
 Current maximum number of SVectorBases.
 
DataKey key (int n) const
 Gets DataKey of vector number.
 
DataKey key (const SVectorBase< R > *svec) const
 Gets DataKey of SVectorBase.
 
int number (const DataKey &k) const
 Gets vector number of DataKey.
 
int number (const SVectorBase< R > *svec) const
 Gets vector number of SVectorBase.
 
bool has (const DataKey &k) const
 True iff SVSetBase contains a SVectorBase for DataKey k.
 
bool has (int n) const
 True iff SVSetBase contains a SVectorBase for vector number n.
 
bool has (const SVectorBase< R > *svec) const
 Is an SVectorBase in the set?
 
int memSize () const
 Used nonzero memory.
 
int memMax () const
 Length of nonzero memory.
 
void memRemax (int newmax)
 Reset length of nonzero memory.
 
void memPack ()
 Garbage collection in nonzero memory.
 
void reMax (int newmax=0)
 Resets maximum number of SVectorBases.
 
bool isConsistent () const
 Consistency check.
 
 SVSetBase (int pmax=-1, int pmemmax=-1, double pfac=1.1, double pmemFac=1.2)
 Default constructor.
 
virtual ~SVSetBase ()
 Destructor.
 
SVSetBase< R > & operator= (const SVSetBase< R > &rhs)
 Assignment operator.
 
template<class S >
SVSetBase< R > & operator= (const SVSetBase< S > &rhs)
 Assignment operator.
 
 SVSetBase (const SVSetBase< R > &old)
 Copy constructor.
 
template<class S >
 SVSetBase (const SVSetBase< S > &old)
 Copy constructor.
 
- Protected Member Functions inherited from ClassArray< Nonzero< R > >
Nonzero< R > & operator[] (int n)
 Reference to n 'th element.
 
const Nonzero< R > & operator[] (int n) const
 Reference to n 'th const element.
 
Nonzero< R > & last ()
 Reference to last element.
 
const Nonzero< R > & last () const
 Reference to last const element.
 
Nonzero< R > * get_ptr ()
 Gets a C pointer to the data.
 
const Nonzero< R > * get_const_ptr () const
 Gets a const C pointer to the data.
 
void append (const Nonzero< R > &t)
 Appends element t.
 
void append (int n, const Nonzero< R > t[])
 Appends n elements from t.
 
void append (const ClassArray< Nonzero< R > > &t)
 Appends all elements from t.
 
void insert (int i, int n)
 Inserts n uninitialized elements before i 'th element.
 
void insert (int i, int n, const Nonzero< R > t[])
 Inserts n elements from t before i 'the element.
 
void insert (int i, const ClassArray< Nonzero< R > > &t)
 Inserts all elements from t before i 'th element.
 
void remove (int n=0, int m=1)
 Removes m elements starting at n.
 
void removeLast (int m=1)
 Removes m last elements.
 
void clear ()
 Removes all elements.
 
int size () const
 Returns number of elements.
 
void reSize (int newsize)
 Resets size to newsize.
 
int max () const
 Returns maximum number of elements.
 
ptrdiff_t reMax (int newMax=1, int newSize=-1)
 Resets maximum number of elements.
 
ClassArrayoperator= (const ClassArray &rhs)
 Assignment operator.
 
bool isConsistent () const
 Consistency check.
 
 ClassArray (const ClassArray &old)
 Copy constructor.
 
 ClassArray (int p_size=0, int p_max=0, double p_fac=1.2)
 Default constructor.
 
virtual ~ClassArray ()
 Destructor.
 
- Protected Member Functions inherited from LPColSetBase< R >
const SVSetBase< R > * colSet () const
 Returns the complete SVSetBase.
 
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< R > & maxObj () const
 
VectorBase< R > & maxObj_w ()
 Returns vector of objective values w.r.t. maximization.
 
const R & maxObj (int i) const
 
R & maxObj_w (int i)
 Returns objective value (w.r.t. maximization) of i 'th LPColBase in LPColSetBase.
 
const R & maxObj (const DataKey &k) const
 
R & maxObj_w (const DataKey &k)
 Returns objective value (w.r.t. maximization) of LPColBase with DataKey k in LPColSetBase.
 
const VectorBase< R > & lower () const
 
VectorBase< R > & lower_w ()
 Returns vector of lower bound values.
 
const R & lower (int i) const
 
R & lower_w (int i)
 Returns lower bound of i 'th LPColBase in LPColSetBase.
 
const R & lower (const DataKey &k) const
 
R & lower_w (const DataKey &k)
 Returns lower bound of LPColBase with DataKey k in LPColSetBase.
 
const VectorBase< R > & upper () const
 
VectorBase< R > & upper_w ()
 Returns vector of upper bound values.
 
const R & upper (int i) const
 
R & upper_w (int i)
 Returns upper bound of i 'th LPColBase in LPColSetBase.
 
const R & upper (const DataKey &k) const
 
R & upper_w (const DataKey &k)
 Returns upper bound of LPColBase with DataKey k in LPColSetBase.
 
SVectorBase< R > & colVector_w (int i)
 
const SVectorBase< R > & colVector (int i) const
 Returns colVector of i 'th LPColBase in LPColSetBase.
 
SVectorBase< R > & colVector_w (const DataKey &k)
 Returns writeable colVector of LPColBase with DataKey k in LPColSetBase.
 
const SVectorBase< R > & 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< R > &pcol)
 
void add (DataKey &pkey, const LPColBase< R > &pcol)
 Adds p pcol to LPColSetBase.
 
void add (const R &pobj, const R &plower, const SVectorBase< R > &pcolVector, const R &pupper, const int &pscaleExp=0)
 
void add (DataKey &newkey, const R &obj, const R &newlower, const SVectorBase< R > &newcolVector, const R &newupper, const int &newscaleExp=0)
 Adds LPColBase consisting of objective value obj, lower bound lower, column vector colVector and upper bound upper to LPColSetBase.
 
template<class S >
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.
 
template<class S >
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< R > &newset)
 
void add (DataKey keys[], const LPColSetBase< R > &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 R val[])
 
void add2 (int i, int n, const int idx[], const R val[])
 Adds n nonzero (idx, val)-pairs to i 'th colVector.
 
template<class S >
void add2 (int i, int n, const int idx[], const S val[])
 Adds n nonzero (idx, val)-pairs to i 'th colVector.
 
SVectorBase< R > & create (int pnonzeros=0, const R &pobj=1, const R &plw=0, const R &pupp=1, const int &pscaleExp=0)
 
SVectorBase< R > & create (DataKey &newkey, int nonzeros=0, const R &obj=1, const R &newlow=0, const R &newup=1, const int &newscaleExp=0)
 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.
 
 LPColSetBase (int pmax=-1, int pmemmax=-1)
 Default constructor.
 
LPColSetBase< R > & operator= (const LPColSetBase< R > &rs)
 Assignment operator.
 
template<class S >
LPColSetBase< R > & operator= (const LPColSetBase< S > &rs)
 Assignment operator.
 
 LPColSetBase (const LPColSetBase< R > &rs)
 Copy constructor.
 
template<class S >
 LPColSetBase (const LPColSetBase< S > &rs)
 Copy constructor.
 
virtual ~LPColSetBase ()
 Destructor.
 
- Protected Member Functions inherited from SPxBasisBase< R >
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.
 
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 SVectorBase< R > & baseVec (int i) const
 returns the i'th basic vector.
 
SPxId lastEntered () const
 returns SPxId of last VectorBase<R> 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().
 
int prevIteration () const
 returns the number of iterations prior to the last break in execution
 
int lastDegenCheck () const
 returns the number of iterations since the last degeneracy check
 
SPxSolverBase< R > * solver () const
 returns loaded solver.
 
VectorBase< R > & multBaseWith (VectorBase< R > &x) const
 Basis-vector product.
 
void multBaseWith (SSVectorBase< R > &x, SSVectorBase< R > &result) const
 Basis-vector product.
 
VectorBase< R > & multWithBase (VectorBase< R > &x) const
 Vector-basis product.
 
void multWithBase (SSVectorBase< R > &x, SSVectorBase< R > &result) const
 VectorBase<R>-basis product.
 
condition (int maxiters=10, R tolerance=1e-6)
 
getEstimatedCondition ()
 
getExactCondition ()
 
getMatrixMetric (int type=0)
 
stability () const
 returns the stability of the basis matrix.
 
void solve (VectorBase< R > &x, const VectorBase< R > &rhs)
 
void solve (SSVectorBase< R > &x, const SVectorBase< R > &rhs)
 
void solve4update (SSVectorBase< R > &x, const SVectorBase< R > &rhs)
 solves linear system with basis matrix.
 
void solve4update (SSVectorBase< R > &x, VectorBase< R > &y, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy)
 solves two systems in one call.
 
void solve4update (SSVectorBase< R > &x, SSVectorBase< R > &y, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy)
 solves two systems in one call using only sparse data structures
 
void solve4update (SSVectorBase< R > &x, VectorBase< R > &y, VectorBase< R > &y2, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy, SSVectorBase< R > &rhsy2)
 solves three systems in one call.
 
void solve4update (SSVectorBase< R > &x, SSVectorBase< R > &y, SSVectorBase< R > &y2, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy, SSVectorBase< R > &rhsy2)
 solves three systems in one call using only sparse data structures
 
void coSolve (VectorBase< R > &x, const VectorBase< R > &rhs)
 Cosolves linear system with basis matrix.
 
void coSolve (SSVectorBase< R > &x, const SVectorBase< R > &rhs)
 Sparse version of coSolve.
 
void coSolve (SSVectorBase< R > &x, VectorBase< R > &y, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy)
 solves two systems in one call.
 
void coSolve (SSVectorBase< R > &x, SSVectorBase< R > &y, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy)
 Sparse version of solving two systems in one call.
 
void coSolve (SSVectorBase< R > &x, VectorBase< R > &y, VectorBase< R > &z, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy, SSVectorBase< R > &rhsz)
 solves three systems in one call. May be improved by using just one pass through the basis.
 
void coSolve (SSVectorBase< R > &x, SSVectorBase< R > &y, SSVectorBase< R > &z, const SVectorBase< R > &rhsx, SSVectorBase< R > &rhsy, SSVectorBase< R > &rhsz)
 Sparse version of solving three systems in one call.
 
void addedRows (int n)
 inform SPxBasisBase, that n new rows had been added.
 
void removedRow (int i)
 inform SPxBasisBase that row i had been removed.
 
void removedRows (const int perm[])
 inform SPxBasisBase that rows in perm with negative entry were removed.
 
void addedCols (int n)
 inform SPxBasisBase that n new columns had been added.
 
void removedCol (int i)
 inform SPxBasisBase that column i had been removed.
 
void removedCols (const int perm[])
 inform SPxBasisBase that columns in perm with negative entry were removed.
 
void changedRow (int)
 inform SPxBasisBase that a row had been changed.
 
void changedCol (int)
 inform SPxBasisBase that a column had been changed.
 
void changedElement (int, int)
 inform SPxBasisBase that a matrix entry had been changed.
 
virtual void change (int i, SPxId &id, const SVectorBase< R > *enterVec, const SSVectorBase< R > *eta=nullptr)
 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 loadBasisSolver (SLinSolver< R > *solver, const bool destroy=false)
 sets up linear solver to use.
 
virtual void load (SPxSolverBase< R > *lp, bool initSlackBasis=true)
 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)
 
 SPxBasisBase (Timer::TYPE ttype=Timer::USER_TIME)
 default constructor.
 
 SPxBasisBase (const SPxBasisBase< R > &old)
 copy constructor
 
SPxBasisBase< R > & operator= (const SPxBasisBase< R > &rhs)
 assignment operator
 
virtual ~SPxBasisBase ()
 destructor.
 

Protected Attributes

Protected data
Array< UnitVectorBase< R > > unitVecs
 array of unit vectors
 
const SVSetBase< R > * thevectors
 the LP vectors according to representation
 
const SVSetBase< R > * thecovectors
 the LP coVectors according to representation
 
VectorBase< R > primRhs
 rhs VectorBase<R> for computing the primal vector
 
UpdateVector< R > primVec
 primal vector
 
VectorBase< R > dualRhs
 rhs VectorBase<R> for computing the dual vector
 
UpdateVector< R > dualVec
 dual vector
 
UpdateVector< R > addVec
 storage for thePvec = &addVec
 
VectorBase< R > theURbound
 Upper Row Feasibility bound.
 
VectorBase< R > theLRbound
 Lower Row Feasibility bound.
 
VectorBase< R > theUCbound
 Upper Column Feasibility bound.
 
VectorBase< R > theLCbound
 Lower Column Feasibility bound.
 
VectorBase< R > theUBbound
 Upper Basic Feasibility bound.
 
VectorBase< R > theLBbound
 Lower Basic Feasibility bound.
 
VectorBase< R > * theFrhs
 
UpdateVector< R > * theFvec
 
VectorBase< R > * theCoPrhs
 
UpdateVector< R > * theCoPvec
 
UpdateVector< R > * thePvec
 
UpdateVector< R > * theRPvec
 row pricing vector
 
UpdateVector< R > * theCPvec
 column pricing vector
 
VectorBase< R > * theUbound
 Upper bound for vars.
 
VectorBase< R > * theLbound
 Lower bound for vars.
 
VectorBase< R > * theCoUbound
 Upper bound for covars.
 
VectorBase< R > * theCoLbound
 Lower bound for covars.
 
VectorBase< R > theCoTest
 
VectorBase< R > theTest
 
DSVectorBase< R > primalRay
 stores primal ray in case of unboundedness
 
DSVectorBase< R > 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 polishCount
 number of solution polishing iterations
 
int boundflips
 number of performed bound flips
 
int totalboundflips
 total number of bound flips
 
int enterCycles
 the number of degenerate steps during the entering algorithm
 
int leaveCycles
 the number of degenerate steps during the leaving algorithm
 
int enterDegenCand
 the number of degenerate candidates in the entering algorithm
 
int leaveDegenCand
 the number of degenerate candidates in the leaving algorithm
 
primalDegenSum
 the sum of the primal degeneracy percentage
 
dualDegenSum
 the sum of the dual degeneracy percentage
 
SPxPricer< R > * thepricer
 
SPxRatioTester< R > * theratiotester
 
SPxStarter< R > * thestarter
 
boundrange
 absolute range of all bounds in the problem
 
siderange
 absolute range of all side in the problem
 
objrange
 absolute range of all objective coefficients in the problem
 
- Protected Attributes inherited from SPxLPBase< R >
std::shared_ptr< Tolerances_tolerances
 
- Protected Attributes inherited from LPRowSetBase< R >
DataArray< int > scaleExp
 row scaling factors (stored as bitshift)
 
- Protected Attributes inherited from ClassArray< Nonzero< R > >
int thesize
 number of used elements in array data
 
int themax
 the length of array data and
 
Nonzero< R > * data
 the array of elements
 
double memFactor
 memory extension factor.
 
- Protected Attributes inherited from LPColSetBase< R >
DataArray< int > scaleExp
 column scaling factors (stored as bitshift)
 
- Protected Attributes inherited from SPxBasisBase< R >
SPxSolverBase< R > * theLP
 the LP
 
DataArray< SPxIdtheBaseId
 SPxIds of basic vectors.
 
DataArray< const SVectorBase< R > * > matrix
 pointers to the vectors of the basis matrix.
 
bool matrixIsSetup
 true iff the pointers in matrix are set up correctly.
 
SLinSolver< R > * factor
 
bool factorized
 true iff factor = matrix \(^{-1}\).
 
int maxUpdates
 number of updates before refactorization.
 
nonzeroFactor
 allowed increase of nonzeros before refactorization.
 
fillFactor
 allowed increase in relative fill before refactorization
 
memFactor
 allowed total increase in memory consumption before refactorization
 
int iterCount
 number of calls to change() since last manipulation
 
int lastIterCount
 number of calls to change() before halting the simplex
 
int iterDegenCheck
 number of calls to change() since last degeneracy check
 
int updateCount
 number of calls to change() since last factorize()
 
int totalUpdateCount
 number of updates
 
int nzCount
 number of nonzeros in basis matrix
 
int lastMem
 memory needed after last fresh factorization
 
lastFill
 fill ratio that occured during last factorization
 
int lastNzCount
 number of nonzeros in basis matrix after last fresh factorization
 
TimertheTime
 time spent in updates
 
Timer::TYPE timerType
 type of timer (user or wallclock)
 
SPxId lastin
 lastEntered(): variable entered the base last
 
SPxId lastout
 lastLeft(): variable left the base last
 
int lastidx
 lastIndex(): basis index where last update was done
 
minStab
 minimum stability
 

Private Member Functions

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

Private Attributes

friend SPxFastRT< R >
 
friend SPxBoundFlippingRT< R >
 
Private data
Type theType
 entering or leaving algortihm.
 
Pricing thePricing
 full or partial pricing.
 
Representation theRep
 row or column representation.
 
SolutionPolish polishObj
 objective of solution polishing
 
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
 
objLimit
 < the number of calls to the method isTimeLimitReached()
 
bool useTerminationValue
 true, if objective limit should be used in the next solve.
 
Status m_status
 status of algorithm.
 
m_nonbasicValue
 nonbasic part of current objective value
 
bool m_nonbasicValueUpToDate
 true, if the stored objValue is up to date
 
m_pricingViol
 maximal feasibility violation of current solution
 
bool m_pricingViolUpToDate
 true, if the stored violation is up to date
 
m_pricingViolCo
 maximal feasibility violation of current solution in coDim
 
bool m_pricingViolCoUpToDate
 true, if the stored violation in coDim is up to date
 
int m_numViol
 number of violations of current solution
 
entertolscale
 factor to temporarily decrease the entering tolerance
 
leavetolscale
 factor to temporarily decrease the leaving tolerance
 
theShift
 sum of all shifts applied to any bound.
 
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.
 
SSVectorBase< R > * solveVector2
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorBase< R > * solveVector2rhs
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorBase< R > * solveVector3
 when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)
 
SSVectorBase< R > * solveVector3rhs
 when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)
 
SSVectorBase< R > * coSolveVector2
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorBase< R > * coSolveVector2rhs
 when 2 systems are to be solved at a time; typically for speepest edge weights
 
SSVectorBase< R > * coSolveVector3
 when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic solution will be modified!)
 
SSVectorBase< R > * coSolveVector3rhs
 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
 
instableLeaveVal
 
SPxId instableEnterId
 
bool instableEnter
 
instableEnterVal
 
bool recomputedVectors
 flag to perform clean up step to reduce numerical errors only once
 
int displayLine
 
int displayFreq
 
sparsePricingFactor
 enable sparse pricing when viols < factor * dim()
 
DataArray< VarStatusoldBasisStatusRows
 stored stable basis met before a simplex pivot (used to warm start the solver)
 
DataArray< VarStatusoldBasisStatusCols
 They don't have setters because only the internal simplex method is meant to fill them.
 
bool solvingForBoosted
 is this solver involved in a higher precision solving scheme?
 
int storeBasisSimplexFreq
 number of simplex pivots -1 to perform before storing stable basis
 
bool fullPerturbation
 whether to perturb the entire problem or just the bounds relevant for the current pivot
 
int printBasisMetric
 printing the current basis metric in the log (-1: off, 0: condition estimate, 1: trace, 2: determinant, 3: condition)
 

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 SPxSolverBase.

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 VectorBase< R > &, const VectorBase< R > &)
 
void computeFrhs2 (VectorBase< R > &, VectorBase< R > &)
 
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)
 
nonbasicValue ()
 Compute part of objective value.
 
virtual const SVectorBase< R > * enterVector (const SPxId &p_id)
 Get pointer to the id 'th vector.
 
virtual void getLeaveVals (int i, typename SPxBasisBase< R >::Desc::Status &leaveStat, SPxId &leaveId, R &leaveMax, R &leavebound, int &leaveNum, StableSum< R > &objChange)
 
virtual void getLeaveVals2 (R leaveMax, SPxId enterId, R &enterBound, R &newUBbound, R &newLBbound, R &newCoPrhs, StableSum< R > &objChange)
 
virtual void getEnterVals (SPxId id, R &enterTest, R &enterUB, R &enterLB, R &enterVal, R &enterMax, R &enterPric, typename SPxBasisBase< R >::Desc::Status &enterStat, R &enterRO, StableSum< R > &objChange)
 
virtual void getEnterVals2 (int leaveIdx, R enterMax, R &leaveBound, StableSum< R > &objChange)
 
virtual void ungetEnterVal (SPxId enterId, typename SPxBasisBase< R >::Desc::Status enterStat, R leaveVal, const SVectorBase< R > &vec, StableSum< R > &objChange)
 
virtual void rejectEnter (SPxId enterId, R enterTest, typename SPxBasisBase< R >::Desc::Status enterStat)
 
virtual void rejectLeave (int leaveNum, SPxId leaveId, typename SPxBasisBase< R >::Desc::Status leaveStat, const SVectorBase< R > *newVec=nullptr)
 
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 (typename SPxBasisBase< R >::Desc::Status stat) const
 converts basis status to VarStatus
 
SPxBasisBase< R >::Desc::Status varStatusToBasisStatusRow (int row, VarStatus stat) const
 converts VarStatus to basis status for rows
 
SPxBasisBase< R >::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 (R value=R(infinity))
 set objective limit.
 
virtual R terminationValue () const
 return objective limit.
 
virtual R objValue ()
 get objective value of current solution.
 
Status getResult (R *value=0, VectorBase< R > *primal=0, VectorBase< R > *slacks=0, VectorBase< R > *dual=0, VectorBase< R > *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.
 
SPxBasisBase< R >::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 (typename SPxBasisBase< R >::SPxStatus stat)
 set the lp solver's basis status.
 
void setSolverStatus (typename SPxSolverBase< R >::Status stat)
 setting the solver status external from the solve loop.
 
getDegeneracyLevel (VectorBase< R > degenvec)
 get level of dual degeneracy
 
void getNdualNorms (int &nnormsRow, int &nnormsCol) const
 get number of dual norms
 
bool getDualNorms (int &nnormsRow, int &nnormsCol, R *norms) const
 get dual norms
 
bool setDualNorms (int nnormsRow, int nnormsCol, R *norms)
 set dual norms
 
void setIntegralityInformation (int ncols, int *intInfo)
 pass integrality information about the variables to the solver
 
void resetCumulativeTime ()
 reset cumulative time counter to zero.
 
int boundFlips () const
 get number of bound flips.
 
int dualDegeneratePivots ()
 get number of dual degenerate pivots
 
int primalDegeneratePivots ()
 get number of primal degenerate pivots
 
sumDualDegeneracy ()
 get the sum of dual degeneracy
 
sumPrimalDegeneracy ()
 get the sum of primal degeneracy
 
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
 
int polishIterations ()
 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 getMaxTime ()
 the maximum runtime
 
Real cumulativeTime () const
 cumulative time spent in all calls to method solve().
 
int getMaxIters ()
 the maximum number of iterations
 
const LPRowSetBase< R > & rows () const
 return const lp's rows if available.
 
const LPColSetcols () const
 return const lp's cols if available.
 
void getLower (VectorBase< R > &p_low) const
 copy lower bound VectorBase<R> to p_low.
 
void getUpper (VectorBase< R > &p_up) const
 copy upper bound VectorBase<R> to p_up.
 
void getLhs (VectorBase< R > &p_lhs) const
 copy lhs value VectorBase<R> to p_lhs.
 
void getRhs (VectorBase< R > &p_rhs) const
 copy rhs value VectorBase<R> to p_rhs.
 
SPxLPBase< R >::SPxSense sense () const
 optimization sense.
 
std::string statistics () const
 returns statistical information in form of a string.
 

The Simplex Loop

We now present a set of methods that may be usefull when implementing own SPxPricer or SPxRatioTester classes. Here is, how SPxSolverBase 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 (SSVectorBase< R > *p_y, SSVectorBase< R > *p_rhs)
 Setup vectors to be solved within Simplex loop.
 
void setup4solve2 (SSVectorBase< R > *p_y2, SSVectorBase< R > *p_rhs2)
 Setup vectors to be solved within Simplex loop.
 
void setup4coSolve (SSVectorBase< R > *p_y, SSVectorBase< R > *p_rhs)
 Setup vectors to be cosolved within Simplex loop.
 
void setup4coSolve2 (SSVectorBase< R > *p_z, SSVectorBase< R > *p_rhs)
 Setup vectors to be cosolved within Simplex loop.
 
virtual R maxInfeas () const
 maximal infeasibility of basis
 
virtual bool noViols (R tol) const
 check for violations above tol and immediately return false w/o checking the remaining values
 
const SPxBasisBase< R > & basis () const
 Return current basis.
 
SPxBasisBase< R > & basis ()
 
const SPxPricer< R > * pricer () const
 return loaded SPxPricer.
 
const SLinSolver< R > * slinSolver () const
 return loaded SLinSolver.
 
const SPxRatioTester< R > * ratiotester () const
 return loaded SPxRatioTester.
 
virtual void factorize ()
 Factorize basis matrix.
 
bool leave (int i, bool polish=false)
 
bool enter (SPxId &id, bool polish=false)
 
coTest (int i, typename SPxBasisBase< R >::Desc::Status stat) const
 test coVector i with status stat.
 
void computeCoTest ()
 compute coTest vector.
 
void updateCoTest ()
 recompute coTest vector.
 
test (int i, typename SPxBasisBase< R >::Desc::Status stat) const
 test VectorBase<R> i with status stat.
 
void updateTest ()
 recompute test vector.
 
void computeFtest ()
 compute basis feasibility test vector.
 
void updateFtest ()
 update basis feasibility test vector.
 

Additional Inherited Members

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

Detailed Description

template<class R>
class soplex::SPxSolverBase< R >

Sequential object-oriented SimPlex.

SPxSolverBase is an LP solver class using the revised Simplex algorithm. It provides 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, SPxSolverBase can be customized with various respects:

SPxSolverBase is derived from SPxLPBase<R> that is used to store the LP to be solved. Hence, the LPs solved with SPxSolverBase 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, SPxLPBase<R> provide all manipulation methods for the LP. They allow SPxSolverBase to be used within cutting plane algorithms.

Definition at line 103 of file spxsolver.h.

Member Enumeration Documentation

◆ Pricing

template<class R >
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 SPxSolverBase. 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 SPxSolverBase. However, vectors coPvec() and coTest() are still kept up to date by SPxSolverBase. 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 SPxSolverBase.

Definition at line 170 of file spxsolver.h.

◆ Representation

template<class R >
enum Representation

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 SPxSolverBase, i.e. a columnwise (COLUMN == 1) or rowwise (ROW == -1) one.

Enumerator
ROW 

rowwise representation.

COLUMN 

columnwise representation.

Definition at line 123 of file spxsolver.h.

◆ SolutionPolish

template<class R >
enum SolutionPolish

objective for solution polishing

Enumerator
POLISH_OFF 

don't perform modifications on optimal basis

POLISH_INTEGRALITY 

maximize number of basic slack variables, i.e. more variables on bounds

POLISH_FRACTIONALITY 

minimize number of basic slack variables, i.e. more variables in between bounds

Definition at line 232 of file spxsolver.h.

◆ Status

template<class R >
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.

OPTIMAL_UNSCALED_VIOLATIONS 

LP has beed solved to optimality but unscaled solution contains violations.

Definition at line 208 of file spxsolver.h.

◆ Type

template<class R >
enum Type

Algorithmic type.

SPxSolverBase 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 142 of file spxsolver.h.

◆ VarStatus

template<class R >
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 195 of file spxsolver.h.

Constructor & Destructor Documentation

◆ SPxSolverBase() [1/2]

template<class R >
SPxSolverBase ( Type type = LEAVE,
Representation rep = ROW,
Timer::TYPE ttype = Timer::USER_TIME )
explicit

default constructor.

Constructors / destructors

◆ ~SPxSolverBase()

template<class R >
virtual ~SPxSolverBase ( )
virtual

◆ SPxSolverBase() [2/2]

template<class R >
SPxSolverBase ( const SPxSolverBase< R > & base)

copy constructor

Member Function Documentation

◆ addedCols()

template<class R >
virtual void addedCols ( int n)
protectedvirtual

Reimplemented from SPxLPBase< R >.

◆ addedRows()

template<class R >
virtual void addedRows ( int n)
protectedvirtual

Reimplemented from SPxLPBase< R >.

◆ basis() [1/2]

template<class R >
SPxBasisBase< R > & basis ( )

Definition at line 1872 of file spxsolver.h.

◆ basis() [2/2]

template<class R >
const SPxBasisBase< R > & 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 1867 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getBasisMetric(), SPxSolverBase< R >::iterations(), and SPxSolverBase< R >::statistics().

◆ basisStatusToVarStatus()

template<class R >
VarStatus basisStatusToVarStatus ( typename SPxBasisBase< R >::Desc::Status stat) const
protected

converts basis status to VarStatus

Todo
put the following basis methods near the variable status methods!

◆ boundFlips()

template<class R >
int boundFlips ( ) const

get number of bound flips.

Definition at line 2195 of file spxsolver.h.

References SPxSolverBase< R >::totalboundflips.

◆ calculateProblemRanges()

template<class R >
void calculateProblemRanges ( )
protected

determine ranges of problem values for bounds, sides and objective to assess numerical difficulties

◆ changeBounds() [1/3]

template<class R >
virtual void changeBounds ( const VectorBase< R > & newLower,
const VectorBase< R > & newUpper,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeBounds().

◆ changeBounds() [2/3]

template<class R >
virtual void changeBounds ( int i,
const R & newLower,
const R & newUpper,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeBounds() [3/3]

template<class R >
virtual void changeBounds ( SPxColId p_id,
const R & p_newLower,
const R & p_newUpper,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1109 of file spxsolver.h.

References SPxSolverBase< R >::changeBounds(), and SPxLPBase< R >::number().

◆ changeCol() [1/2]

template<class R >
virtual void changeCol ( int i,
const LPColBase< R > & newCol,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeCol().

◆ changeCol() [2/2]

template<class R >
virtual void changeCol ( SPxColId p_id,
const LPColBase< R > & p_newCol,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1161 of file spxsolver.h.

References SPxSolverBase< R >::changeCol(), and SPxLPBase< R >::number().

◆ changeElement() [1/2]

template<class R >
virtual void changeElement ( int i,
int j,
const R & val,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeElement().

◆ changeElement() [2/2]

template<class R >
virtual void changeElement ( SPxRowId rid,
SPxColId cid,
const R & val,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1169 of file spxsolver.h.

References SPxSolverBase< R >::changeElement(), and SPxLPBase< R >::number().

◆ changeLhs() [1/3]

template<class R >
virtual void changeLhs ( const VectorBase< R > & newLhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeLhs().

◆ changeLhs() [2/3]

template<class R >
virtual void changeLhs ( int i,
const R & newLhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeLhs() [3/3]

template<class R >
virtual void changeLhs ( SPxRowId p_id,
const R & p_newLhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1122 of file spxsolver.h.

References SPxSolverBase< R >::changeLhs(), and SPxLPBase< R >::number().

◆ changeLhsStatus()

template<class R >
virtual void changeLhsStatus ( int i,
R newLhs,
R oldLhs = 0.0 )
virtual

◆ changeLower() [1/3]

template<class R >
virtual void changeLower ( const VectorBase< R > & newLower,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeLower().

◆ changeLower() [2/3]

template<class R >
virtual void changeLower ( int i,
const R & newLower,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeLower() [3/3]

template<class R >
virtual void changeLower ( SPxColId p_id,
const R & p_newLower,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1086 of file spxsolver.h.

References SPxSolverBase< R >::changeLower(), and SPxLPBase< R >::number().

◆ changeLowerStatus()

template<class R >
virtual void changeLowerStatus ( int i,
R newLower,
R oldLower = 0.0 )
virtual

◆ changeMaxObj() [1/3]

template<class R >
virtual void changeMaxObj ( const VectorBase< R > & newObj,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeMaxObj().

◆ changeMaxObj() [2/3]

template<class R >
virtual void changeMaxObj ( int i,
const R & newVal,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeMaxObj() [3/3]

template<class R >
virtual void changeMaxObj ( SPxColId p_id,
const R & p_newVal,
bool scale = false )
virtual

overloading a virtual function

Reimplemented from SPxLPBase< R >.

Definition at line 1058 of file spxsolver.h.

References SPxSolverBase< R >::changeMaxObj(), and SPxLPBase< R >::number().

◆ changeObj() [1/3]

template<class R >
virtual void changeObj ( const VectorBase< R > & newObj,
bool scale = false )
virtual

scale determines whether the new data needs to be scaled according to the existing LP (persistent scaling)

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeObj().

◆ changeObj() [2/3]

template<class R >
virtual void changeObj ( int i,
const R & newVal,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeObj() [3/3]

template<class R >
virtual void changeObj ( SPxColId p_id,
const R & p_newVal,
bool scale = false )
virtual

overloading a virtual function

Reimplemented from SPxLPBase< R >.

Definition at line 1048 of file spxsolver.h.

References SPxSolverBase< R >::changeObj(), and SPxLPBase< R >::number().

◆ changeRange() [1/3]

template<class R >
virtual void changeRange ( const VectorBase< R > & newLhs,
const VectorBase< R > & newRhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeRange().

◆ changeRange() [2/3]

template<class R >
virtual void changeRange ( int i,
const R & newLhs,
const R & newRhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeRange() [3/3]

template<class R >
virtual void changeRange ( SPxRowId p_id,
const R & p_newLhs,
const R & p_newRhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1145 of file spxsolver.h.

References SPxSolverBase< R >::changeRange(), and SPxLPBase< R >::number().

◆ changeRhs() [1/3]

template<class R >
virtual void changeRhs ( const VectorBase< R > & newRhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeRhs().

◆ changeRhs() [2/3]

template<class R >
virtual void changeRhs ( int i,
const R & newRhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeRhs() [3/3]

template<class R >
virtual void changeRhs ( SPxRowId p_id,
const R & p_newRhs,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1134 of file spxsolver.h.

References SPxSolverBase< R >::changeRhs(), and SPxLPBase< R >::number().

◆ changeRhsStatus()

template<class R >
virtual void changeRhsStatus ( int i,
R newRhs,
R oldRhs = 0.0 )
virtual

◆ changeRow() [1/2]

template<class R >
virtual void changeRow ( int i,
const LPRowBase< R > & newRow,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeRow().

◆ changeRow() [2/2]

template<class R >
virtual void changeRow ( SPxRowId p_id,
const LPRowBase< R > & p_newRow,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1153 of file spxsolver.h.

References SPxSolverBase< R >::changeRow(), and SPxLPBase< R >::number().

◆ changeRowObj() [1/3]

template<class R >
virtual void changeRowObj ( const VectorBase< R > & newObj,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeRowObj().

◆ changeRowObj() [2/3]

template<class R >
virtual void changeRowObj ( int i,
const R & newVal,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeRowObj() [3/3]

template<class R >
virtual void changeRowObj ( SPxRowId p_id,
const R & p_newVal,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1068 of file spxsolver.h.

References SPxSolverBase< R >::changeRowObj(), and SPxLPBase< R >::number().

◆ changeSense()

template<class R >
virtual void changeSense ( typename SPxLPBase< R >::SPxSense sns)
virtual

◆ changeUpper() [1/3]

template<class R >
virtual void changeUpper ( const VectorBase< R > & newUpper,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

Referenced by SPxSolverBase< R >::changeUpper().

◆ changeUpper() [2/3]

template<class R >
virtual void changeUpper ( int i,
const R & newUpper,
bool scale = false )
virtual

Reimplemented from SPxLPBase< R >.

◆ changeUpper() [3/3]

template<class R >
virtual void changeUpper ( SPxColId p_id,
const R & p_newUpper,
bool scale = false )
virtual

overloading virtual function

Reimplemented from SPxLPBase< R >.

Definition at line 1098 of file spxsolver.h.

References SPxSolverBase< R >::changeUpper(), and SPxLPBase< R >::number().

◆ changeUpperStatus()

template<class R >
virtual void changeUpperStatus ( int i,
R newUpper,
R oldLower = 0.0 )
virtual

◆ clear()

template<class R >
virtual void clear ( )
virtual

clear all data in solver.

Reimplemented from SPxLPBase< R >.

◆ clearDualBounds()

template<class R >
void clearDualBounds ( typename SPxBasisBase< R >::Desc::Status ,
R & ,
R &  ) const
protected

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

◆ clearRowObjs()

template<class R >
virtual void clearRowObjs ( )
virtual

Reimplemented from SPxLPBase< R >.

Definition at line 1073 of file spxsolver.h.

References SPxLPBase< R >::clearRowObjs(), and SPxSolverBase< R >::unInit().

◆ clearUpdateVecs()

template<class R >
virtual void clearUpdateVecs ( void )
protectedvirtual

◆ coDim()

template<class R >
int coDim ( ) const

codimension.

Definition at line 1186 of file spxsolver.h.

References SPxSolverBase< R >::thevectors.

◆ coId()

template<class R >
SPxId coId ( int i) const

id of i 'th covector.

The i 'th coId() is the i 'th SPxColId for a rowwise and the i 'th SPxRowId for a columnwise basis represenation. Hence, 0 <= i < dim().

Definition at line 1223 of file spxsolver.h.

References SPxLPBase< R >::cId(), SPxSolverBase< R >::rep(), SPxLPBase< R >::rId(), and SPxSolverBase< R >::ROW.

◆ colId()

template<class R >
SPxColId colId ( int i) const

ColId of i 'th column.

Definition at line 2341 of file spxsolver.h.

References SPxLPBase< R >::cId().

◆ cols()

template<class R >
const LPColSet & cols ( ) const

return const lp's cols if available.

Definition at line 2284 of file spxsolver.h.

References SPxLPBase< R >::lpcolset().

◆ computeCoTest()

template<class R >
void computeCoTest ( )
private

compute coTest vector.

◆ computeDualfarkas4Col()

template<class R >
void computeDualfarkas4Col ( R direction)
protected

◆ computeDualfarkas4Row()

template<class R >
void computeDualfarkas4Row ( R direction,
SPxId enterId )
protected

◆ computeEnterCoPrhs()

template<class R >
virtual void computeEnterCoPrhs ( )
protectedvirtual

compute theCoPrhs for entering Simplex.

◆ computeEnterCoPrhs4Col()

template<class R >
void computeEnterCoPrhs4Col ( int i,
int n )
protected

◆ computeEnterCoPrhs4Row()

template<class R >
void computeEnterCoPrhs4Row ( int i,
int n )
protected

◆ computeFrhs()

template<class R >
void computeFrhs ( )
protected

compute feasibility vector from scratch.

◆ computeFrhs1()

template<class R >
virtual void computeFrhs1 ( const VectorBase< R > & ,
const VectorBase< R > &  )
protectedvirtual

◆ computeFrhs2()

template<class R >
void computeFrhs2 ( VectorBase< R > & ,
VectorBase< R > &  )
protected

◆ computeFrhsXtra()

template<class R >
virtual void computeFrhsXtra ( )
protectedvirtual

◆ computeFtest()

template<class R >
void computeFtest ( )
private

compute basis feasibility test vector.

◆ computeLeaveCoPrhs()

template<class R >
virtual void computeLeaveCoPrhs ( )
protectedvirtual

compute theCoPrhs for leaving Simplex.

◆ computeLeaveCoPrhs4Col()

template<class R >
void computeLeaveCoPrhs4Col ( int i,
int n )
protected

◆ computeLeaveCoPrhs4Row()

template<class R >
void computeLeaveCoPrhs4Row ( int i,
int n )
protected

◆ computePrimalray4Col()

template<class R >
void computePrimalray4Col ( R direction,
SPxId enterId )
protected

Compute the primal ray or the farkas proof in case of unboundedness or infeasibility.

◆ computePrimalray4Row()

template<class R >
void computePrimalray4Row ( R direction)
protected

◆ computePvec() [1/2]

template<class R >
void computePvec ( )

compute entire pVec().

◆ computePvec() [2/2]

template<class R >
R computePvec ( int i)

compute and return pVec()[i].

◆ computeTest() [1/2]

template<class R >
void computeTest ( )

compute test VectorBase<R> in ENTERing Simplex.

◆ computeTest() [2/2]

template<class R >
R computeTest ( int i)

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

◆ coPrhs()

template<class R >
const VectorBase< R > & 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 tight bounds of all basic constraints.

Definition at line 1517 of file spxsolver.h.

References SPxSolverBase< R >::theCoPrhs.

◆ coPvec()

template<class R >
UpdateVector< R > & coPvec ( ) const

copricing vector.

The copricing vector coPvec along with the pricing vector pVec are used for pricing in the ENTERing Simplex algorithm, i.e. one variable is selected, that violates its bounds. In contrast to this, the LEAVEing Simplex algorithm keeps both vectors within their bounds.

Definition at line 1504 of file spxsolver.h.

References SPxSolverBase< R >::theCoPvec.

◆ coTest() [1/2]

template<class R >
const VectorBase< R > & coTest ( ) const

violations of coPvec.

In entering Simplex pricing selects checks vectors coPvec() and pVec() for violation of its bounds. coTest() contains the violations for coPvec() which are indicated by a negative value. That is, if coTest()[i] < 0, the i 'th element of coPvec() is violated by -coTest()[i].

Definition at line 1571 of file spxsolver.h.

References SPxSolverBase< R >::ENTER, SPxSolverBase< R >::theCoTest, and SPxSolverBase< R >::type().

◆ coTest() [2/2]

template<class R >
R coTest ( int i,
typename SPxBasisBase< R >::Desc::Status stat ) const
private

test coVector i with status stat.

◆ covarStatus()

template<class R >
SPxBasisBase< R >::Desc::Status covarStatus ( int i) const

Status of i 'th covariable.

Definition at line 1363 of file spxsolver.h.

References SPxBasisBase< R >::Desc::coStatus(), and SPxBasisBase< R >::desc().

◆ coVector() [1/4]

template<class R >
const SVectorBase< R > & coVector ( const SPxColId & cid) const

◆ coVector() [2/4]

template<class R >
const SVectorBase< R > & 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 1334 of file spxsolver.h.

References SPxSolverBase< R >::coVector(), SPxId::isSPxRowId(), and SPxId::isValid().

◆ coVector() [3/4]

template<class R >
const SVectorBase< R > & coVector ( const SPxRowId & rid) const

◆ coVector() [4/4]

template<class R >
const SVectorBase< R > & 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 1307 of file spxsolver.h.

References SPxSolverBase< R >::thecovectors.

Referenced by SPxSolverBase< R >::coVector().

◆ cumulativeTime()

template<class R >
Real cumulativeTime ( ) const

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

Definition at line 2266 of file spxsolver.h.

References SPxSolverBase< R >::theCumulativeTime.

◆ delta()

template<class R >
R delta ( ) const

guaranteed primal and dual bound violation for optimal solution, returning the maximum of floatingPointFeastol() and floatingPointOpttol().

Definition at line 886 of file spxsolver.h.

References SOPLEX_MAX, and SPxSolverBase< R >::tolerances().

◆ dim()

template<class R >
int dim ( ) const

dimension of basis matrix.

Definition at line 1181 of file spxsolver.h.

References SPxSolverBase< R >::thecovectors.

◆ doPupdate()

template<class R >
virtual void doPupdate ( void )
protectedvirtual

◆ doRemoveCol()

template<class R >
virtual void doRemoveCol ( int i)
protectedvirtual

Reimplemented from SPxLPBase< R >.

◆ doRemoveCols()

template<class R >
virtual void doRemoveCols ( int perm[])
protectedvirtual

Reimplemented from SPxLPBase< R >.

◆ doRemoveRow()

template<class R >
virtual void doRemoveRow ( int i)
protectedvirtual

Reimplemented from SPxLPBase< R >.

◆ doRemoveRows()

template<class R >
virtual void doRemoveRows ( int perm[])
protectedvirtual

Reimplemented from SPxLPBase< R >.

◆ dualDegeneratePivots()

template<class R >
int dualDegeneratePivots ( )

get number of dual degenerate pivots

Definition at line 2201 of file spxsolver.h.

References SPxSolverBase< R >::enterCycles, SPxSolverBase< R >::leaveCycles, SPxSolverBase< R >::rep(), and SPxSolverBase< R >::ROW.

◆ dualIterations()

template<class R >
int dualIterations ( )

return number of iterations done with primal algorithm

Definition at line 2238 of file spxsolver.h.

References SPxSolverBase< R >::iterations(), and SPxSolverBase< R >::primalIterations().

◆ enter()

template<class R >
bool enter ( SPxId & id,
bool polish = false )
private

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

Returns
false if LP is unbounded/infeasible.

◆ entertol()

template<class R >
R entertol ( ) const

feasibility tolerance maintained by ratio test during ENTER algorithm.

Definition at line 855 of file spxsolver.h.

References SPxSolverBase< R >::COLUMN, SPxSolverBase< R >::entertolscale, SPxSolverBase< R >::theRep, and SPxSolverBase< R >::tolerances().

◆ enterVector()

template<class R >
virtual const SVectorBase< R > * enterVector ( const SPxId & p_id)
protectedvirtual

Get pointer to the id 'th vector.

Definition at line 2002 of file spxsolver.h.

References SPxId::isSPxRowId(), SPxId::isValid(), and SPxSolverBase< R >::vector().

◆ epsilon()

template<class R >
R epsilon ( ) const

values \(|x| < \epsilon\) are considered to be 0.

if you want another value for epsilon, use Tolerances::setEpsilon().

Definition at line 850 of file spxsolver.h.

References SPxSolverBase< R >::tolerances().

◆ factorize()

template<class R >
virtual void factorize ( )
virtual

Factorize basis matrix.

Exceptions
SPxStatusExceptionif loaded matrix is singular

Reimplemented from SPxBasisBase< R >.

◆ factorizeAndRecompute()

template<class R >
virtual void factorizeAndRecompute ( )
virtual

helper method that computes a fresh factorization of the basis matrix (if at least one update has been performed) and recomputes Frhs, Fvec, CoPrhs, Pvec, and the nonbasic values. In LEAVE the Ftest is recomputed, in ENTER the CoTest and Test are recomputed.

This method is called to eliminate accumulated errors from LU updates especially required before checking if the solver can terminate (optimality or objective limit)

◆ forceRecompNonbasicValue()

template<class R >
void forceRecompNonbasicValue ( )

◆ fRhs()

template<class R >
const VectorBase< R > & 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 1442 of file spxsolver.h.

References SPxSolverBase< R >::theFrhs.

◆ fTest()

template<class R >
const VectorBase< R > & 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 1491 of file spxsolver.h.

References SPxSolverBase< R >::LEAVE, SPxSolverBase< R >::theCoTest, and SPxSolverBase< R >::type().

◆ fVec()

template<class R >
UpdateVector< R > & fVec ( ) const

feasibility vector.

This method return the feasibility vector. If it satisfies its bound, the basis is called feasible (independently of the chosen representation). The feasibility vector has dimension dim().

For the entering Simplex, fVec is kept within its bounds. In contrast to this, the pricing of the leaving Simplex selects an element of fVec, that violates its bounds.

Definition at line 1429 of file spxsolver.h.

References SPxSolverBase< R >::theFvec.

◆ getBasis()

template<class R >
Status getBasis ( VarStatus rows[],
VarStatus cols[],
const int rowsSize = -1,
const int colsSize = -1 ) const

get current basis, and return solver status.

◆ getBasisColStatus()

template<class R >
VarStatus getBasisColStatus ( int col) const

gets basis status for a single column

◆ getBasisMetric()

template<class R >
virtual R getBasisMetric ( int type)
virtual

Definition at line 991 of file spxsolver.h.

References SPxSolverBase< R >::basis(), and SPxSolverBase< R >::type().

◆ getBasisRowStatus()

template<class R >
VarStatus getBasisRowStatus ( int row) const

gets basis status for a single row

◆ getBasisStatus()

template<class R >
SPxBasisBase< R >::SPxStatus getBasisStatus ( ) const

gets basis status

Definition at line 2146 of file spxsolver.h.

References SPxBasisBase< R >::status().

◆ getDegeneracyLevel()

template<class R >
R getDegeneracyLevel ( VectorBase< R > degenvec)

get level of dual degeneracy

◆ getDisplayFreq()

template<class R >
int getDisplayFreq ( )

get display frequency

Definition at line 921 of file spxsolver.h.

References SPxSolverBase< R >::displayFreq.

◆ getDualfarkas()

template<class R >
virtual Status getDualfarkas ( VectorBase< R > & vector) const
virtual

get dual farkas proof of infeasibility.

Exceptions
SPxStatusExceptionif no problem loaded

◆ getDualNorms()

template<class R >
bool getDualNorms ( int & nnormsRow,
int & nnormsCol,
R * norms ) const

get dual norms

◆ getDualSol()

template<class R >
virtual Status getDualSol ( VectorBase< R > & vector) const
virtual

get current solution VectorBase<R> for dual variables.

This method returns the Status of the basis. If it is REGULAR or better, the VectorBase<R> of dual variables of the current basis will be copied to the argument vector. Hence, VectorBase<R> 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

◆ getEnterVals()

template<class R >
virtual void getEnterVals ( SPxId id,
R & enterTest,
R & enterUB,
R & enterLB,
R & enterVal,
R & enterMax,
R & enterPric,
typename SPxBasisBase< R >::Desc::Status & enterStat,
R & enterRO,
StableSum< R > & objChange )
protectedvirtual

◆ getEnterVals2()

template<class R >
virtual void getEnterVals2 ( int leaveIdx,
R enterMax,
R & leaveBound,
StableSum< R > & objChange )
protectedvirtual

◆ getLeaveVals()

template<class R >
virtual void getLeaveVals ( int i,
typename SPxBasisBase< R >::Desc::Status & leaveStat,
SPxId & leaveId,
R & leaveMax,
R & leavebound,
int & leaveNum,
StableSum< R > & objChange )
protectedvirtual

◆ getLeaveVals2()

template<class R >
virtual void getLeaveVals2 ( R leaveMax,
SPxId enterId,
R & enterBound,
R & newUBbound,
R & newLBbound,
R & newCoPrhs,
StableSum< R > & objChange )
protectedvirtual

◆ getLhs()

template<class R >
void getLhs ( VectorBase< R > & p_lhs) const

copy lhs value VectorBase<R> to p_lhs.

Definition at line 2301 of file spxsolver.h.

References SPxLPBase< R >::lhs().

◆ getLower()

template<class R >
void getLower ( VectorBase< R > & p_low) const

copy lower bound VectorBase<R> to p_low.

Definition at line 2290 of file spxsolver.h.

References SPxLPBase< R >::lower().

◆ getMaxIters()

template<class R >
int getMaxIters ( )

the maximum number of iterations

Definition at line 2272 of file spxsolver.h.

References SPxSolverBase< R >::maxIters.

◆ getMaxTime()

template<class R >
Real getMaxTime ( )

the maximum runtime

Definition at line 2260 of file spxsolver.h.

References SPxSolverBase< R >::maxTime.

◆ getNdualNorms()

template<class R >
void getNdualNorms ( int & nnormsRow,
int & nnormsCol ) const

get number of dual norms

◆ getOldBasisStatusCols()

template<class R >
DataArray< VarStatus > & getOldBasisStatusCols ( )

Definition at line 947 of file spxsolver.h.

References SPxSolverBase< R >::oldBasisStatusCols.

◆ getOldBasisStatusRows()

template<class R >
DataArray< VarStatus > & getOldBasisStatusRows ( )

Definition at line 941 of file spxsolver.h.

References SPxSolverBase< R >::oldBasisStatusRows.

◆ getPrimalray()

template<class R >
virtual Status getPrimalray ( VectorBase< R > & vector) const
virtual

get primal ray in case of unboundedness.

Exceptions
SPxStatusExceptionif no problem loaded

◆ getPrimalSol()

template<class R >
virtual Status getPrimalSol ( VectorBase< R > & vector) const
virtual

get solution vector for primal variables.

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

Exceptions
SPxStatusExceptionif not initialized

◆ getRedCostSol()

template<class R >
virtual Status getRedCostSol ( VectorBase< R > & 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

◆ getResult()

template<class R >
Status getResult ( R * value = 0,
VectorBase< R > * primal = 0,
VectorBase< R > * slacks = 0,
VectorBase< R > * dual = 0,
VectorBase< R > * reduCost = 0 )

get all results of last solve.

◆ getRhs()

template<class R >
void getRhs ( VectorBase< R > & p_rhs) const

copy rhs value VectorBase<R> to p_rhs.

Definition at line 2307 of file spxsolver.h.

References SPxLPBase< R >::rhs().

◆ getSlacks()

template<class R >
virtual Status getSlacks ( VectorBase< R > & vector) const
virtual

get VectorBase<R> 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, VectorBase<R> must be of dimension nRows().

Warning
Because SPxSolverBase 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

◆ getSolutionPolishing()

template<class R >
SolutionPolish getSolutionPolishing ( )

return objective of solution polishing

Definition at line 693 of file spxsolver.h.

References SPxSolverBase< R >::polishObj.

◆ getTiming()

◆ getUpper()

template<class R >
void getUpper ( VectorBase< R > & p_up) const

copy upper bound VectorBase<R> to p_up.

Definition at line 2295 of file spxsolver.h.

References SPxLPBase< R >::upper().

◆ hyperPricing()

template<class R >
void hyperPricing ( bool h)

enable or disable hyper sparse pricing

◆ id()

template<class R >
SPxId id ( int i) const

id of i 'th vector.

The i 'th Id is the i 'th SPxRowId for a rowwise and the i 'th SPxColId for a columnwise basis represenation. Hence, 0 <= i < coDim().

Definition at line 1204 of file spxsolver.h.

References SPxLPBase< R >::cId(), SPxSolverBase< R >::rep(), SPxLPBase< R >::rId(), and SPxSolverBase< R >::ROW.

◆ init()

template<class R >
virtual void init ( )
virtual

intialize data structures.

If SPxSolverBase 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 SPxSolverBase<R>::init().

◆ initRep()

template<class R >
void initRep ( Representation p_rep)

initialize ROW or COLUMN representation.

◆ invalidateBasis()

template<class R >
void invalidateBasis ( )

invalidates the basis, triggers refactorization

◆ isBasic() [1/5]

template<class R >
bool isBasic ( const SPxColId & cid) const

is the cid 'th vector basic ?

Definition at line 1390 of file spxsolver.h.

References SPxBasisBase< R >::desc(), SPxSolverBase< R >::isBasic(), and SPxLPBase< R >::number().

◆ isBasic() [2/5]

template<class R >
bool isBasic ( const SPxId & p_id) const

is the p_id 'th vector basic ?

Definition at line 1375 of file spxsolver.h.

References SPxSolverBase< R >::isBasic(), SPxId::isSPxRowId(), and SPxId::isValid().

◆ isBasic() [3/5]

template<class R >
bool isBasic ( const SPxRowId & rid) const

is the rid 'th vector basic ?

Definition at line 1384 of file spxsolver.h.

References SPxBasisBase< R >::desc(), SPxSolverBase< R >::isBasic(), and SPxLPBase< R >::number().

◆ isBasic() [4/5]

template<class R >
bool isBasic ( int i) const

is the i 'th vector basic ?

Definition at line 1408 of file spxsolver.h.

References SPxBasisBase< R >::desc(), SPxSolverBase< R >::isBasic(), and SPxSolverBase< R >::status().

◆ isBasic() [5/5]

template<class R >
bool isBasic ( typename SPxBasisBase< R >::Desc::Status stat) const

◆ isBasisValid()

template<class R >
bool isBasisValid ( DataArray< VarStatus > rows,
DataArray< VarStatus > cols )

check a given basis for validity.

◆ isCoBasic()

template<class R >
bool isCoBasic ( int i) const

is the i 'th covector basic ?

Definition at line 1414 of file spxsolver.h.

References SPxBasisBase< R >::desc(), and SPxSolverBase< R >::isBasic().

◆ isCoId()

template<class R >
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 1250 of file spxsolver.h.

References DataKey::info, and SPxSolverBase< R >::theRep.

◆ isColBasic()

template<class R >
bool isColBasic ( int i) const

is the i 'th column vector basic ?

Definition at line 1402 of file spxsolver.h.

References SPxBasisBase< R >::desc(), and SPxSolverBase< R >::isBasic().

◆ isConsistent()

template<class R >
bool isConsistent ( ) const

check consistency.

Miscellaneous

◆ isId()

template<class R >
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 1241 of file spxsolver.h.

References DataKey::info, and SPxSolverBase< R >::theRep.

◆ isInitialized()

template<class R >
bool isInitialized ( ) const
protected

has the internal data been initialized?

As long as an instance of SPxSolverBase 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 1956 of file spxsolver.h.

References SPxSolverBase< R >::initialized.

◆ isRowBasic()

template<class R >
bool isRowBasic ( int i) const

is the i 'th row vector basic ?

Definition at line 1396 of file spxsolver.h.

References SPxBasisBase< R >::desc(), and SPxSolverBase< R >::isBasic().

◆ isTerminationValueEnabled()

template<class R >
bool isTerminationValueEnabled ( ) const

true if objective limit should be used in the next solve

Definition at line 699 of file spxsolver.h.

References SPxSolverBase< R >::useTerminationValue.

◆ isTimeLimitReached()

template<class R >
bool isTimeLimitReached ( const bool forceCheck = false)

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

◆ iterations()

template<class R >
int iterations ( ) const

get number of iterations of current solution.

Definition at line 2225 of file spxsolver.h.

References SPxSolverBase< R >::basis().

Referenced by SPxSolverBase< R >::dualIterations(), SPxSolverBase< R >::primalIterations(), and SPxSolverBase< R >::statistics().

◆ lbBound() [1/2]

template<class R >
VectorBase< R > & 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 1478 of file spxsolver.h.

References SPxSolverBase< R >::theLBbound.

◆ lbBound() [2/2]

template<class R >
const VectorBase< R > & lbBound ( ) const

lower bound for fVec.

Definition at line 1465 of file spxsolver.h.

References SPxSolverBase< R >::theLBbound.

◆ lcBound() [1/2]

template<class R >
VectorBase< R > & 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 1558 of file spxsolver.h.

References SPxSolverBase< R >::LEAVE, SPxSolverBase< R >::theCoLbound, and SPxSolverBase< R >::theType.

◆ lcBound() [2/2]

template<class R >
const VectorBase< R > & lcBound ( ) const

◆ leave()

template<class R >
bool leave ( int i,
bool polish = false )
private

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

Returns
false if LP is unbounded/infeasible.

◆ leavetol()

template<class R >
R leavetol ( ) const

feasibility tolerance maintained by ratio test during LEAVE algorithm.

Definition at line 863 of file spxsolver.h.

References SPxSolverBase< R >::COLUMN, SPxSolverBase< R >::leavetolscale, SPxSolverBase< R >::theRep, and SPxSolverBase< R >::tolerances().

◆ loadBasis()

template<class R >
virtual void loadBasis ( const typename SPxBasisBase< R >::Desc & )
virtual

set a start basis.

◆ loadLP()

template<class R >
virtual void loadLP ( const SPxLPBase< R > & LP,
bool initSlackBasis = true )
virtual

copy LP.

◆ localAddCols()

template<class R >
void localAddCols ( int start)
private

◆ localAddRows()

template<class R >
void localAddRows ( int start)
private

◆ lpBound() [1/2]

template<class R >
VectorBase< R > & 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 1624 of file spxsolver.h.

References SPxSolverBase< R >::LEAVE, SPxSolverBase< R >::theLbound, and SPxSolverBase< R >::theType.

◆ lpBound() [2/2]

template<class R >
const VectorBase< R > & lpBound ( ) const

◆ maxCycle()

template<class R >
int maxCycle ( ) const

maximum number of degenerate simplex steps before we detect cycling.

SPxSolverBase 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, SPxSolverBase 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 975 of file spxsolver.h.

References SPxSolverBase< R >::m_maxCycle.

◆ maxInfeas()

template<class R >
virtual R 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.

◆ nonbasicValue()

template<class R >
R nonbasicValue ( )
protected

Compute part of objective value.

This method is called from value() in order to compute the part of the objective value resulting form nonbasic variables for COLUMN Representation.

◆ noViols()

template<class R >
virtual bool noViols ( R tol) const
virtual

check for violations above tol and immediately return false w/o checking the remaining values

This method is useful for verifying whether an objective limit can be used as termination criterion

◆ numCycle()

template<class R >
int numCycle ( ) const

actual number of degenerate simplex steps encountered so far.

Definition at line 980 of file spxsolver.h.

References SPxSolverBase< R >::m_numCycle.

◆ objValue()

template<class R >
virtual R objValue ( )
virtual

get objective value of current solution.

Definition at line 2109 of file spxsolver.h.

References SPxSolverBase< R >::value().

◆ operator=()

template<class R >
SPxSolverBase< R > & operator= ( const SPxSolverBase< R > & base)

assignment operator

assignment operator and copy constructor

◆ performSolutionPolishing()

template<class R >
bool performSolutionPolishing ( )

Identify primal basic variables that have zero reduced costs and try to pivot them out of the basis to make them tight. This is supposed to decrease the number of fractional variables when solving LP relaxations of (mixed) integer programs. The objective must not be modified during this procedure.

Returns
true, if objective was modified (due to numerics) and resolving is necessary

◆ perturbMax() [1/2]

template<class R >
R perturbMax ( const UpdateVector< R > & uvec,
VectorBase< R > & low,
VectorBase< R > & up,
R eps,
R delta,
const typename SPxBasisBase< R >::Desc::Status * stat,
int start,
int incr )
private

◆ perturbMax() [2/2]

template<class R >
void perturbMax ( const UpdateVector< R > & vec,
VectorBase< R > & low,
VectorBase< R > & up,
R eps,
R delta,
int start = 0,
int incr = 1 )
private

◆ perturbMaxEnter()

template<class R >
virtual void perturbMaxEnter ( void )
protectedvirtual

perturb basis bounds.

◆ perturbMaxLeave()

template<class R >
virtual void perturbMaxLeave ( void )
protectedvirtual

perturb nonbasic bounds.

◆ perturbMin() [1/2]

template<class R >
R perturbMin ( const UpdateVector< R > & uvec,
VectorBase< R > & low,
VectorBase< R > & up,
R eps,
R delta,
const typename SPxBasisBase< R >::Desc::Status * stat,
int start,
int incr )
private

◆ perturbMin() [2/2]

template<class R >
void perturbMin ( const UpdateVector< R > & vec,
VectorBase< R > & low,
VectorBase< R > & up,
R eps,
R delta,
int start = 0,
int incr = 1 )
private

◆ perturbMinEnter()

template<class R >
virtual void perturbMinEnter ( void )
protectedvirtual

◆ perturbMinLeave()

template<class R >
virtual void perturbMinLeave ( void )
protectedvirtual

◆ polishIterations()

template<class R >
int polishIterations ( )

return number of iterations done with primal algorithm

Definition at line 2244 of file spxsolver.h.

References SPxSolverBase< R >::polishCount.

◆ precisionReached()

template<class R >
virtual bool precisionReached ( R & newpricertol) const
protectedvirtual

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

◆ pricer()

template<class R >
const SPxPricer< R > * pricer ( ) const

return loaded SPxPricer.

Definition at line 1877 of file spxsolver.h.

References SPxSolverBase< R >::thepricer.

◆ pricing()

template<class R >
Pricing pricing ( ) const

return current Pricing.

Definition at line 556 of file spxsolver.h.

References SPxSolverBase< R >::thePricing.

◆ primalDegeneratePivots()

template<class R >
int primalDegeneratePivots ( )

get number of primal degenerate pivots

Definition at line 2207 of file spxsolver.h.

References SPxSolverBase< R >::enterCycles, SPxSolverBase< R >::leaveCycles, SPxSolverBase< R >::rep(), and SPxSolverBase< R >::ROW.

◆ primalIterations()

template<class R >
int primalIterations ( )

return number of iterations done with primal algorithm

Definition at line 2231 of file spxsolver.h.

References SPxSolverBase< R >::iterations(), and SPxSolverBase< R >::primalCount.

Referenced by SPxSolverBase< R >::dualIterations().

◆ printDisplayLine()

template<class R >
virtual void printDisplayLine ( const bool force = false,
const bool forceHead = false )
virtual

print display line of flying table

◆ pVec()

template<class R >
UpdateVector< R > & pVec ( ) const

pricing vector.

The pricing vector pVec is the product of coPvec with the constraint matrix. As coPvec, also pVec is maintained within its bound for the leaving Simplex algorithm, while the bounds are tested for the entering Simplex. pVec is of dimension coDim(). Vector pVec() is only up to date for LEAVEing Simplex or FULL pricing in ENTERing Simplex.

Definition at line 1584 of file spxsolver.h.

References SPxSolverBase< R >::thePvec.

◆ qualBoundViolation()

template<class R >
virtual void qualBoundViolation ( R & maxviol,
R & sumviol ) const
virtual

get violations of bounds.

◆ qualConstraintViolation()

template<class R >
virtual void qualConstraintViolation ( R & maxviol,
R & sumviol ) const
virtual

get violation of constraints.

◆ qualRedCostViolation()

template<class R >
virtual void qualRedCostViolation ( R & maxviol,
R & sumviol ) const
virtual

get violation of optimality criterion.

◆ qualSlackViolation()

template<class R >
virtual void qualSlackViolation ( R & maxviol,
R & sumviol ) const
virtual

get the residuum |Ax-b|.

◆ ratiotester()

template<class R >
const SPxRatioTester< R > * ratiotester ( ) const

return loaded SPxRatioTester.

Definition at line 1887 of file spxsolver.h.

References SPxSolverBase< R >::theratiotester.

◆ read()

template<class R >
virtual bool read ( std::istream & in,
NameSet * rowNames = nullptr,
NameSet * colNames = nullptr,
DIdxSet * intVars = nullptr )
virtual

read LP from input stream.

Reimplemented from SPxLPBase< R >.

◆ readBasisFile()

template<class R >
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 nullptr, default names are used for the constraints and variables.

◆ reDim()

template<class R >
virtual void reDim ( )
protectedvirtual

reset dimensions of vectors according to loaded LP.

◆ reinitializeVecs()

template<class R >
virtual void reinitializeVecs ( )
protectedvirtual

setup all vecs fresh

◆ rejectEnter()

template<class R >
virtual void rejectEnter ( SPxId enterId,
R enterTest,
typename SPxBasisBase< R >::Desc::Status enterStat )
protectedvirtual

◆ rejectLeave()

template<class R >
virtual void rejectLeave ( int leaveNum,
SPxId leaveId,
typename SPxBasisBase< R >::Desc::Status leaveStat,
const SVectorBase< R > * newVec = nullptr )
protectedvirtual

◆ reLoad()

template<class R >
virtual void reLoad ( )
virtual

reload LP.

◆ rep()

◆ resetClockStats()

template<class R >
void resetClockStats ( )
protected

resets clock average statistics

◆ resetCumulativeTime()

template<class R >
void resetCumulativeTime ( )

reset cumulative time counter to zero.

Definition at line 2189 of file spxsolver.h.

References SPxSolverBase< R >::theCumulativeTime.

◆ rowId()

template<class R >
SPxRowId rowId ( int i) const

RowId of i 'th inequality.

Mapping between numbers and Ids

Definition at line 2336 of file spxsolver.h.

References SPxLPBase< R >::rId().

◆ rows()

template<class R >
const LPRowSetBase< R > & rows ( ) const

return const lp's rows if available.

Definition at line 2278 of file spxsolver.h.

References SPxLPBase< R >::lprowset().

◆ scaleEntertol()

template<class R >
void scaleEntertol ( R d)

scale the entering tolerance

Definition at line 871 of file spxsolver.h.

Referenced by SPxSolverBase< R >::scaleTolerances().

◆ scaleLeavetol()

template<class R >
void scaleLeavetol ( R d)

scale the leaving tolerance

Definition at line 876 of file spxsolver.h.

Referenced by SPxSolverBase< R >::scaleTolerances().

◆ scaleTolerances()

template<class R >
void scaleTolerances ( R d)

◆ sense()

template<class R >
SPxLPBase< R >::SPxSense sense ( ) const

optimization sense.

Definition at line 2313 of file spxsolver.h.

References SPxLPBase< R >::spxSense().

◆ setBasis()

template<class R >
void setBasis ( const VarStatus rows[],
const VarStatus cols[] )

set the lp solver's basis.

◆ setBasisSolver()

template<class R >
virtual void setBasisSolver ( SLinSolver< R > * slu,
const bool destroy = false )
virtual

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

◆ setBasisStatus()

template<class R >
void setBasisStatus ( typename SPxBasisBase< R >::SPxStatus stat)

set the lp solver's basis status.

Definition at line 2158 of file spxsolver.h.

References SPxSolverBase< R >::m_status, SPxSolverBase< R >::OPTIMAL, SPxBasisBase< R >::setStatus(), and SPxSolverBase< R >::UNKNOWN.

◆ setDisplayFreq()

template<class R >
void setDisplayFreq ( int freq)

set display frequency

Definition at line 915 of file spxsolver.h.

References SPxSolverBase< R >::displayFreq.

◆ setDual()

template<class R >
void setDual ( VectorBase< R > & p_vector)
private

◆ setDualColBounds()

template<class R >
void setDualColBounds ( )
protected

◆ setDualNorms()

template<class R >
bool setDualNorms ( int nnormsRow,
int nnormsCol,
R * norms )

set dual norms

◆ setDualRowBounds()

template<class R >
void setDualRowBounds ( )
protected

◆ setEnterBound4Col()

template<class R >
void setEnterBound4Col ( int ,
int  )
protected

◆ setEnterBound4Row()

template<class R >
void setEnterBound4Row ( int ,
int  )
protected

◆ setEnterBounds()

template<class R >
virtual void setEnterBounds ( )
protectedvirtual

◆ setFillFactor()

template<class R >
void setFillFactor ( R f)

set refactor threshold for fill-in in current factor update compared to fill-in in last factorization

Definition at line 520 of file spxsolver.h.

◆ setIntegralityInformation()

template<class R >
void setIntegralityInformation ( int ncols,
int * intInfo )

pass integrality information about the variables to the solver

◆ setLeaveBound4Col()

template<class R >
void setLeaveBound4Col ( int i,
int n )
protected

◆ setLeaveBound4Row()

template<class R >
void setLeaveBound4Row ( int i,
int n )
protected

◆ setLeaveBounds()

template<class R >
virtual void setLeaveBounds ( )
protectedvirtual

◆ setMemFactor()

template<class R >
void setMemFactor ( R f)

set refactor threshold for memory growth in current factor update compared to the last factorization

Definition at line 526 of file spxsolver.h.

◆ setMetricInformation()

template<class R >
void setMetricInformation ( int type)

print basis metric within the usual output

Definition at line 927 of file spxsolver.h.

References SPxSolverBase< R >::printBasisMetric, and SPxSolverBase< R >::type().

◆ setNonzeroFactor()

template<class R >
void setNonzeroFactor ( R f)

set refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix

Definition at line 514 of file spxsolver.h.

◆ setOutstream()

template<class R >
void setOutstream ( SPxOut & newOutstream)

Definition at line 486 of file spxsolver.h.

References SPxSolverBase< R >::spxout.

◆ setPricer()

template<class R >
virtual void setPricer ( SPxPricer< R > * pricer,
const bool destroy = false )
virtual

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

◆ setPricing()

template<class R >
void setPricing ( Pricing pr)

set FULL or PARTIAL pricing.

◆ setPrimal()

template<class R >
void setPrimal ( VectorBase< R > & p_vector)
private

◆ setPrimalBounds()

template<class R >
void setPrimalBounds ( )
protected

setup feasibility bounds for entering algorithm

◆ setRedCost()

template<class R >
void setRedCost ( VectorBase< R > & p_vector)
private

◆ setRep()

template<class R >
void setRep ( Representation p_rep)

switch to ROW or COLUMN representation if not already used.

◆ setSlacks()

template<class R >
void setSlacks ( VectorBase< R > & p_vector)
private

◆ setSolutionPolishing()

template<class R >
void setSolutionPolishing ( SolutionPolish _polishObj)

set objective of solution polishing (0: off, 1: max_basic_slack, 2: min_basic_slack)

Definition at line 687 of file spxsolver.h.

References SPxSolverBase< R >::polishObj.

◆ setSolverStatus()

template<class R >
void setSolverStatus ( typename SPxSolverBase< R >::Status stat)

setting the solver status external from the solve loop.

Definition at line 2167 of file spxsolver.h.

References SPxSolverBase< R >::m_status.

◆ setSolvingForBoosted()

template<class R >
void setSolvingForBoosted ( bool value)

◆ setSparsePricingFactor()

template<class R >
void setSparsePricingFactor ( R fac)

Definition at line 933 of file spxsolver.h.

References SPxSolverBase< R >::sparsePricingFactor.

◆ setStarter()

template<class R >
virtual void setStarter ( SPxStarter< R > * starter,
const bool destroy = false )
virtual

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

◆ setStoreBasisFreqForBoosting()

template<class R >
void setStoreBasisFreqForBoosting ( int freq)

Definition at line 959 of file spxsolver.h.

References SPxSolverBase< R >::storeBasisSimplexFreq.

◆ setTerminationIter()

template<class R >
virtual void setTerminationIter ( int iteration = -1)
virtual

set iteration limit.

◆ setTerminationTime()

template<class R >
virtual void setTerminationTime ( Real time = infinity)
virtual

set time limit.

Limits and status inquiry

◆ setTerminationValue()

template<class R >
virtual void setTerminationValue ( R value = R(infinity))
virtual

set objective limit.

◆ setTester()

template<class R >
virtual void setTester ( SPxRatioTester< R > * tester,
const bool destroy = false )
virtual

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

◆ setTiming()

◆ setTolerances()

template<class R >
virtual void setTolerances ( std::shared_ptr< Tolerances > newTolerances)
virtual

set the _tolerances member variable

Reimplemented from SPxLPBase< R >.

Definition at line 493 of file spxsolver.h.

References SPxLPBase< R >::_tolerances, and UpdateVector< R >::setTolerances().

◆ setType()

template<class R >
void setType ( Type tp)

set LEAVE or ENTER algorithm.

◆ setup4coSolve()

template<class R >
void setup4coSolve ( SSVectorBase< R > * p_y,
SSVectorBase< R > * 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 SPxSolverBase'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 1828 of file spxsolver.h.

References SPxSolverBase< R >::coSolveVector2, SPxSolverBase< R >::coSolveVector2rhs, SPxSolverBase< R >::ENTER, and SPxSolverBase< R >::type().

◆ setup4coSolve2()

template<class R >
void setup4coSolve2 ( SSVectorBase< R > * p_z,
SSVectorBase< R > * 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 SPxSolverBase's call to SPxRatioTester. The system will be solved along with two other systems.

Definition at line 1840 of file spxsolver.h.

References SPxSolverBase< R >::coSolveVector3, SPxSolverBase< R >::coSolveVector3rhs, SPxSolverBase< R >::ENTER, and SPxSolverBase< R >::type().

◆ setup4solve()

template<class R >
void setup4solve ( SSVectorBase< R > * p_y,
SSVectorBase< R > * 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 SPxSolverBase'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 1800 of file spxsolver.h.

References SPxSolverBase< R >::LEAVE, SPxSolverBase< R >::solveVector2, SPxSolverBase< R >::solveVector2rhs, and SPxSolverBase< R >::type().

◆ setup4solve2()

template<class R >
void setup4solve2 ( SSVectorBase< R > * p_y2,
SSVectorBase< R > * 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 SPxSolverBase'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 1814 of file spxsolver.h.

References SPxSolverBase< R >::LEAVE, SPxSolverBase< R >::solveVector3, SPxSolverBase< R >::solveVector3rhs, and SPxSolverBase< R >::type().

◆ setupPupdate()

template<class R >
virtual void setupPupdate ( void )
protectedvirtual

◆ shift()

template<class R >
virtual R shift ( ) const
virtual

total current shift amount.

Definition at line 1733 of file spxsolver.h.

References SPxSolverBase< R >::theShift.

◆ shiftFvec()

template<class R >
void shiftFvec ( )

Perform initial shifting to optain an feasible or pricable basis.

◆ shiftLBbound()

template<class R >
void shiftLBbound ( int i,
R to )

◆ shiftLCbound()

template<class R >
void shiftLCbound ( int i,
R to )

◆ shiftLPbound()

template<class R >
void shiftLPbound ( int i,
R to )

◆ shiftPvec()

template<class R >
void shiftPvec ( )

Perform initial shifting to optain an feasible or pricable basis.

◆ shiftUBbound()

template<class R >
void shiftUBbound ( int i,
R to )

◆ shiftUCbound()

template<class R >
void shiftUCbound ( int i,
R to )

◆ shiftUPbound()

template<class R >
void shiftUPbound ( int i,
R to )

◆ slinSolver()

template<class R >
const SLinSolver< R > * slinSolver ( ) const

return loaded SLinSolver.

Definition at line 1882 of file spxsolver.h.

◆ solve()

template<class R >
virtual Status solve ( volatile bool * interrupt = nullptr,
bool polish = true )
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.

Parameters
interruptcan be set externally to interrupt the solve
polishshould solution polishing be considered
Exceptions
SPxStatusExceptionif either no problem, solver, pricer or ratiotester loaded or if solve is still running when it shouldn't be

◆ starter()

template<class R >
SPxStarter< R > * starter ( ) const

return current starter.

Definition at line 562 of file spxsolver.h.

References SPxSolverBase< R >::thestarter.

◆ statistics()

template<class R >
std::string statistics ( ) const

returns statistical information in form of a string.

Definition at line 2319 of file spxsolver.h.

References SPxSolverBase< R >::basis(), SPxSolverBase< R >::iterations(), and SPxSolverBase< R >::time().

◆ status()

template<class R >
Status status ( ) const

Status of solution process.

Referenced by SPxSolverBase< R >::isBasic().

◆ subversion()

template<class R >
int subversion ( ) const

return the internal subversion of SPxSolverBase as number

Definition at line 539 of file spxsolver.h.

References SOPLEX_SUBVERSION.

◆ sumDualDegeneracy()

template<class R >
R sumDualDegeneracy ( )

get the sum of dual degeneracy

Definition at line 2213 of file spxsolver.h.

References SPxSolverBase< R >::dualDegenSum.

◆ sumPrimalDegeneracy()

template<class R >
R sumPrimalDegeneracy ( )

get the sum of primal degeneracy

Definition at line 2219 of file spxsolver.h.

References SPxSolverBase< R >::primalDegenSum.

◆ terminate()

template<class R >
virtual 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 SPxSolverBase<R>::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).

◆ terminationIter()

template<class R >
virtual int terminationIter ( ) const
virtual

return iteration limit.

◆ terminationTime()

template<class R >
virtual Real terminationTime ( ) const
virtual

return time limit.

◆ terminationValue()

template<class R >
virtual R terminationValue ( ) const
virtual

return objective limit.

◆ test() [1/2]

template<class R >
const VectorBase< R > & test ( ) const

Violations of pVec.

In entering Simplex pricing selects checks vectors coPvec() and pVec() for violation of its bounds. Vector test() contains the violations for pVec(), i.e., if test()[i] < 0, the i'th element of pVec() is violated by test()[i]. Vector test() is only up to date for FULL pricing.

Definition at line 1637 of file spxsolver.h.

References SPxSolverBase< R >::ENTER, SPxSolverBase< R >::theTest, and SPxSolverBase< R >::type().

◆ test() [2/2]

template<class R >
R test ( int i,
typename SPxBasisBase< R >::Desc::Status stat ) const
private

test VectorBase<R> i with status stat.

◆ testBounds()

template<class R >
void testBounds ( ) const

◆ testVecs()

template<class R >
void testVecs ( )

◆ time()

template<class R >
Real time ( ) const

time spent in last call to method solve().

Definition at line 2250 of file spxsolver.h.

References SPxSolverBase< R >::theTime, and Timer::time().

Referenced by SPxSolverBase< R >::statistics().

◆ toggleTerminationValue()

template<class R >
void toggleTerminationValue ( bool enable)

toggle objective limit for next solve

Definition at line 705 of file spxsolver.h.

References SPxSolverBase< R >::useTerminationValue.

◆ tolerances()

template<class R >
const std::shared_ptr< Tolerances > & tolerances ( ) const

◆ type()

◆ ubBound() [1/2]

template<class R >
VectorBase< R > & 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 1460 of file spxsolver.h.

References SPxSolverBase< R >::theUBbound.

◆ ubBound() [2/2]

template<class R >
const VectorBase< R > & ubBound ( ) const

upper bound for fVec.

Definition at line 1447 of file spxsolver.h.

References SPxSolverBase< R >::theUBbound.

◆ ucBound() [1/2]

template<class R >
VectorBase< R > & 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 1537 of file spxsolver.h.

References SPxSolverBase< R >::LEAVE, SPxSolverBase< R >::theCoUbound, and SPxSolverBase< R >::theType.

◆ ucBound() [2/2]

template<class R >
const VectorBase< R > & ucBound ( ) const

◆ ungetEnterVal()

template<class R >
virtual void ungetEnterVal ( SPxId enterId,
typename SPxBasisBase< R >::Desc::Status enterStat,
R leaveVal,
const SVectorBase< R > & vec,
StableSum< R > & objChange )
protectedvirtual

◆ unInit()

template<class R >
virtual void unInit ( )
protectedvirtual

uninitialize data structures.

Definition at line 1965 of file spxsolver.h.

References SPxSolverBase< R >::initialized.

Referenced by SPxSolverBase< R >::clearRowObjs().

◆ unitVector()

template<class R >
const SVectorBase< R > & unitVector ( int i) const

return i 'th unit vector.

Definition at line 1342 of file spxsolver.h.

References SPxSolverBase< R >::unitVecs.

◆ unscaleLPandReloadBasis()

template<class R >
void unscaleLPandReloadBasis ( )

unscales the LP and reloads the basis

◆ unShift()

template<class R >
virtual void unShift ( void )
virtual

remove shift as much as possible.

◆ upBound() [1/2]

template<class R >
VectorBase< R > & 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 1603 of file spxsolver.h.

References SPxSolverBase< R >::LEAVE, SPxSolverBase< R >::theType, and SPxSolverBase< R >::theUbound.

◆ upBound() [2/2]

template<class R >
const VectorBase< R > & upBound ( ) const

◆ updateCoTest()

template<class R >
void updateCoTest ( )
private

recompute coTest vector.

◆ updateFtest()

template<class R >
void updateFtest ( )
private

update basis feasibility test vector.

◆ updateNonbasicValue()

template<class R >
bool updateNonbasicValue ( R objChange)
Returns
whether nonbasic part of objective is reliable

◆ updateTest()

template<class R >
void updateTest ( )
private

recompute test vector.

◆ useFullPerturbation()

template<class R >
void useFullPerturbation ( bool full)

perturb entire problem or only the bounds relevant to the current pivot

Definition at line 986 of file spxsolver.h.

References SPxSolverBase< R >::fullPerturbation.

◆ value()

template<class R >
virtual R value ( )
virtual

current objective value.

Returns
Objective value of the current solution vector (see getPrimalSol()).

Referenced by SPxSolverBase< R >::objValue(), and SPxSolverBase< R >::setSolvingForBoosted().

◆ varStatus()

template<class R >
SPxBasisBase< R >::Desc::Status varStatus ( int i) const

Status of i 'th variable.

Definition at line 1357 of file spxsolver.h.

References SPxBasisBase< R >::desc(), and SPxBasisBase< R >::Desc::status().

◆ varStatusToBasisStatusCol()

template<class R >
SPxBasisBase< R >::Desc::Status varStatusToBasisStatusCol ( int col,
VarStatus stat ) const
protected

converts VarStatus to basis status for columns

◆ varStatusToBasisStatusRow()

template<class R >
SPxBasisBase< R >::Desc::Status varStatusToBasisStatusRow ( int row,
VarStatus stat ) const
protected

converts VarStatus to basis status for rows

◆ vector() [1/4]

template<class R >
const SVectorBase< R > & vector ( const SPxColId & cid) const

◆ vector() [2/4]

template<class R >
const SVectorBase< R > & vector ( const SPxId & p_id) const

VectorBase<R> associated to p_id.

Returns
Returns a reference to the VectorBase<R> 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 1294 of file spxsolver.h.

References SPxId::isSPxRowId(), SPxId::isValid(), and SPxSolverBase< R >::vector().

◆ vector() [3/4]

template<class R >
const SVectorBase< R > & vector ( const SPxRowId & rid) const

◆ vector() [4/4]

template<class R >
const SVectorBase< R > & vector ( int i) const

i 'th vector.

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

Definition at line 1263 of file spxsolver.h.

References SPxSolverBase< R >::thevectors.

Referenced by SPxSolverBase< R >::enterVector(), and SPxSolverBase< R >::vector().

◆ version()

template<class R >
int version ( ) const

return the version of SPxSolverBase as number like 123 for 1.2.3

Definition at line 534 of file spxsolver.h.

References SOPLEX_VERSION.

◆ writeBasisFile()

template<class R >
virtual 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 nullptr, default names are used for the constraints and variables.

◆ writeState()

template<class R >
virtual bool writeState ( const char * filename,
const NameSet * rowNames = nullptr,
const NameSet * colNames = nullptr,
const bool cpxFormat = false,
const bool writeZeroObjective = 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 nullptr, default names are used for the constraints and variables.

Member Data Documentation

◆ addVec

template<class R >
UpdateVector<R> addVec
protected

storage for thePvec = &addVec

Definition at line 351 of file spxsolver.h.

◆ boundflips

template<class R >
int boundflips
protected

number of performed bound flips

Definition at line 399 of file spxsolver.h.

◆ boundrange

template<class R >
R boundrange
protected

absolute range of all bounds in the problem

Definition at line 413 of file spxsolver.h.

◆ coSolveVector2

template<class R >
SSVectorBase<R>* coSolveVector2
private

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

Definition at line 290 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4coSolve().

◆ coSolveVector2rhs

template<class R >
SSVectorBase<R>* coSolveVector2rhs
private

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

Definition at line 292 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4coSolve().

◆ coSolveVector3

template<class R >
SSVectorBase<R>* 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 294 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4coSolve2().

◆ coSolveVector3rhs

template<class R >
SSVectorBase<R>* 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 296 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4coSolve2().

◆ coWeights

template<class R >
VectorBase<R> coWeights

store dual norms

Definition at line 467 of file spxsolver.h.

◆ displayFreq

template<class R >
int displayFreq
private

◆ displayLine

template<class R >
int displayLine
private

Definition at line 319 of file spxsolver.h.

◆ dualDegenSum

template<class R >
R dualDegenSum
protected

the sum of the dual degeneracy percentage

Definition at line 407 of file spxsolver.h.

Referenced by SPxSolverBase< R >::sumDualDegeneracy().

◆ dualFarkas

template<class R >
DSVectorBase<R> dualFarkas
protected

stores dual farkas proof in case of infeasibility

Definition at line 392 of file spxsolver.h.

◆ dualRhs

template<class R >
VectorBase<R> dualRhs
protected

rhs VectorBase<R> for computing the dual vector

Definition at line 349 of file spxsolver.h.

◆ dualVec

template<class R >
UpdateVector<R> dualVec
protected

dual vector

Definition at line 350 of file spxsolver.h.

◆ enterCount

template<class R >
int enterCount
protected

number of ENTER iterations

Definition at line 395 of file spxsolver.h.

◆ enterCycles

template<class R >
int enterCycles
protected

the number of degenerate steps during the entering algorithm

Definition at line 402 of file spxsolver.h.

Referenced by SPxSolverBase< R >::dualDegeneratePivots(), and SPxSolverBase< R >::primalDegeneratePivots().

◆ enterDegenCand

template<class R >
int enterDegenCand
protected

the number of degenerate candidates in the entering algorithm

Definition at line 404 of file spxsolver.h.

◆ entertolscale

template<class R >
R entertolscale
private

factor to temporarily decrease the entering tolerance

Definition at line 273 of file spxsolver.h.

Referenced by SPxSolverBase< R >::entertol().

◆ freePricer

template<class R >
bool freePricer
private

true iff thepricer should be freed inside of object

Definition at line 298 of file spxsolver.h.

◆ freeRatioTester

template<class R >
bool freeRatioTester
private

true iff theratiotester should be freed inside of object

Definition at line 299 of file spxsolver.h.

◆ freeStarter

template<class R >
bool freeStarter
private

true iff thestarter should be freed inside of object

Definition at line 300 of file spxsolver.h.

◆ fullPerturbation

template<class R >
bool fullPerturbation
private

whether to perturb the entire problem or just the bounds relevant for the current pivot

Definition at line 332 of file spxsolver.h.

Referenced by SPxSolverBase< R >::useFullPerturbation().

◆ hyperPricingEnter

template<class R >
bool hyperPricingEnter

true if hyper sparse pricing is turned on in the entering Simplex

Definition at line 459 of file spxsolver.h.

◆ hyperPricingLeave

template<class R >
bool hyperPricingLeave

true if hyper sparse pricing is turned on in the leaving Simplex

Definition at line 458 of file spxsolver.h.

◆ infeasibilities

template<class R >
DIdxSet infeasibilities

For the leaving Simplex algorithm this vector contains the indices of infeasible basic variables; for the entering Simplex algorithm this vector contains the indices of infeasible slack variables.

Definition at line 436 of file spxsolver.h.

◆ infeasibilitiesCo

template<class R >
DIdxSet infeasibilitiesCo

For the entering Simplex algorithm these vectors contains the indices of infeasible basic variables.

Definition at line 439 of file spxsolver.h.

◆ initialized

template<class R >
bool initialized
private

true, if all vectors are setup.

Definition at line 279 of file spxsolver.h.

Referenced by SPxSolverBase< R >::isInitialized(), and SPxSolverBase< R >::unInit().

◆ instableEnter

template<class R >
bool instableEnter
private

Definition at line 313 of file spxsolver.h.

◆ instableEnterId

template<class R >
SPxId instableEnterId
private

Definition at line 312 of file spxsolver.h.

◆ instableEnterVal

template<class R >
R instableEnterVal
private

Definition at line 314 of file spxsolver.h.

◆ instableLeave

template<class R >
bool instableLeave
private

Definition at line 306 of file spxsolver.h.

◆ instableLeaveNum

template<class R >
int instableLeaveNum
private

Definition at line 305 of file spxsolver.h.

◆ instableLeaveVal

template<class R >
R instableLeaveVal
private

Definition at line 307 of file spxsolver.h.

◆ integerVariables

template<class R >
DataArray<int> integerVariables

supplementary variable information, 0: continous variable, 1: integer variable

Definition at line 483 of file spxsolver.h.

◆ isInfeasible

template<class R >
DataArray<int> isInfeasible

0: index not violated, 1: index violated, 2: index violated and among candidate list

Binary vectors to store whether basic indices are infeasible the i-th entry equals false, if the i-th basic variable is not infeasible the i-th entry equals true, if the i-th basic variable is infeasible

Definition at line 450 of file spxsolver.h.

◆ isInfeasibleCo

template<class R >
DataArray<int> isInfeasibleCo

0: index not violated, 1: index violated, 2: index violated and among candidate list

Definition at line 452 of file spxsolver.h.

◆ lastShift

template<class R >
R lastShift
private

for forcing feasibility.

Definition at line 276 of file spxsolver.h.

◆ leaveCount

template<class R >
int leaveCount
protected

number of LEAVE iterations

Definition at line 394 of file spxsolver.h.

◆ leaveCycles

template<class R >
int leaveCycles
protected

the number of degenerate steps during the leaving algorithm

Definition at line 403 of file spxsolver.h.

Referenced by SPxSolverBase< R >::dualDegeneratePivots(), and SPxSolverBase< R >::primalDegeneratePivots().

◆ leaveDegenCand

template<class R >
int leaveDegenCand
protected

the number of degenerate candidates in the leaving algorithm

Definition at line 405 of file spxsolver.h.

◆ leavetolscale

template<class R >
R leavetolscale
private

factor to temporarily decrease the leaving tolerance

Definition at line 274 of file spxsolver.h.

Referenced by SPxSolverBase< R >::leavetol().

◆ m_maxCycle

template<class R >
int m_maxCycle
private

maximum steps before cycling is detected.

Definition at line 277 of file spxsolver.h.

Referenced by SPxSolverBase< R >::maxCycle().

◆ m_nonbasicValue

template<class R >
R m_nonbasicValue
private

nonbasic part of current objective value

Definition at line 262 of file spxsolver.h.

Referenced by SPxSolverBase< R >::forceRecompNonbasicValue().

◆ m_nonbasicValueUpToDate

template<class R >
bool m_nonbasicValueUpToDate
private

true, if the stored objValue is up to date

Definition at line 263 of file spxsolver.h.

Referenced by SPxSolverBase< R >::forceRecompNonbasicValue().

◆ m_numCycle

template<class R >
int m_numCycle
private

actual number of degenerate steps so far.

Definition at line 278 of file spxsolver.h.

Referenced by SPxSolverBase< R >::numCycle().

◆ m_numViol

template<class R >
int m_numViol
private

number of violations of current solution

Definition at line 271 of file spxsolver.h.

◆ m_pricingViol

template<class R >
R m_pricingViol
private

maximal feasibility violation of current solution

Definition at line 265 of file spxsolver.h.

◆ m_pricingViolCo

template<class R >
R m_pricingViolCo
private

maximal feasibility violation of current solution in coDim

Definition at line 269 of file spxsolver.h.

◆ m_pricingViolCoUpToDate

template<class R >
bool m_pricingViolCoUpToDate
private

true, if the stored violation in coDim is up to date

Definition at line 270 of file spxsolver.h.

◆ m_pricingViolUpToDate

template<class R >
bool m_pricingViolUpToDate
private

true, if the stored violation is up to date

Definition at line 266 of file spxsolver.h.

◆ m_status

template<class R >
Status m_status
private

status of algorithm.

Definition at line 260 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setBasisStatus(), and SPxSolverBase< R >::setSolverStatus().

◆ maxIters

template<class R >
int maxIters
private

maximum allowed iterations.

Definition at line 254 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getMaxIters().

◆ maxTime

template<class R >
Real maxTime
private

maximum allowed time.

Definition at line 255 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getMaxTime().

◆ multColwiseCalls

template<class R >
int multColwiseCalls

number of products, columnwise multiplication

Definition at line 477 of file spxsolver.h.

◆ multFullCalls

template<class R >
int multFullCalls

number of products ignoring sparsity

Definition at line 476 of file spxsolver.h.

◆ multSparseCalls

template<class R >
int multSparseCalls

number of products exploiting sparsity

Definition at line 475 of file spxsolver.h.

◆ multTimeColwise

template<class R >
Timer* multTimeColwise

time spent in setupPupdate(), columnwise multiplication

Definition at line 473 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getTiming(), and SPxSolverBase< R >::setTiming().

◆ multTimeFull

template<class R >
Timer* multTimeFull

time spent in setupPupdate() ignoring sparsity

Definition at line 472 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getTiming(), and SPxSolverBase< R >::setTiming().

◆ multTimeSparse

template<class R >
Timer* multTimeSparse

time spent in setupPupdate() exploiting sparsity

Definition at line 471 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getTiming(), and SPxSolverBase< R >::setTiming().

◆ multTimeUnsetup

template<class R >
Timer* multTimeUnsetup

time spent in setupPupdate() w/o sparsity information

Definition at line 474 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getTiming(), and SPxSolverBase< R >::setTiming().

◆ multUnsetupCalls

template<class R >
int multUnsetupCalls

number of products w/o sparsity information

Definition at line 478 of file spxsolver.h.

◆ nCallsToTimelim

template<class R >
long nCallsToTimelim
private

Definition at line 257 of file spxsolver.h.

◆ nClckSkipsLeft

template<class R >
int nClckSkipsLeft
private

remaining number of times the clock can be safely skipped

Definition at line 256 of file spxsolver.h.

◆ objLimit

template<class R >
R objLimit
private

< the number of calls to the method isTimeLimitReached()

objective value limit.

Definition at line 258 of file spxsolver.h.

◆ objrange

template<class R >
R objrange
protected

absolute range of all objective coefficients in the problem

Definition at line 415 of file spxsolver.h.

◆ oldBasisStatusCols

template<class R >
DataArray<VarStatus> oldBasisStatusCols
private

They don't have setters because only the internal simplex method is meant to fill them.

Definition at line 325 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getOldBasisStatusCols().

◆ oldBasisStatusRows

template<class R >
DataArray<VarStatus> oldBasisStatusRows
private

stored stable basis met before a simplex pivot (used to warm start the solver)

Definition at line 323 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getOldBasisStatusRows().

◆ polishCount

template<class R >
int polishCount
protected

number of solution polishing iterations

Definition at line 397 of file spxsolver.h.

Referenced by SPxSolverBase< R >::polishIterations().

◆ polishObj

template<class R >
SolutionPolish polishObj
private

objective of solution polishing

Definition at line 250 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getSolutionPolishing(), and SPxSolverBase< R >::setSolutionPolishing().

◆ primalCount

template<class R >
int primalCount
protected

number of primal iterations

Definition at line 396 of file spxsolver.h.

Referenced by SPxSolverBase< R >::primalIterations().

◆ primalDegenSum

template<class R >
R primalDegenSum
protected

the sum of the primal degeneracy percentage

Definition at line 406 of file spxsolver.h.

Referenced by SPxSolverBase< R >::sumPrimalDegeneracy().

◆ primalRay

template<class R >
DSVectorBase<R> primalRay
protected

stores primal ray in case of unboundedness

Definition at line 391 of file spxsolver.h.

◆ primRhs

template<class R >
VectorBase<R> primRhs
protected

rhs VectorBase<R> for computing the primal vector

Definition at line 347 of file spxsolver.h.

◆ primVec

template<class R >
UpdateVector<R> primVec
protected

primal vector

Definition at line 348 of file spxsolver.h.

◆ printBasisMetric

template<class R >
int printBasisMetric
private

printing the current basis metric in the log (-1: off, 0: condition estimate, 1: trace, 2: determinant, 3: condition)

Definition at line 334 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setMetricInformation().

◆ random

template<class R >
Random random

The random number generator used throughout the whole computation. Its seed can be modified.

Definition at line 431 of file spxsolver.h.

◆ recomputedVectors

template<class R >
bool recomputedVectors
private

flag to perform clean up step to reduce numerical errors only once

Definition at line 317 of file spxsolver.h.

◆ remainingRoundsEnter

template<class R >
int remainingRoundsEnter

Definition at line 462 of file spxsolver.h.

◆ remainingRoundsEnterCo

template<class R >
int remainingRoundsEnterCo

Definition at line 463 of file spxsolver.h.

◆ remainingRoundsLeave

template<class R >
int remainingRoundsLeave

number of dense rounds/refactorizations until sparsePricing is enabled again

Definition at line 461 of file spxsolver.h.

◆ siderange

template<class R >
R siderange
protected

absolute range of all side in the problem

Definition at line 414 of file spxsolver.h.

◆ solveVector2

template<class R >
SSVectorBase<R>* solveVector2
private

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

Definition at line 282 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4solve().

◆ solveVector2rhs

template<class R >
SSVectorBase<R>* solveVector2rhs
private

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

Definition at line 284 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4solve().

◆ solveVector3

template<class R >
SSVectorBase<R>* 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 286 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4solve2().

◆ solveVector3rhs

template<class R >
SSVectorBase<R>* 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 288 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setup4solve2().

◆ solvingForBoosted

template<class R >
bool solvingForBoosted
private

is this solver involved in a higher precision solving scheme?

Definition at line 328 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setSolvingForBoosted().

◆ sparsePricingEnter

template<class R >
bool sparsePricingEnter

true if sparsePricing is turned on in the entering Simplex for slack variables

Definition at line 456 of file spxsolver.h.

◆ sparsePricingEnterCo

template<class R >
bool sparsePricingEnterCo

true if sparsePricing is turned on in the entering Simplex

Definition at line 457 of file spxsolver.h.

◆ sparsePricingFactor

template<class R >
R sparsePricingFactor
private

enable sparse pricing when viols < factor * dim()

Definition at line 321 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setSparsePricingFactor().

◆ sparsePricingLeave

template<class R >
bool sparsePricingLeave

These values enable or disable sparse pricing.

true if sparsePricing is turned on in the leaving Simplex

Definition at line 455 of file spxsolver.h.

◆ SPxBoundFlippingRT< R >

template<class R >
friend SPxBoundFlippingRT< R >
private

Definition at line 106 of file spxsolver.h.

◆ SPxFastRT< R >

template<class R >
friend SPxFastRT< R >
private

Definition at line 105 of file spxsolver.h.

◆ spxout

template<class R >
SPxOut* spxout

message handler

Definition at line 480 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setOutstream().

◆ storeBasisSimplexFreq

template<class R >
int storeBasisSimplexFreq
private

number of simplex pivots -1 to perform before storing stable basis

Definition at line 329 of file spxsolver.h.

Referenced by SPxSolverBase< R >::setStoreBasisFreqForBoosting().

◆ theCoLbound

template<class R >
VectorBase<R>* theCoLbound
protected

Lower bound for covars.

Definition at line 385 of file spxsolver.h.

Referenced by SPxSolverBase< R >::lcBound(), SPxSolverBase< R >::lcBound(), and SPxSolverBase< R >::shiftLCbound().

◆ theCoPrhs

template<class R >
VectorBase<R>* theCoPrhs
protected

Definition at line 372 of file spxsolver.h.

Referenced by SPxSolverBase< R >::coPrhs().

◆ theCoPvec

template<class R >
UpdateVector<R>* theCoPvec
protected

Definition at line 373 of file spxsolver.h.

Referenced by SPxSolverBase< R >::coPvec().

◆ theCoTest

template<class R >
VectorBase<R> theCoTest
protected

Definition at line 388 of file spxsolver.h.

Referenced by SPxSolverBase< R >::coTest(), and SPxSolverBase< R >::fTest().

◆ theCoUbound

template<class R >
VectorBase<R>* theCoUbound
protected

Upper bound for covars.

Definition at line 384 of file spxsolver.h.

Referenced by SPxSolverBase< R >::shiftUCbound(), SPxSolverBase< R >::ucBound(), and SPxSolverBase< R >::ucBound().

◆ thecovectors

template<class R >
const SVSetBase<R>* thecovectors
protected

the LP coVectors according to representation

Definition at line 345 of file spxsolver.h.

Referenced by SPxSolverBase< R >::coVector(), and SPxSolverBase< R >::dim().

◆ theCPvec

template<class R >
UpdateVector<R>* theCPvec
protected

column pricing vector

Definition at line 378 of file spxsolver.h.

◆ theCumulativeTime

template<class R >
Real theCumulativeTime
private

cumulative time spent in all calls to method solve()

Definition at line 253 of file spxsolver.h.

Referenced by SPxSolverBase< R >::cumulativeTime(), and SPxSolverBase< R >::resetCumulativeTime().

◆ theFrhs

template<class R >
VectorBase<R>* theFrhs
protected

The values of the rhs corresponding to the current basis.

Definition at line 367 of file spxsolver.h.

Referenced by SPxSolverBase< R >::fRhs().

◆ theFvec

template<class R >
UpdateVector<R>* theFvec
protected

The values of all basis variables.

Definition at line 369 of file spxsolver.h.

Referenced by SPxSolverBase< R >::fVec().

◆ theLBbound

template<class R >
VectorBase<R> theLBbound
protected

Lower Basic Feasibility bound.

Definition at line 364 of file spxsolver.h.

Referenced by SPxSolverBase< R >::lbBound(), SPxSolverBase< R >::lbBound(), and SPxSolverBase< R >::shiftLBbound().

◆ theLbound

template<class R >
VectorBase<R>* theLbound
protected

Lower bound for vars.

Definition at line 383 of file spxsolver.h.

Referenced by SPxSolverBase< R >::lpBound(), SPxSolverBase< R >::lpBound(), and SPxSolverBase< R >::shiftLPbound().

◆ theLCbound

template<class R >
VectorBase<R> theLCbound
protected

Lower Column Feasibility bound.

Definition at line 356 of file spxsolver.h.

◆ theLRbound

template<class R >
VectorBase<R> theLRbound
protected

Lower Row Feasibility bound.

Definition at line 354 of file spxsolver.h.

◆ thepricer

template<class R >
SPxPricer<R>* thepricer
protected

Definition at line 409 of file spxsolver.h.

Referenced by SPxSolverBase< R >::pricer().

◆ thePricing

template<class R >
Pricing thePricing
private

full or partial pricing.

Definition at line 248 of file spxsolver.h.

Referenced by SPxSolverBase< R >::pricing().

◆ thePvec

template<class R >
UpdateVector<R>* thePvec
protected

The pricing VectorBase<R>

Definition at line 375 of file spxsolver.h.

Referenced by SPxSolverBase< R >::pVec().

◆ theratiotester

template<class R >
SPxRatioTester<R>* theratiotester
protected

Definition at line 410 of file spxsolver.h.

Referenced by SPxSolverBase< R >::ratiotester().

◆ theRep

template<class R >
Representation theRep
private

◆ theRPvec

template<class R >
UpdateVector<R>* theRPvec
protected

row pricing vector

Definition at line 377 of file spxsolver.h.

◆ theShift

◆ thestarter

template<class R >
SPxStarter<R>* thestarter
protected

Definition at line 411 of file spxsolver.h.

Referenced by SPxSolverBase< R >::starter().

◆ theTest

template<class R >
VectorBase<R> theTest
protected

Definition at line 389 of file spxsolver.h.

Referenced by SPxSolverBase< R >::test().

◆ theTime

template<class R >
Timer* theTime
private

time spent in last call to method solve()

Definition at line 251 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getTiming(), SPxSolverBase< R >::setTiming(), and SPxSolverBase< R >::time().

◆ theType

◆ theUBbound

template<class R >
VectorBase<R> 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 363 of file spxsolver.h.

Referenced by SPxSolverBase< R >::shiftUBbound(), SPxSolverBase< R >::ubBound(), and SPxSolverBase< R >::ubBound().

◆ theUbound

template<class R >
VectorBase<R>* theUbound
protected

Upper bound for vars.

Definition at line 382 of file spxsolver.h.

Referenced by SPxSolverBase< R >::shiftUPbound(), SPxSolverBase< R >::upBound(), and SPxSolverBase< R >::upBound().

◆ theUCbound

template<class R >
VectorBase<R> theUCbound
protected

Upper Column Feasibility bound.

Definition at line 355 of file spxsolver.h.

◆ theURbound

template<class R >
VectorBase<R> theURbound
protected

Upper Row Feasibility bound.

Definition at line 353 of file spxsolver.h.

◆ thevectors

template<class R >
const SVSetBase<R>* thevectors
protected

the LP vectors according to representation

Definition at line 344 of file spxsolver.h.

Referenced by SPxSolverBase< R >::coDim(), and SPxSolverBase< R >::vector().

◆ timerType

template<class R >
Timer::TYPE timerType
private

type of timer (user or wallclock)

Definition at line 252 of file spxsolver.h.

Referenced by SPxSolverBase< R >::getTiming(), and SPxSolverBase< R >::setTiming().

◆ totalboundflips

template<class R >
int totalboundflips
protected

total number of bound flips

Definition at line 400 of file spxsolver.h.

Referenced by SPxSolverBase< R >::boundFlips().

◆ unitVecs

template<class R >
Array< UnitVectorBase<R> > unitVecs
protected

◆ updateViols

template<class R >
DIdxSet updateViols

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

Definition at line 442 of file spxsolver.h.

◆ updateViolsCo

template<class R >
DIdxSet updateViolsCo

Definition at line 443 of file spxsolver.h.

◆ useTerminationValue

template<class R >
bool useTerminationValue
private

true, if objective limit should be used in the next solve.

Definition at line 259 of file spxsolver.h.

Referenced by SPxSolverBase< R >::isTerminationValueEnabled(), and SPxSolverBase< R >::toggleTerminationValue().

◆ weights

template<class R >
VectorBase<R> weights

dual pricing norms

store dual norms

Definition at line 466 of file spxsolver.h.

◆ weightsAreSetup

template<class R >
bool weightsAreSetup

are the dual norms already set up?

Definition at line 468 of file spxsolver.h.