63 #define DEFAULT_RANDOM_SEED 0 // used to suppress output when the seed was not changed 408 #ifdef SOPLEX_WITH_GMP 410 void addRowRational(
const mpq_t* lhs,
const mpq_t* rowValues,
const int* rowIndices,
411 const int rowSize,
const mpq_t* rhs);
414 void addRowsRational(
const mpq_t* lhs,
const mpq_t* rowValues,
const int* rowIndices,
415 const int* rowStarts,
const int* rowLengths,
const int numRows,
const int numValues,
425 #ifdef SOPLEX_WITH_GMP 427 void addColRational(
const mpq_t* obj,
const mpq_t* lower,
const mpq_t* colValues,
428 const int* colIndices,
const int colSize,
const mpq_t* upper);
431 void addColsRational(
const mpq_t* obj,
const mpq_t* lower,
const mpq_t* colValues,
432 const int* colIndices,
const int* colStarts,
const int* colLengths,
const int numCols,
433 const int numValues,
const mpq_t* upper);
448 #ifdef SOPLEX_WITH_GMP 456 #ifdef SOPLEX_WITH_GMP 470 #ifdef SOPLEX_WITH_GMP 484 #ifdef SOPLEX_WITH_GMP 495 #ifdef SOPLEX_WITH_GMP 506 #ifdef SOPLEX_WITH_GMP 517 #ifdef SOPLEX_WITH_GMP 525 #ifdef SOPLEX_WITH_GMP 693 #ifdef SOPLEX_WITH_GMP 774 bool unscale =
true);
783 bool unscale =
true);
867 const DIdxSet* intvars = 0,
const bool unscale =
true)
const;
888 const bool cpxFormat =
false)
const;
893 const bool cpxFormat =
false)
const;
898 const NameSet* colNames = 0,
const bool cpxFormat =
false)
const;
1377 #ifdef SOPLEX_WITH_RATIONALPARAM 1382 RATIONALPARAM_COUNT = 0
1434 #ifdef SOPLEX_WITH_RATIONALPARAM 1435 static struct RationalParam
1440 std::string
name[SoPlex::RATIONALPARAM_COUNT];
1442 std::string
description[SoPlex::RATIONALPARAM_COUNT];
1446 Rational lower[SoPlex::RATIONALPARAM_COUNT];
1448 Rational upper[SoPlex::RATIONALPARAM_COUNT];
1461 #ifdef SOPLEX_WITH_RATIONALPARAM 1463 Rational _rationalParamValues[SoPlex::RATIONALPARAM_COUNT];
1487 #ifdef SOPLEX_WITH_RATIONALPARAM 1489 Rational rationalParam(
const RationalParam param)
const;
1504 #ifdef SOPLEX_WITH_RATIONALPARAM 1506 bool setRationalParam(
const RationalParam param,
const Rational value,
const bool init =
true);
1513 void resetSettings(
const bool quiet =
false,
const bool init =
true);
1519 bool saveSettingsFile(
const char* filename,
const bool onlyChanged =
false)
const;
1560 bool areLPsInSync(
const bool checkVecVals =
true,
const bool checkMatVals =
false,
1561 const bool quiet =
false)
const;
1892 void _idxToPerm(
int* idx,
int idxSize,
int* perm,
int permSize)
const;
1895 void _rangeToPerm(
int start,
int end,
int* perm,
int permSize)
const;
2085 bool acceptUnbounded,
2086 bool acceptInfeasible,
2088 bool& primalFeasible,
2098 bool& stoppedIter,
bool& error);
2182 const bool forceNoSimplifier =
false);
2190 bool& error,
bool& optimal);
2255 bool applyPreprocessing);
2263 int* nnonposind,
bool& stop);
2267 int* colsforremoval,
2268 int nnonposind,
int* ncompatind,
bool formRedProb,
bool& stop);
2275 int* ncompatboundcons,
2276 int nnonposind,
bool& stop);
2280 int* nrowsforremoval,
2299 int& nviolatedrows);
2385 #endif // _SOPLEX_H_
void changeLhsRational(const VectorRational &lhs)
changes left-hand side vector for constraints to lhs
const VectorRational & rhsRational() const
returns right-hand side vector
Fast shifting ratio test.
RangeType
type of bounds and sides
const char * getRatiotesterName()
name of currently loaded ratiotester
void getRowsRational(int start, int end, LPRowSetRational &lprowset) const
gets rows start, ..., end.
const VectorReal & maxObjRealInternal() const
returns objective function vector after transformation to a maximization problem; since this is how i...
void _computeBasisInverseRational()
computes rational inverse of basis matrix as defined by _rationalLUSolverBind
void _checkScaling(SPxLPReal *origLP) const
check scaling of LP
bool multBasisTranspose(Real *vec, bool unscale=true)
multiply with transpose of basis matrix; vec * B^T (inplace)
void _changeUpperReal(const VectorReal &upper)
changes vector of upper bounds to upper and adjusts basis
standard floating-point parsing
textbook ratio test without stabilization
accuracy of conjugate gradient method in least squares scaling (higher value leads to more iterations...
SoPlex start basis generation base class.
zero tolerance used in factorization
void getUpperReal(DVectorReal &upper) const
gets upper bound vector
Rational _rationalMaxscaleincr
Bound flipping ratio test ("long step dual") for SoPlex.Class SPxBoundFlippingRT provides an implemen...
DVectorRational _unboundedRhs
bool _reapplyPersistentScaling() const
check whether persistent scaling is supposed to be reapplied again after unscaling ...
void printVersion() const
prints version and compilation options
SoPlex()
default constructor
bool getDualViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of dual multipliers; returns true on success
Types of solution classes.
void printSolutionStatistics(std::ostream &os)
prints solution statistics
refactor threshold for memory growth in factorization since last refactorization
void _transformEquality()
introduces slack variables to transform inequality constraints into equations for both rational and r...
void _updateComplementaryPrimalSlackColCoeff()
updating the slack column coefficients to adjust for equality constraints
Implementation of Sparse Linear Solver with Rational precision.This class implements a SLinSolverRati...
partial multiple pricer based on Dantzig pricing
bool getDualNorms(int &nnormsRow, int &nnormsCol, Real *norms) const
gets steepest edge norms and returns false if they are not available
void _addColReal(const LPColReal &lpcol)
adds a single column to the real LP and adjusts basis
int numRowsReal() const
returns number of rows
bool getBasisInverseRowReal(int r, Real *coef, int *inds=NULL, int *ninds=NULL, bool unscale=true)
computes row r of basis inverse; returns true on success
Rational minAbsNonzeroRational() const
returns smallest non-zero element in absolute value
void removeRowsRational(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
type of starter used to create crash basis
void removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
const RowViolation * entry
void _optimizeReal()
solves real LP
geometric mean scaling on rows and columns, max 8 rounds
const Settings & settings() const
returns current parameter settings
upper limit on objective value
Devex pricer.The Devex Pricer for SoPlex implements an approximate steepest edge pricing, that does without solving an extra linear system and computing the scalar products.
void _updateDecompReducedProblem(Real objVal, DVector dualVector, DVector redcostVector, DVector compPrimalVector, DVector compDualVector)
update the reduced problem with additional columns and rows
void _changeElementReal(int i, int j, const Real &val)
changes matrix entry in row i and column j to val and adjusts basis
void _transformUnbounded()
transforms LP to unboundedness problem by moving the objective function to the constraints, changing right-hand side and bounds to zero, and adding an auxiliary variable for the decrease in the objective function
Result
Result of the simplification.
mode for solution polishing
Real _realParamValues[SoPlex::REALPARAM_COUNT]
array of current real parameter values
void _changeRangeReal(const VectorReal &lhs, const VectorReal &rhs)
changes left- and right-hand side vectors and adjusts basis
void removeColReal(int i)
removes column i
Steepest edge pricer.Class SPxSteepExPR implements a steepest edge pricer to be used with SoPlex...
maximum increase of scaling factors between refinements
SPxMainSM _simplifierMainSM
Geometric mean row/column scaling.This SPxScaler implementation performs geometric mean scaling of th...
Real maxAbsNonzeroReal() const
returns biggest non-zero element in absolute value
LP has beed solved to optimality but unscaled solution contains violations.
continue iterative refinement with exact basic solution if not optimal?
const SVectorReal & colVectorRealInternal(int i) const
returns vector of col i, ignoring scaling
automatic sync of real and rational LP
void _findViolatedRows(Real compObjValue, DataArray< RowViolation > &violatedrows, int &nviolatedrows)
builds the update rows with those violated in the complmentary problem
DataArray< SPxRowId > _decompPrimalRowIDs
DataArray< SPxRowId > _decompElimPrimalRowIDs
number of real parameters
void _checkOriginalProblemOptimality(Vector primalVector, bool printViol)
checking the optimality of the original problem.
void _removeComplementaryDualFixedPrimalVars(int *currFixedVars)
removing the dual columns related to the fixed variables
type of computational form, i.e., column or row representation
void changeColRational(int i, const LPColRational &lpcol)
replaces column i with lpcol
void _setComplementaryPrimalOriginalObjective()
updating the complementary primal problem with the original objective function
bool getBasisIndRational(DataArray< int > &bind)
gets an array of indices for the columns of the rational basis matrix; bind[i] >= 0 means that the i-...
Abstract pricer base class.
bool getPrimalReal(VectorReal &vector)
gets the primal solution vector if available; returns true on success
dual simplex algorithm, i.e., leaving for column and entering for row representation ...
pivot zero tolerance used in factorization
int numRowsRational() const
returns number of rows
bool writeDualFileReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0) const
writes the dual of the real LP to file; LP or MPS format is chosen from the extension in filename; if...
SPxSolver::Status solve()
DataArray< SPxRowId > _decompReducedProbColRowIDs
refinement limit (-1 if unlimited)
bool getDualRational(VectorRational &vector)
gets the dual solution vector if available; returns true on success
class of parameter settings
SPxLPRational * _rationalLP
void printShortStatistics(std::ostream &os)
prints short statistics
Solution vector based start basis.
Real coefReal(int row, int col) const
returns (unscaled) coefficient
bool getSlacksRational(VectorRational &vector)
gets the vector of slack values if available; returns true on success
bool multBasis(Real *vec, bool unscale=true)
multiply with basis matrix; B * vec (inplace)
void getColsRational(int start, int end, LPColSetRational &lpcolset) const
gets columns start, ..., end
SPxSolver::Status _solveRealStable(bool acceptUnbounded, bool acceptInfeasible, VectorReal &primal, VectorReal &dual, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, bool &returnedBasis, const bool forceNoSimplifier=false)
solves real LP with recovery mechanism
int totalSizePrimalRational(const int base=2)
get size of primal solution
void _addColsReal(const LPColSetReal &lpcolset)
adds multiple columns to the real LP and adjusts basis
primal simplex algorithm, i.e., entering for column and leaving for row representation ...
unsigned int randomSeed() const
returns the current random seed of the solver instance
LPRowSet _transformedRows
time limit in seconds (INFTY if unlimited)
steepest edge pricer with exact initialization of norms
mode for iterative refinement strategy
void changeRangeReal(const VectorReal &lhs, const VectorReal &rhs)
changes left- and right-hand side vectors
Rational _rationalFeastol
void writeStateReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const bool cpxFormat=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are NULL...
greedy crash basis weighted by objective, bounds, and sides
void _removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
virtual ~SoPlex()
destructor
bool getRedCostRational(VectorRational &vector)
gets the vector of reduced cost values if available; returns true on success
only error and warning output
LP geometric mean scaling.
primal feasibility tolerance
static struct soplex::SoPlex::Settings::RealParam realParam
void _storeSolutionRealFromPresol()
stores solution from the simplifier because problem vanished in presolving step
bool writeBasisFile(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const bool cpxFormat=false) const
writes basis information to filename; if rowNames and colNames are NULL, default names are used; retu...
Abstract ratio test base class.
void _addRowReal(const LPRowReal &lprow)
adds a single row to the real LP and adjusts basis
DVectorRational _feasLower
bool defaultValue[SoPlex::BOOLPARAM_COUNT]
array of default values for boolean parameters
std::string name[SoPlex::BOOLPARAM_COUNT]
array of names for boolean parameters
bool readBasisFile(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0)
reads basis information from filename and returns true on success; if rowNames and colNames are NULL...
void changeRangeRational(const VectorRational &lhs, const VectorRational &rhs)
changes left- and right-hand side vectors
Least squares scaling.This SPxScaler implementation performs least squares scaling as suggested by Cu...
mode for reading LP files
mode for synchronizing real and rational LP
void _syncLPReal(bool time=true)
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP...
void _optimizeRational()
solves rational LP
bool getDualFarkasReal(VectorReal &vector)
gets the Farkas proof if available; returns true on success
void resetSettings(const bool quiet=false, const bool init=true)
resets default parameter settings
void _recomputeRangeTypesRational()
recomputes range types from scratch using rational LP
void _unscaleSolutionReal(SPxLPReal &LP, bool persistent=true)
unscales stored solution to remove internal or external scaling of LP
iteration limit (-1 if unlimited)
void _transformFeasibility()
transforms LP to feasibility problem by removing the objective function, shifting variables...
void changeObjReal(const VectorReal &obj)
changes objective function vector to obj
void changeRowRational(int i, const LPRowRational &lprow)
replaces row i with lprow
Implementation of Sparse Linear Solver.
bool getRowViolationReal(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
re-optimize the original problem to get a proof (ray) of infeasibility/unboundedness?
decide according to READMODE
SPxFastRT _ratiotesterFast
should cycling solutions be accepted during iterative refinement?
void _disableSimplifierAndScaler()
disables simplifier and scaler
bool getRowViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of constraints; returns true on success
static struct soplex::SoPlex::Settings::IntParam intParam
should the decomposition based dual simplex be used to solve the LP? Setting this to true forces the ...
DataArray< SPxSolver::VarStatus > _storedBasisStatusCols
Real lowerReal(int i) const
returns lower bound of column i
bool getBasisInverseRowRational(const int r, SSVectorRational &vec)
computes row r of basis inverse; performs rational factorization if not available; returns true on su...
Implementation of Sparse Linear Solver with Rational precision.
bool * _decompReducedProbCols
void _performFeasIRStable(SolRational &sol, bool &withDualFarkas, bool &stopped, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing feasibility
void _removeRowReal(int i)
removes row i and adjusts basis
lower bound is finite, upper bound is infinite
void _storeBasis()
store basis
bool _readFileReal(const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
reads real LP in LP or MPS format from file and returns true on success; gets row names...
SoPlex start basis generation base class.SPxStarter is the virtual base class for classes generating ...
void addColsRational(const LPColSetRational &lpcolset)
adds multiple columns
Real upperReal(int i) const
returns upper bound of column i
void _computeReducedProbObjCoeff(bool &stop)
computes the reduced problem objective coefficients
minimize number of basic slack variables, i.e. more variables between bounds
void getColRational(int i, LPColRational &lpcol) const
gets column i
const char * getStarterName()
name of starter
void _checkBasisScaling()
check correctness of (un)scaled basis matrix operations
SPxSolver::Status _solveRealForRational(bool fromscratch, VectorReal &primal, VectorReal &dual, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, bool &returnedBasis)
solves real LP during iterative refinement
int getOrigVarFixedDirection(int colNum)
determining which bound the primal variables will be fixed to.
General methods in LP preprocessing.
void _untransformUnbounded(SolRational &sol, bool unbounded)
undoes transformation to unboundedness problem
bool readFile(const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
reads LP file in LP or MPS format according to READMODE parameter; gets row names, column names, and integer variables if desired; returns true on success
Ids for LP columns.Class SPxColId provides DataKeys for the column indices of an SPxLP.
void _ensureRationalLP()
ensures that the rational LP is available; performs no sync
geometric mean scaling on rows and columns, max 1 round
minimum number of stalling refinements since last pivot to trigger rational factorization ...
Auto pricer.This pricer switches between Devex and Steepest edge pricer based on the difficulty of th...
minimal reduction (sum of removed rows/cols) to continue simplification
void getRowVectorReal(int i, DSVectorReal &row) const
gets vector of row i
Wrapper for GMP type mpq_class.We wrap mpq_class so that we can replace it by a double type if GMP is...
bool setSettings(const Settings &newSettings, const bool init=true)
sets parameter settings; returns true on success
void _changeRhsReal(const VectorReal &rhs)
changes right-hand side vector to rhs and adjusts basis
void changeElementReal(int i, int j, const Real &val)
changes matrix entry in row i and column j to val
void printStatistics(std::ostream &os)
prints complete statistics
Real rhsReal(int i) const
returns right-hand side of row i
bool getDecompBoundViolation(Real &maxviol, Real &sumviol)
gets violation of bounds; returns true on success
should a rational factorization be performed after iterative refinement?
user sync of real and rational LP
mode for hyper sparse pricing
void _getCompatibleBoundCons(LPRowSet &boundcons, int *compatboundcons, int *nonposind, int *ncompatboundcons, int nnonposind, bool &stop)
computes the compatible bound constraints and adds them to the reduced problem
void getRhsReal(DVectorReal &rhs) const
gets right-hand side vector
maximum number of updates without fresh factorization
void removeColRangeRational(int start, int end, int perm[]=0)
removes columns start to end including both; an array perm of size numColsRational() may be passed as...
bound flipping ratio test for long steps in the dual simplex
void changeUpperRational(const VectorRational &upper)
changes vector of upper bounds to upper
bool _boolParamValues[SoPlex::BOOLPARAM_COUNT]
array of current boolean parameter values
Rational _rationalPosInfty
number of integer parameters
DataArray< SPxColId > _decompCompPrimalColIDs
bool setDualNorms(int nnormsRow, int nnormsCol, Real *norms)
sets steepest edge norms and returns false if that's not possible
static struct soplex::SoPlex::Settings::BoolParam boolParam
LP simplification base class.
const VectorRational & lhsRational() const
returns left-hand side vector
bool writeFileRational(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0) const
writes rational LP to file; LP or MPS format is chosen from the extension in filename; if rowNames an...
SPxEquiliSC _scalerBiequi
int numNonzerosRational() const
returns number of nonzeros
DataArray< SPxColId > _decompReducedProbColIDs
bool isDualFeasible() const
is stored dual solution feasible?
Partial multiple pricing.Class SPxParMultPr is an implementation class for SPxPricer implementing Dan...
void removeColRangeReal(int start, int end, int perm[]=0)
removes columns start to end including both; an array perm of size numColsReal() may be passed as buf...
void addColReal(const LPCol &lpcol)
adds a single column
Rational objRational(int i) const
returns objective value of column i
void clearLPRational()
clears the LP
void _solveDecompReducedProblem()
solves the reduced problem
DataArray< SPxRowId > _decompReducedProbRowIDs
void _removeColRangeReal(int start, int end, int perm[])
removes columns start to end including both; an array perm of size numColsReal() may be passed as buf...
void addRowsRational(const LPRowSetRational &lprowset)
adds multiple rows
void printOriginalProblemStatistics(std::ostream &os)
stores the problem statistics of the original problem
SPxSolver::Status optimize()
optimize the given LP
void getObjReal(VectorReal &obj) const
gets objective function vector
void getLowerReal(DVectorReal &lower) const
gets lower bound vector
void addRowRational(const LPRowRational &lprow)
adds a single row
void addColRational(const LPColRational &lpcol)
adds a single column
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
SPxGeometSC _scalerGeoequi
const UnitVectorRational * _unitVectorRational(const int i)
returns pointer to a constant unit vector available until destruction of the SoPlex class ...
void _rangeToPerm(int start, int end, int *perm, int permSize) const
creates a permutation for removing rows/columns from a range of indices
void _syncRealSolution()
synchronizes rational solution with real solution, i.e., copies (rounded) rational solution to real s...
void _formDecompReducedProblem(bool &stop)
forms the reduced problem
void removeColsRational(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
Fast shifting ratio test.Class SPxFastRT is an implementation class of SPxRatioTester providing fast ...
refactor threshold for fill-in in current factor update compared to fill-in in last factorization ...
Forrest-Tomlin type update.
void changeRhsRational(const VectorRational &rhs)
changes right-hand side vector to rhs
int dmaxSizeDualRational(const int base=2)
get size of largest denominator in dual solution
void _ensureDSVectorRationalMemory(DSVectorRational &vec, const int newmax) const
extends sparse vector to hold newmax entries if and only if it holds no more free entries ...
DataArray< SPxRowId > _decompCompPrimalRowIDs
void _updateComplementaryPrimalFixedPrimalVars(int *currFixedVars)
updating the dual columns related to the fixed primal variables.
int dlcmSizePrimalRational(const int base=2)
get size of least common multiple of denominators in primal solution
Rational objValueRational()
returns the objective value if a primal solution is available
void getBasis(SPxSolver::VarStatus rows[], SPxSolver::VarStatus cols[]) const
gets current basis via arrays of statuses
DataArray< SPxSolver::VarStatus > _basisStatusCols
DVectorRational _unboundedLower
void getLhsReal(DVectorReal &lhs) const
gets left-hand side vector
decompStatus _currentProb
bool isPrimalFeasible() const
is stored primal solution feasible?
DataArray< RangeType > _colTypes
void removeRowRangeReal(int start, int end, int perm[]=0)
removes rows start to end including both; an array perm of size numRowsReal() may be passed as buffer...
SPxBoundFlippingRT _ratiotesterBoundFlipping
bool ignoreUnscaledViolations()
sets the status to OPTIMAL in case the LP has been solved with unscaled violations ...
SLUFactorRational _rationalLUSolver
void _getZeroDualMultiplierIndices(Vector feasVector, int *nonposind, int *colsforremoval, int *nnonposind, bool &stop)
identifies the columns of the row-form basis that correspond to rows with zero dual multipliers...
void getRowRational(int i, LPRowRational &lprow) const
gets row i
void _solveRealLPAndRecordStatistics()
call floating-point solver and update statistics on iterations etc.
void _evaluateSolutionDecomp(SPxSolver &solver, SLUFactor &sluFactor, SPxSimplifier::Result result)
evaluates the solution of the reduced problem for the DBDS
number of boolean parameters
void _setComplementaryDualOriginalObjective()
updating the complementary dual problem with the original objective function
SPxEquiliSC _scalerUniequi
void printSolvingStatistics(std::ostream &os)
prints statistics on solving process
bool _readFileRational(const char *filename, NameSet *rowNames=0, NameSet *colNames=0, DIdxSet *intVars=0)
reads rational LP in LP or MPS format from file and returns true on success; gets row names...
lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformula...
bool getPrimalRayReal(VectorReal &vector)
gets the primal ray if available; returns true on success
bool hasPrimal() const
is a primal feasible solution available?
standard Harris ratio test
void _decompSimplifyAndSolve(SPxSolver &solver, SLUFactor &sluFactor, bool fromScratch, bool applyPreprocessing)
simplifies the problem and solves
void changeLhsReal(const VectorReal &lhs)
changes left-hand side vector for constraints to lhs
bool getDecompRowViolation(Real &maxviol, Real &sumviol)
gets violation of constraints; returns true on success
generic solution-based crash basis
crash basis from a greedy solution
bool hasDualFarkas() const
is Farkas proof of infeasibility available?
bool _isConsistent() const
checks consistency
void _changeLowerReal(const VectorReal &lower)
changes vector of lower bounds to lower and adjusts basis
void _getCompatibleColumns(Vector feasVector, int *nonposind, int *compatind, int *rowsforremoval, int *colsforremoval, int nnonposind, int *ncompatind, bool formRedProb, bool &stop)
retrieves the compatible columns from the constraint matrix
void _performOptIRStable(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minRounds, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stopped, bool &stoppedIter, bool &error)
solves current problem with iterative refinement and recovery mechanism
the iteration frequency at which the decomposition solve output is displayed.
LP simplification abstract base class.Instances of classes derived from SPxSimplifier may be loaded t...
LP has been solved to optimality.
Rational maxAbsNonzeroRational() const
returns biggest non-zero element in absolute value
bool computeBasisInverseRational()
compute rational basis inverse; returns true on success
bool _upperFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite upper bound
use bound flipping also for row representation?
bool hasBasis() const
is an advanced starting basis available?
void _invalidateSolution()
invalidates solution
bool getBasisInverseColReal(int c, Real *coef, int *inds=NULL, int *ninds=NULL, bool unscale=true)
computes column c of basis inverse; returns true on success
bool getDualViolationReal(Real &maxviol, Real &sumviol)
gets violation of dual multipliers; returns true on success
bool getBasisInverseColRational(const int c, SSVectorRational &vec)
computes column c of basis inverse; performs rational factorization if not available; returns true on...
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
const char * getSimplifierName()
name of simplifier
void changeLowerReal(const VectorReal &lower)
changes vector of lower bounds to lower
void _restoreLPReal()
restores objective, bounds, and sides of real LP
void _project(SolRational &sol)
undoes lifting
const char * getPricerName()
name of currently loaded pricer
print condition number during the solve
void _performUnboundedIRStable(SolRational &sol, bool &hasUnboundedRay, bool &stopped, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing unboundedness
SPxRowId _compSlackDualRowId
round scaling factors for iterative refinement to powers of two?
SPxBasis::SPxStatus basisStatus() const
returns the current basis status
void _computeInfeasBox(SolRational &sol, bool transformed)
void removeRowReal(int i)
removes row i
bool getBasisInverseTimesVecReal(Real *rhs, Real *sol, bool unscale=true)
computes dense solution of basis matrix B * sol = rhs; returns true on success
int dlcmSizeDualRational(const int base=2)
get size of least common multiple of denominators in dual solution
SPxWeightST _starterWeight
Statistics * _statistics
statistics since last call to solveReal() or solveRational()
void _evaluateSolutionReal(SPxSimplifier::Result simplificationStatus)
checks result of the solving process and solves again without preprocessing if necessary ...
LPColSetRational _slackCols
Real getCompSlackVarCoeff(int primalRowNum)
gets the coefficient of the slack variable in the primal complementary problem
void getColVectorReal(int i, DSVectorReal &col) const
gets vector of col i
DVectorRational _feasUpper
void _removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
void _syncLPRational(bool time=true)
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, without looking at the sy...
void printUserSettings()
print non-default parameter values
void changeBoundsReal(const VectorReal &lower, const VectorReal &upper)
changes vectors of column bounds to lower and upper
RangeType _rangeTypeRational(const Rational &lower, const Rational &upper) const
determines RangeType from rational bounds
SPxSteepPR _pricerQuickSteep
int numColsRational() const
returns number of columns
force iterative refinement
void syncLPReal()
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP...
bool _reconstructSolutionRational(SolRational &sol, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, const Rational &denomBoundSquared)
attempts rational reconstruction of primal-dual solution
SPxDantzigPR _pricerDantzig
SPxParMultPR _pricerParMult
bool getPrimalRational(VectorRational &vector)
gets the primal solution vector if available; returns true on success
Solution vector based start basis.This version of SPxWeightST can be used to construct a starting bas...
void changeObjRational(const VectorRational &obj)
changes objective function vector to obj
std::string statisticString() const
statistical information in form of a string
RangeType _switchRangeType(const RangeType &rangeType) const
switches RANGETYPE_LOWER to RANGETYPE_UPPER and vice versa
void _removeRowRangeReal(int start, int end, int perm[])
removes rows start to end including both; an array perm of size numRowsReal() may be passed as buffer...
Real operator()(RowViolation i, RowViolation j) const
Dynamic index set.Class DIdxSet provides dynamic IdxSet in the sense, that no restrictions are posed ...
void clearBasis()
clears starting basis
const SVectorReal & rowVectorRealInternal(int i) const
returns vector of row i, ignoring scaling
void syncLPRational()
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, if sync mode is manual ...
bool getRedCostReal(VectorReal &vector)
gets the vector of reduced cost values if available; returns true on success
DataArray< SPxColId > _decompPrimalColIDs
Simple heuristic SPxStarter.
DVectorRational _modUpper
void _decompResolveWithoutPreprocessing(SPxSolver &solver, SLUFactor &sluFactor, SPxSimplifier::Result result)
loads original problem into solver and solves again after it has been solved to optimality with prepr...
SPxSteepExPR _pricerSteep
void _verifySolutionReal()
verify computed solution and resolve if necessary
bool hasDual() const
is a dual feasible solution available?
bool parseSettingsString(char *line)
parses one setting string and returns true on success; note that string is modified ...
const VectorReal & upperRealInternal() const
returns upper bound vector
only error, warning, and debug output
void changeBoundsRational(const VectorRational &lower, const VectorRational &upper)
changes vectors of column bounds to lower and upper
const SVectorRational & colVectorRational(int i) const
returns vector of column i
int numIterations() const
number of iterations since last call to solve
SPxDefaultRT _ratiotesterTextbook
void _loadRealLP(bool initBasis)
load original LP and possibly setup a slack basis
(In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is...
Settings * _currentSettings
bool getBasisInverseTimesVecRational(const SVectorRational &rhs, SSVectorRational &sol)
computes solution of basis matrix B * sol = rhs; performs rational factorization if not available; re...
Real lhsReal(int i) const
returns left-hand side of row i
LPRowReal::Type rowTypeReal(int i) const
returns inequality type of row i
automatic choice according to number of rows and columns
Sparse vector .A UnitVectorBase is an SVectorBase that can take only one nonzero value with value 1 b...
Bound flipping ratio test (long step dual) for SoPlex.
void getOriginalProblemBasisColStatus(int &nNonBasicCols)
function to retrieve the column status for the original problem basis from the reduced and complement...
void _syncRationalSolution()
synchronizes real solution with rational solution, i.e., copies real solution to rational solution ...
int _intParamValues[SoPlex::INTPARAM_COUNT]
array of current integer parameter values
Debugging, floating point type and parameter definitions.
void _createDecompReducedAndComplementaryProblems()
creating copies of the original problem that will be manipulated to form the reduced and complementar...
Simplex basis.Consider the linear program as provided from class SPxLP: where , and ...
apply standard floating-point algorithm
bool areLPsInSync(const bool checkVecVals=true, const bool checkMatVals=false, const bool quiet=false) const
checks if real LP and rational LP are in sync; dimensions will always be compared, vector and matrix values only if the respective parameter is set to true. If quiet is set to true the function will only display which vectors are different.
Set of strings.Class NameSet implements a symbol or name table. It allows to store or remove names (i...
decide depending on tolerances whether to apply iterative refinement
DataArray< SPxColId > _decompFixedVarDualIDs
lower and upper bound finite, but different
DualSign getOrigProbDualVariableSign(int rowNumber)
returns the expected sign of the dual variables for the original problem
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
void _storeLPReal()
stores objective, bounds, and sides of real LP
LP least squares scaling.
Rational _rationalNegInfty
const SVectorRational & rowVectorRational(int i) const
returns vector of row i
DataArray< SPxColId > _decompCompPrimalFixedVarIDs
void printStatus(std::ostream &os, SPxSolver::Status status)
prints status
threshold on number of rows vs. number of columns for switching from column to row representations in...
lower bound equals upper bound
Collection of dense, sparse, and semi-sparse vectors.
bool getSlacksReal(VectorReal &vector)
gets the vector of slack values if available; returns true on success
Implementation of Sparse Linear Solver.This class implements a SLinSolver interface by using the spar...
int * _decompViolatedRows
DataArray< SPxColId > _decompVarBoundDualIDs
DataArray< SPxRowId > _decompDualRowIDs
Everything should be within this namespace.
bool setRealParam(const RealParam param, const Real value, const bool init=true)
sets real parameter value; returns true on success
void _changeLhsReal(const VectorReal &lhs)
changes left-hand side vector for constraints to lhs and adjusts basis
void _writeOriginalProblemBasis(const char *filename, NameSet *rowNames, NameSet *colNames, bool cpxFormat)
function to build a basis for the original problem as given by the solution to the reduced problem ...
working tolerance for feasibility in floating-point solver during iterative refinement ...
bool _lowerFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite lower bound
returns the current git hash of SoPlex
the maximum number of rows that are added in each iteration of the decomposition based simplex ...
bool loadSettingsFile(const char *filename)
reads settings file; returns true on success
void _preprocessAndSolveReal(bool applyPreprocessing)
solves real LP with/without preprocessing
geometric mean scaling (max 8 rounds) followed by equilibrium scaling (rows and columns) ...
void _deleteAndUpdateRowsComplementaryProblem(SPxRowId rangedRowIds[], int &naddedrows)
removing rows from the complementary problem.
int numNonzerosReal() const
returns number of nonzeros
SoPlex & operator=(const SoPlex &rhs)
assignment operator
Dantzig pricer.Class SPxDantzigPR is an implementation class of an SPxPricer implementing Dantzig's d...
bool getRedCostViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of reduced costs; returns true on success
Harris pricing with shifting.
DVector _decompFeasVector
Real objReal(int i) const
returns objective value of column i
DataArray< RangeType > _rowTypes
void _removeColReal(int i)
removes column i
void _changeRowReal(int i, const LPRowReal &lprow)
replaces row i with lprow and adjusts basis
void setIntegralityInformation(int ncols, int *intInfo)
pass integrality information about the variables to the solver
maximize number of basic slack variables, i.e. more variables on bounds
void getBasisInd(int *bind) const
gets the indices of the basic columns and rows; basic column n gives value n, basic row m gives value...
apply rational reconstruction after each iterative refinement?
void _changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol and adjusts basis
void _formDecompComplementaryProblem()
forms the complementary problem
Real minAbsNonzeroReal() const
returns smallest non-zero element in absolute value
Saving LPs in a form suitable for SoPlex.Class SPxLPBase provides the data structures required for sa...
const VectorReal & lowerRealInternal() const
returns lower bound vector
bool getDualReal(VectorReal &vector)
gets the dual solution vector if available; returns true on success
SPxHarrisRT _ratiotesterHarris
void changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol
Steepest edge pricer with exact initialization of weights.
working tolerance for optimality in floating-point solver during iterative refinement ...
void clearLPReal()
clears the LP
equilibrium scaling on rows or columns
Preconfigured SoPlex LP-solver.
should the dual of the complementary problem be used in the decomposition simplex?
void removeRowRational(int i)
removes row i
Type
(In)Equality type of an LP row.
DVectorRational _unboundedLhs
void getOriginalProblemBasisRowStatus(DataArray< int > °enerateRowNums, DataArray< SPxSolver::VarStatus > °enerateRowStatus, int &nDegenerateRows, int &nNonBasicRows)
function to retrieve the original problem row basis status from the reduced and complementary problem...
DSVectorRational _primalDualDiff
SPxVectorST _starterVector
DVectorRational _unboundedUpper
bool getBoundViolationReal(Real &maxviol, Real &sumviol)
gets violation of bounds; returns true on success
bool writeFileReal(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const DIdxSet *intvars=0, const bool unscale=true) const
writes real LP to file; LP or MPS format is chosen from the extension in filename; if rowNames and co...
Simple heuristic SPxStarter.Testing version of an SPxVectorST using a very simplistic heuristic to bu...
const VectorRational & upperRational() const
returns upper bound vector
Weighted start basis.Class SPxWeightST is an implementation of a SPxStarter for generating a Simplex ...
column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
mode for a posteriori feasibility checks
refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix ...
void printDecompDisplayLine(SPxSolver &solver, const SPxOut::Verbosity origVerb, bool force, bool forceHead)
prints a display line of the flying table for the DBDS
Partial multiple pricing.
Verbosity
Verbosity level.
void _resolveWithoutPreprocessing(SPxSimplifier::Result simplificationStatus)
loads original problem into solver and solves again after it has been solved to optimality with prepr...
void _identifyComplementaryPrimalFixedPrimalVars(int *currFixedVars)
removing the dual columns related to the fixed variables
LPRowRational::Type rowTypeRational(int i) const
returns inequality type of row i
Textbook ratio test for SoPlex.Class SPxDefaultRT provides an implementation of the textbook ratio te...
type of algorithm, i.e., primal or dual
bool * _decompReducedProbRows
void _recomputeRangeTypesReal()
recomputes range types from scratch using real LP
void _getRowsForRemovalComplementaryProblem(int *nonposind, int *bind, int *rowsforremoval, int *nrowsforremoval, int nnonposind)
computes the rows to remove from the complementary problem
DataArray< UnitVectorRational *> _unitMatrixRational
bool getDualFarkasRational(VectorRational &vector)
gets the Farkas proof if LP is infeasible; returns true on success
LP scaler abstract base class.Instances of classes derived from SPxScaler may be loaded to SoPlex in ...
stalling refinement limit (-1 if unlimited)
DataArray< SPxSolver::VarStatus > _basisStatusRows
Set of LP rows.Class LPRowSetBase implements a set of LPRowBase%s. Unless for memory limitations...
SPxSolver::VarStatus basisColStatus(int col) const
returns basis status for a single column
void _solveDecompositionDualSimplex()
solves LP using the decomposition based dual simplex
should dual infeasibility be tested in order to try to return a dual solution even if primal infeasib...
void getNdualNorms(int &nnormsRow, int &nnormsCol) const
gets number of available dual norms
void _factorizeColumnRational(SolRational &sol, DataArray< SPxSolver::VarStatus > &basisStatusRows, DataArray< SPxSolver::VarStatus > &basisStatusCols, bool &stoppedTime, bool &stoppedIter, bool &error, bool &optimal)
factorizes rational basis matrix in column representation
bool getFastCondition(Real &condition, int type=0)
compute condition number estimate based on the diagonal of the LU factorization; returns true on succ...
std::string description[SoPlex::BOOLPARAM_COUNT]
array of descriptions for boolean parameters
SPxBasis _decompTransBasis
const VectorReal & rhsRealInternal() const
returns right-hand side vector, ignoring scaling
the verbosity of the decomposition based simplex
should lifting be used to reduce range of nonzero matrix coefficients?
int dmaxSizePrimalRational(const int base=2)
get size of largest denominator in primal solution
bool getEstimatedCondition(Real &condition)
computes an estimated condition number for the current basis matrix using the power method; returns t...
Real maxObjReal(int i) const
returns objective value of column i after transformation to a maximization problem; since this is how...
void _storeSolutionReal(bool verify=true)
stores solution of the real LP; before calling this, the real LP must be loaded in the solver and sol...
void setRandomSeed(unsigned int seed)
set the random seeds of the solver instance
DataArray< int > _rationalLUSolverBind
should the degeneracy be computed for each basis?
bool getExactCondition(Real &condition)
computes the exact condition number for the current basis matrix using the power method; returns true...
const char * getScalerName()
name of scaling method
Real solveTime() const
time spent in last call to solve
void addColsReal(const LPColSetReal &lpcolset)
adds multiple columns
SPxSolver::Status status() const
returns the current solver status
zero tolerance used in update of the factorization
lower limit on objective value
void changeLowerRational(const VectorRational &lower)
changes vector of lower bounds to lower
DSVectorRational _tauColVector
DVectorRational _modLower
bool getRedCostViolationReal(Real &maxviol, Real &sumviol)
gets violation of reduced costs; returns true on success
BoolParam
boolean parameters
int * _decompViolatedBounds
bool _isSolveStopped(bool &stoppedTime, bool &stoppedIter) const
should solving process be stopped?
void _changeBoundsReal(const VectorReal &lower, const VectorReal &upper)
changes vectors of column bounds to lower and upper and adjusts basis
Settings()
default constructor initializing default settings
void _updateComplementaryDualSlackColCoeff()
updating the slack column coefficients to adjust for equality constraints
maximum number of conjugate gradient iterations in least square scaling
sparse pricing threshold (#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing) ...
Settings & operator=(const Settings &settings)
assignment operator
void addRowReal(const LPRowReal &lprow)
adds a single row
Ids for LP rows.Class SPxRowId provides DataKeys for the row indices of an SPxLP. ...
bool getPrimalRayRational(VectorRational &vector)
gets the primal ray if LP is unbounded; returns true on success
dual feasibility tolerance
void _ensureRealLPLoaded()
ensures that the real LP and the basis are loaded in the solver; performs no sync ...
void _restoreBasis()
restore basis
void changeRowReal(int i, const LPRowReal &lprow)
replaces row i with lprow
equilibrium scaling on rows and columns
void setBasis(const SPxSolver::VarStatus rows[], const SPxSolver::VarStatus cols[])
sets starting basis via arrays of statuses
bool setIntParam(const IntParam param, const int value, const bool init=true)
sets integer parameter value; returns true on success
void _identifyComplementaryDualFixedPrimalVars(int *currFixedVars)
removing the dual columns related to the fixed variables
bool saveSettingsFile(const char *filename, const bool onlyChanged=false) const
writes settings file; returns true on success
Textbook ratio test for SoPlex.
DataArray< SPxColId > _decompCompPrimalVarBoundIDs
Real objValueReal()
returns the objective value if a primal solution is available
void _updateComplementaryDualFixedPrimalVars(int *currFixedVars)
updating the dual columns related to the fixed primal variables.
DualSign getExpectedDualVariableSign(int rowNumber)
returns the expected sign of the dual variables for the reduced problem
bool _parseSettingsLine(char *line, const int lineNumber)
parses one line in a settings file and returns true on success; note that the string is modified ...
void changeRhsReal(const VectorReal &rhs)
changes right-hand side vector to rhs
bool decompTerminate(Real timeLimit)
function call to terminate the decomposition simplex
SPxLeastSqSC _scalerLeastsq
geometric frequency at which to apply rational reconstruction
void changeElementRational(int i, int j, const Rational &val)
changes matrix entry in row i and column j to val
void writeStateRational(const char *filename, const NameSet *rowNames=0, const NameSet *colNames=0, const bool cpxFormat=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are NULL...
void getOriginalProblemStatistics()
stores the problem statistics of the original problem
void _enableSimplifierAndScaler()
enables simplifier and scaler according to current parameters
bool checkBasisDualFeasibility(Vector feasVec)
checks the dual feasibility of the current basis
bool setBoolParam(const BoolParam param, const bool value, const bool init=true)
sets boolean parameter value; returns true on success
should LP be transformed to equality form before a rational solve?
void _idxToPerm(int *idx, int idxSize, int *perm, int permSize) const
creates a permutation for removing rows/columns from an array of indices
Equilibrium row/column scaling.This SPxScaler implementation performs equilibrium scaling of the LPs ...
SPxSolver::VarStatus basisRowStatus(int row) const
returns basis status for a single row
the number of iterations before the decomposition simplex initialisation is terminated.
decide according to problem size
const VectorRational & maxObjRational() const
returns objective function vector after transformation to a maximization problem; since this is how i...
upper threshold in lifting (nonzero matrix coefficients with larger absolute value will be reformulat...
DataArray< SPxSolver::VarStatus > _storedBasisStatusRows
void _addRowsReal(const LPRowSetReal &lprowset)
adds multiple rows to the real LP and adjusts basis
void _updateDecompReducedProblemViol(bool allrows)
update the reduced problem with additional columns and rows based upon the violated original bounds a...
int numColsReal() const
returns number of columns
void changeUpperReal(const VectorReal &upper)
changes vector of upper bounds to upper
bool hasPrimalRay() const
is a primal unbounded ray available?
void removeColRational(int i)
removes column i
IntParam
integer parameters
void _lift()
reduces matrix coefficient in absolute value by the lifting procedure of Thiele et al...
SPxSolver::Status _status
void getObjRational(VectorRational &obj) const
gets objective function vector
LP column.Class LPColBase provides a datatype for storing the column of an LP a the form similar to ...
void _completeRangeTypesRational()
completes range type arrays after adding columns and/or rows
RangeType _rangeTypeReal(const Real &lower, const Real &upper) const
determines RangeType from real bounds
const VectorReal & lhsRealInternal() const
returns left-hand side vector, ignoring scaling
SPxSimplifier * _simplifier
void removeRowRangeRational(int start, int end, int perm[]=0)
removes rows start to end including both; an array perm of size numRowsRational() may be passed as bu...
void _updateDecompComplementaryPrimalProblem(bool origObj)
update the primal complementary problem with additional columns and rows
void addRowsReal(const LPRowSetReal &lprowset)
adds multiple rows
DataArray< SPxColId > _decompDualColIDs
void _untransformEquality(SolRational &sol)
undoes transformation to equality form
perturb the entire problem or only the relevant bounds of s single pivot?
Steepest edge pricer.Class SPxSteepPR implements a steepest edge pricer to be used with SoPlex...
should row and bound violations be computed explicitly in the update of reduced problem in the decomp...
Harris pricing with shifting.Class SPxHarrisRT is a stable implementation of a SPxRatioTester class a...
upper bound is finite, lower bound is infinite
int * _decompCompProbColIDsIdx
bool getBoundViolationRational(Rational &maxviol, Rational &sumviol)
gets violation of bounds; returns true on success
modified Harris ratio test
LP simplifier for removing uneccessary row/columns.This SPxSimplifier is mainly based on the paper "P...
void _untransformFeasibility(SolRational &sol, bool infeasible)
undoes transformation to feasibility problem
int totalSizeDualRational(const int base=2)
get size of dual solution
void _updateDecompComplementaryDualProblem(bool origObj)
update the dual complementary problem with additional columns and rows
void removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
const VectorRational & lowerRational() const
returns lower bound vector
steepest edge pricer with initialization to unit norms