81#ifdef SOPLEX_WITH_BOOST
82#ifdef SOPLEX_WITH_MPFR
84#include <boost/multiprecision/mpfr.hpp>
86#ifdef SOPLEX_WITH_CPPMPF
87#include <boost/multiprecision/cpp_dec_float.hpp>
91namespace mpf = boost::multiprecision;
94#define SOPLEX_DEFAULT_RANDOM_SEED 0
437#ifdef SOPLEX_WITH_GMP
439 void addRowRational(
const mpq_t* lhs,
const mpq_t* rowValues,
const int* rowIndices,
440 const int rowSize,
const mpq_t* rhs);
444 const int* rowStarts,
const int* rowLengths,
const int numRows,
const int numValues,
454#ifdef SOPLEX_WITH_GMP
456 void addColRational(
const mpq_t* obj,
const mpq_t* lower,
const mpq_t* colValues,
457 const int* colIndices,
const int colSize,
const mpq_t* upper);
461 const int* colIndices,
const int* colStarts,
const int* colLengths,
const int numCols,
462 const int numValues,
const mpq_t* upper);
477#ifdef SOPLEX_WITH_GMP
485#ifdef SOPLEX_WITH_GMP
499#ifdef SOPLEX_WITH_GMP
513#ifdef SOPLEX_WITH_GMP
524#ifdef SOPLEX_WITH_GMP
535#ifdef SOPLEX_WITH_GMP
546#ifdef SOPLEX_WITH_GMP
554#ifdef SOPLEX_WITH_GMP
718#ifdef SOPLEX_WITH_GMP
801 bool unscale =
true);
810 bool unscale =
true);
913 const NameSet* colNames =
nullptr,
914 const DIdxSet* intvars =
nullptr,
const bool unscale =
true,
915 const bool writeZeroObjective =
false)
const;
918 const NameSet* colNames =
nullptr,
const DIdxSet* intvars =
nullptr,
919 const bool writeZeroObjective =
false)
const;
923 const NameSet* colNames =
nullptr,
924 const DIdxSet* intvars =
nullptr,
const bool unscale =
true,
925 const bool writeZeroObjective =
false)
const;
931 const NameSet* colNames =
nullptr,
const DIdxSet* intvars =
nullptr,
932 const bool writeZeroObjective =
false)
const;
937 const NameSet* colNames =
nullptr);
942 const NameSet* colNames =
nullptr,
943 const bool cpxFormat =
false)
const;
948 const NameSet* colNames =
nullptr,
949 const bool cpxFormat =
false,
const bool writeZeroObjective =
false)
const;
954 const NameSet* colNames =
nullptr,
const bool cpxFormat =
false,
955 const bool writeZeroObjective =
false)
const;
1476#ifdef SOPLEX_WITH_RATIONALPARAM
1481 RATIONALPARAM_COUNT = 0
1533#ifdef SOPLEX_WITH_RATIONALPARAM
1534 static struct RationalParam
1560#ifdef SOPLEX_WITH_RATIONALPARAM
1586#ifdef SOPLEX_WITH_RATIONALPARAM
1588 Rational rationalParam(
const RationalParam param)
const;
1606#ifdef SOPLEX_WITH_RATIONALPARAM
1608 bool setRationalParam(
const RationalParam param,
const Rational value,
const bool init =
true);
1622 int solvemode = 1)
const;
1667 bool areLPsInSync(
const bool checkVecVals =
true,
const bool checkMatVals =
false,
1668 const bool quiet =
false)
const;
1740#ifdef SOPLEX_WITH_BOOST
1741#ifdef SOPLEX_WITH_MPFR
1744 using BP = number<mpfr_float_backend<0>, et_off>;
1746#ifdef SOPLEX_WITH_GMP
1747 using BP = number<gmp_float<50>, et_off>;
1749 using BP = number<cpp_dec_float<50>, et_off>;
1960 void _idxToPerm(
int* idx,
int idxSize,
int* perm,
int permSize)
const;
2156 template <
typename T>
2173 const bool& maximizing);
2179 const bool& maximizing);
2183 bool& primalFeasible,
2189 int minIRRoundsRemaining,
2192 int numFailedRefinements);
2202 const Rational& violationImprovementFactor,
2203 int& numFailedRefinements);
2207 int& minIRRoundsRemaining,
2208 int& lastStallIterations,
2209 int& numberOfIterations,
2210 bool& factorSolNewBasis,
2212 const Rational& errorCorrectionFactor,
2216 bool& primalFeasible,
2222 bool& continueAfter);
2228 const int& maxDimRational,
2248 template <
typename T>
2252 template <
typename T>
2256 template <
typename T>
2260 template <
typename T>
2264 bool usingRefinedLP,
2274 template <
typename T>
2279 const int& maxDimRational,
2286 template <
typename T>
2290 const bool& maximizing,
2294 const int& maxDimRational);
2364 bool& primalFeasible,
2371 bool& needNewBoostedIt);
2376 bool acceptUnbounded,
2377 bool acceptInfeasible,
2378 int minIRRoundsRemaining,
2379 bool& primalFeasible,
2386 bool& needNewBoostedIt);
2391 bool acceptUnbounded,
2392 bool acceptInfeasible,
2393 int minIRRoundsRemaining,
2394 bool& primalFeasible,
2406 bool& primalFeasible,
2416 bool acceptUnbounded,
2417 bool acceptInfeasible,
2418 int minIRRoundsRemaining,
2419 bool& primalFeasible,
2429 bool& stoppedIter,
bool& error);
2433 bool& stoppedIter,
bool& error);
2514 const bool forceNoSimplifier =
false);
2530 bool& stoppedIter,
bool& error,
bool& optimal);
2536 const Rational& denomBoundSquared);
2596#include "soplex.hpp"
2597#include "soplex/solverational.hpp"
2598#include "soplex/testsoplex.hpp"
2599#include "soplex/solvereal.hpp"
Collection of dense, sparse, and semi-sparse vectors.
Safe arrays of arbitrary types.
Type
(In)Equality type of an LP row.
Implementation of Sparse Linear Solver with Rational precision.
Implementation of Sparse Linear Solver.
Bound flipping ratio test ("long step dual") for SoPlex.
Textbook ratio test for SoPlex.
Equilibrium row/column scaling.
Fast shifting ratio test.
Geometric mean row/column scaling.
Harris pricing with shifting.
Saving LPs in a form suitable for SoPlex.
LP simplifier for removing uneccessary row/columns.
Wrapper for several output streams. A verbosity level is used to decide which stream to use and wheth...
Partial multiple pricing.
LP scaler abstract base class.
LP simplification abstract base class.
Result
Result of the simplification.
Sequential object-oriented SimPlex.
SoPlex start basis generation base class.
Simple heuristic SPxStarter.
Solution vector based start basis.
class of parameter settings
int _intParamValues[SoPlexBase< R >::INTPARAM_COUNT]
array of current integer parameter values
static struct soplex::SoPlexBase::Settings::BoolParam boolParam
bool _boolParamValues[SoPlexBase< R >::BOOLPARAM_COUNT]
array of current boolean parameter values
static struct soplex::SoPlexBase::Settings::IntParam intParam
Settings(const Settings &settings)
copy constructor
Settings & operator=(const Settings &settings)
assignment operator
Real _realParamValues[SoPlexBase< R >::REALPARAM_COUNT]
array of current real parameter values
static struct soplex::SoPlexBase::Settings::RealParam realParam
Settings()
default constructor initializing default settings
int numRows() const
returns number of rows
void _performOptIRStableBoosted(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minIRRoundsRemaining, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error, bool &needNewBoostedIt)
solves current problem with iterative refinement and recovery mechanism using boosted solver
bool getBasisInverseTimesVecRational(const SVectorRational &rhs, SSVectorRational &sol)
computes solution of basis matrix B * sol = rhs; performs rational factorization if not available; re...
bool _isSolveStopped(bool &stoppedTime, bool &stoppedIter) const
should solving process be stopped?
SPxLeastSqSC< BP > _boostedScalerLeastsq
@ STARTER_VECTOR
generic solution-based crash basis
@ STARTER_WEIGHT
greedy crash basis weighted by objective, bounds, and sides
@ STARTER_SUM
crash basis from a greedy solution
bool getDualNorms(int &nnormsRow, int &nnormsCol, R *norms) const
gets steepest edge norms and returns false if they are not available
@ CHECKMODE_REAL
floating-point check
@ CHECKMODE_RATIONAL
rational check
@ CHECKMODE_AUTO
decide according to READMODE
void _changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol and adjusts basis
SPxSolverBase< R >::Status _solveRealForRational(bool fromscratch, VectorBase< R > &primal, VectorBase< R > &dual, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols)
solves real LP during iterative refinement
void _untransformFeasibility(SolRational &sol, bool infeasible)
undoes transformation to feasibility problem
void _computeDualViolation(SolRational &sol, Rational &dualViolation, const bool &maximizing)
computes dual violation during the refinement loop
@ OBJSENSE_MAXIMIZE
maximization
@ OBJSENSE_MINIMIZE
minimization
bool getRowViolation(R &maxviol, R &sumviol)
gets violation of constraints; returns true on success
void _resolveWithoutPreprocessing(typename SPxSimplifier< R >::Result simplificationStatus)
loads original problem into solver and solves again after it has been solved to optimality with prepr...
R objValueReal()
returns the objective value if a primal solution is available
void _removeRowsReal(int idx[], int n, int perm[])
remove all rows with indices in array idx of size n; an array perm of size numRows() may be passed as...
bool _setupBoostedSolverAfterRecovery()
setup recovery mecanism using multiprecision, return false if maximum precision reached,...
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 getObjReal(VectorBase< R > &obj) const
gets objective function vector
void _updateBoostingStatistics()
void _storeLPReal()
stores objective, bounds, and sides of real LP
Real solveTime() const
time spent in last call to solve
void _storeRealSolutionAsRational(SolRational &sol, VectorBase< T > &primalReal, VectorBase< T > &dualReal, int &dualSize)
stores floating-point solution of original LP as current rational solution and ensure that solution v...
VectorBase< R > _manualRhs
bool multBasisTranspose(R *vec, bool unscale=true)
multiply with transpose of basis matrix; vec * B^T (inplace)
void _removeRowReal(int i)
removes row i and adjusts basis
void _rangeToPerm(int start, int end, int *perm, int permSize) const
creates a permutation for removing rows/columns from a range of indices
void changeColRational(int i, const LPColRational &lpcol)
replaces column i with lpcol
void setTimings(const Timer::TYPE ttype)
set statistic timers to a certain type
SPxWeightST< R > _starterWeight
const VectorBase< R > & lhsRealInternal() const
returns left-hand side vector, ignoring scaling
bool _isBoostedConsistent() const
checks consistency for the boosted solver
R coefReal(int row, int col) const
returns (unscaled) coefficient
VectorRational _unboundedLhs
bool getSlacksReal(VectorBase< R > &vector)
gets the vector of slack values if available; returns true on success
DataArray< typename SPxSolverBase< BP >::VarStatus > _tmpBasisStatusRows
SPxDantzigPR< BP > _boostedPricerDantzig
void _removeColsReal(int idx[], int n, int perm[])
remove all columns with indices in array idx of size n; an array perm of size numColsReal() may be pa...
SPxEquiliSC< R > _scalerBiequi
@ OPTTOL
dual feasibility tolerance
@ FPOPTTOL
working tolerance for optimality in floating-point solver during iterative refinement
@ PRECISION_BOOSTING_FACTOR
factor by which the precision of the floating-point solver is multiplied
@ SPARSITY_THRESHOLD
sparse pricing threshold (#violations < dimension * SPARSITY_THRESHOLD activates sparse pricing)
@ LIFTMAXVAL
upper threshold in lifting (nonzero matrix coefficients with larger absolute value will be reformulat...
@ EPSILON_ZERO
general zero tolerance
@ EPSILON_FACTORIZATION
zero tolerance used in factorization
@ OBJLIMIT_UPPER
upper limit on objective value
@ FPFEASTOL
working tolerance for feasibility in floating-point solver during iterative refinement
@ RATREC_FREQ
geometric frequency at which to apply rational reconstruction
@ MAXSCALEINCR
maximum increase of scaling factors between refinements
@ TIMELIMIT
time limit in seconds (INFTY if unlimited)
@ LIFTMINVAL
lower threshold in lifting (nonzero matrix coefficients with smaller absolute value will be reformula...
@ REPRESENTATION_SWITCH
threshold on number of rows vs. number of columns for switching from column to row representations in...
@ REFAC_UPDATE_FILL
refactor threshold for fill-in in current factor update compared to fill-in in last factorization
@ REALPARAM_COUNT
number of real parameters
@ MINRED
minimal reduction (sum of removed rows/cols) to continue simplification
@ OBJ_OFFSET
objective offset
@ OBJLIMIT_LOWER
lower limit on objective value
@ FEASTOL
primal feasibility tolerance
@ EPSILON_PIVOT
pivot zero tolerance used in factorization
@ MIN_MARKOWITZ
minimal Markowitz threshold to control sparsity/stability in LU factorization
@ REFAC_MEM_FACTOR
refactor threshold for memory growth in factorization since last refactorization
@ SIMPLIFIER_MODIFYROWFAC
minimal modification threshold to apply presolve reductions
@ EPSILON_UPDATE
zero tolerance used in update of the factorization
@ REFAC_BASIS_NNZ
refactor threshold for nonzeros in last factorized basis matrix compared to updated basis matrix
@ LEASTSQ_ACRCY
accuracy of conjugate gradient method in least squares scaling (higher value leads to more iterations...
@ INFTY
infinity threshold
bool getDualViolation(R &maxviol, R &sumviol)
gets violation of dual multipliers; returns true on success
void _enableSimplifierAndScaler()
enables simplifier and scaler according to current parameters
void _verifyObjLimitReal()
verify computed obj stop and resolve if necessary
bool getSlacksReal(R *p_vector, int dim)
DataArray< typename SPxSolverBase< R >::VarStatus > _basisStatusRows
SoPlexBase()
default constructor
void changeLhsReal(const VectorBase< R > &lhs)
changes left-hand side vector for constraints to lhs
void addRowsRational(const LPRowSetRational &lprowset)
adds multiple rows
@ TIMER_WALLCLOCK
wallclock time
@ TIMER_CPU
cpu or user time
@ TIMER_OFF
disable timing
void changeRhsRational(const VectorRational &rhs)
changes right-hand side vector to rhs
IntParam
integer parameters
@ HYPER_PRICING
mode for hyper sparse pricing
@ DISPLAYFREQ
display frequency
@ CHECKMODE
mode for a posteriori feasibility checks
@ STATTIMER
type of timer for statistics
@ FACTOR_UPDATE_TYPE
type of LU update
@ READMODE
mode for reading LP files
@ STALLREFLIMIT
stalling refinement limit (-1 if unlimited)
@ STARTER
type of starter used to create crash basis
@ STORE_BASIS_SIMPLEX_FREQ
@ REFLIMIT
refinement limit (-1 if unlimited)
@ SYNCMODE
mode for synchronizing real and rational LP
@ LEASTSQ_MAXROUNDS
maximum number of conjugate gradient iterations in least square scaling
@ ALGORITHM
type of algorithm, i.e., primal or dual
@ INTPARAM_COUNT
number of integer parameters
@ OBJSENSE
objective sense
@ SIMPLIFIER
type of simplifier
@ PRINTBASISMETRIC
print condition number during the solve
@ REPRESENTATION
type of computational form, i.e., column or row representation
@ SOLVEMODE
mode for iterative refinement strategy
@ RATFAC_MINSTALLS
minimum number of stalling refinements since last pivot to trigger rational factorization
@ SOLUTION_POLISHING
mode for solution polishing
@ FACTOR_UPDATE_MAX
maximum number of updates without fresh factorization
@ ITERLIMIT
iteration limit (-1 if unlimited)
@ RATIOTESTER
type of ratio test
@ VERBOSITY
verbosity level
DSVectorRational _tauColVector
int numRefinements() const
number of iterative refinements
void _removeColReal(int i)
removes column i
void changeUpperRational(const VectorRational &upper)
changes vector of upper bounds to upper
void _convertDataArrayVarStatusToRPrecision(DataArray< typename SPxSolverBase< BP >::VarStatus > &base, DataArray< typename SPxSolverBase< R >::VarStatus > ©)
void _addColReal(const LPColReal &lpcol)
adds a single column to the real LP and adjusts basis
DataArray< typename SPxSolverBase< R >::VarStatus > _storedBasisStatusRows
bool getDualRational(mpq_t *vector, const int size)
gets the dual solution vector if available; returns true on success (GMP only method)
void changeElementRational(int i, int j, const Rational &val)
changes matrix entry in row i and column j to val
LPRowRational::Type rowTypeRational(int i) const
returns inequality type of row i
void getObjRational(int i, Rational &obj) const
gets objective value of column i
const char * getStarterName()
name of starter
void _storeBasis()
store basis
void _ensureRealLPLoaded()
ensures that the real LP and the basis are loaded in the solver; performs no sync
void changeLhsRational(int i, const mpq_t *lhs)
changes left-hand side of row i to lhs (GMP only method)
const Rational & upperRational(int i) const
returns upper bound of column i
bool getSlacksRational(mpq_t *vector, const int size)
gets the vector of slack values if available; returns true on success (GMP only method)
VectorRational _unboundedLower
bool getBasisInverseRowReal(int r, R *coef, int *inds=nullptr, int *ninds=nullptr, bool unscale=true)
computes row r of basis inverse; returns true on success
void printSolvingStatistics(std::ostream &os)
prints statistics on solving process
const VectorBase< R > & maxObjRealInternal() const
returns objective function vector after transformation to a maximization problem; since this is how i...
void _updateReducedCosts(SolRational &sol, int &dualSize, const int &numCorrectedPrimals)
updates or recomputes reduced cost values depending on which looks faster; adding one to the length o...
int numRowsRational() const
bool checkBasisDualFeasibility(VectorBase< R > feasVec)
checks the dual feasibility of the current basis
void _updateSlacks(SolRational &sol, int &primalSize)
updates or recomputes slacks depending on which looks faster
bool getSlacksRational(VectorRational &vector)
gets the vector of slack values if available; returns true on success
const SVectorBase< R > & rowVectorRealInternal(int i) const
returns vector of row i, ignoring scaling
const VectorBase< R > & lowerRealInternal() const
returns lower bound vector
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-...
bool getBasisInverseTimesVecReal(R *rhs, R *sol, bool unscale=true)
computes dense solution of basis matrix B * sol = rhs; returns true on success
void _applyScaledObj(SPxSolverBase< T > &solver, Rational &dualScale, SolRational &sol)
applies scaled objective function
void _syncLPReal(bool time=true)
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP,...
void _recomputeRangeTypesRational()
recomputes range types from scratch using rational LP
int numIterations() const
number of iterations since last call to solve
const SVectorBase< R > & colVectorRealInternal(int i) const
returns vector of col i, ignoring scaling
bool setDualNorms(int nnormsRow, int nnormsCol, R *norms)
sets steepest edge norms and returns false if that's not possible
bool _factorSolNewBasisPrecBoost
SPxGeometSC< R > _scalerGeo1
void addRowsReal(const LPRowSetBase< R > &lprowset)
adds multiple rows
void changeBoundsReal(int i, const R &lower, const R &upper)
changes bounds of column i to lower and upper
bool getPrimalRayReal(R *vector, int dim)
void _solveRealForRationalStable(SolRational &sol, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
solves current problem using double floating-point solver
bool parseSettingsString(char *str)
parses one setting string and returns true on success; note that string is modified
int numNonzerosRational() const
const SVectorRational & rowVectorRational(int i) const
returns vector of row i
number< gmp_float< 50 >, et_off > BP
SPxLPBase< R > _manualRealLP
void changeColReal(int i, const LPColReal &lpcol)
replaces column i with lpcol
void changeObjRational(int i, const Rational &obj)
changes objective coefficient of column i to obj
void _changeBoundsReal(int i, const R &lower, const R &upper)
changes bounds of column i to lower and upper and adjusts basis
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...
SPxHarrisRT< BP > _boostedRatiotesterHarris
void clearLPRational()
clears the LP
void printStatus(std::ostream &os, typename SPxSolverBase< R >::Status status)
prints status
void changeRhsRational(const mpq_t *rhs, int rhsSize)
changes right-hand side vector to rhs (GMP only method)
bool getBasisInverseColReal(int c, R *coef, int *inds=nullptr, int *ninds=nullptr, bool unscale=true)
computes column c of basis inverse; returns true on success
void removeColRational(int i)
removes column i
void getBasis(typename SPxSolverBase< R >::VarStatus rows[], typename SPxSolverBase< R >::VarStatus cols[]) const
gets current basis via arrays of statuses
void _syncRealSolution()
synchronizes rational solution with real solution, i.e., copies (rounded) rational solution to real s...
int numColsRational() const
void addColReal(const LPColBase< R > &lpcol)
adds a single column
void getRowRational(int i, LPRowRational &lprow) const
gets row i
void _changeLhsReal(const VectorBase< R > &lhs)
changes left-hand side vector for constraints to lhs and adjusts basis
@ SYNCMODE_MANUAL
user sync of real and rational LP
@ SYNCMODE_ONLYREAL
store only real LP
@ SYNCMODE_AUTO
automatic sync of real and rational LP
bool boolParam(const BoolParam param) const
returns boolean parameter value
const Rational & lowerRational(int i) const
returns lower bound of column i
int dmaxSizeDualRational(const int base=2)
get size of largest denominator in dual solution
SPxParMultPR< R > _pricerParMult
const char * getPricerName()
name of currently loaded pricer
void addColsRational(const LPColSetRational &lpcolset)
adds multiple columns
void changeElementReal(int i, int j, const R &val)
changes matrix entry in row i and column j to val
void changeRangeReal(int i, const R &lhs, const R &rhs)
changes left- and right-hand side of row i
void getColRational(int i, LPColRational &lpcol) const
gets column i
void printUserSettings()
print non-default parameter values
bool _loadBasisFromOldBasis(bool boosted)
void _computePrimalScalingFactor(Rational &maxScale, Rational &primalScale, Rational &boundsViolation, Rational &sideViolation, Rational &redCostViolation)
computes primal scaling factor; limit increase in scaling by tolerance used in floating point solve
VectorRational _feasLower
void _correctDualSolution(SPxSolverBase< T > &solver, SolRational &sol, const bool &maximizing, VectorBase< T > &dualReal, Rational &dualScale, int &dualSize, const int &maxDimRational)
corrects dual solution and aligns with basis
SPxAutoPR< BP > _boostedPricerAuto
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,...
void _loadRealLP(bool initBasis)
load original LP and possibly setup a slack basis
const std::shared_ptr< Tolerances > tolerances() const
returns current tolerances
bool hasDual() const
deprecated: use hasSol() instead
bool getDualFarkasReal(R *vector, int dim)
void changeUpperRational(int i, const mpq_t *upper)
changes upper bound of column i to upper (GMP only method)
void addRowsRational(const mpq_t *lhs, const mpq_t *rowValues, const int *rowIndices, const int *rowStarts, const int *rowLengths, const int numRows, const int numValues, const mpq_t *rhs)
adds a set of rows (GMP only method)
void _solveRealLPAndRecordStatistics(volatile bool *interrupt=nullptr)
call floating-point solver and update statistics on iterations etc.
void _changeBoundsReal(const VectorBase< R > &lower, const VectorBase< R > &upper)
changes vectors of column bounds to lower and upper and adjusts basis
void _completeRangeTypesRational()
completes range type arrays after adding columns and/or rows
void changeUpperReal(const VectorBase< R > &upper)
changes vector of upper bounds to upper
Rational _rationalNegInfty
void _invalidateSolution()
invalidates solution
void removeRowRangeRational(int start, int end, int perm[]=nullptr)
removes rows start to end including both; an array perm of size numRowsRational() may be passed as bu...
void _optimizeRational(volatile bool *interrupt=nullptr)
temporary fix for Rational
DataArray< RangeType > _colTypes
bool isDualFeasible() const
is stored dual solution feasible?
DataArray< typename SPxSolverBase< R >::VarStatus > _basisStatusCols
void _transformFeasibility()
transforms LP to feasibility problem by removing the objective function, shifting variables,...
bool getBasisMetric(R &metric, int type=0)
SPxDantzigPR< R > _pricerDantzig
Presol< R > _simplifierPaPILO
SPxGeometSC< BP > _boostedScalerGeo8
bool getEstimatedCondition(R &condition)
computes an estimated condition number for the current basis matrix using the power method; returns t...
R lowerReal(int i) const
returns lower bound of column i
void removeRowRational(int i)
removes row i
void _optimize(volatile bool *interrupt=nullptr)
solves the templated LP
SPxParMultPR< BP > _boostedPricerParMult
bool getPrimalRational(VectorRational &vector)
int totalSizeDualRational(const int base=2)
get size of dual solution
int dlcmSizeDualRational(const int base=2)
get size of least common multiple of denominators in dual solution
SPxSteepPR< R > _pricerQuickSteep
void _project(SolRational &sol)
undoes lifting
bool getRedCostViolation(R &maxviol, R &sumviol)
gets violation of reduced costs; returns true on success
SPxSolverBase< R >::Status optimize(volatile bool *interrupt=nullptr)
optimize the given LP
SPxSolverBase< R >::Status solve(volatile bool *interrupt=nullptr)
void addColRational(const LPColRational &lpcol)
adds a single column
DSVectorRational _primalDualDiff
DataArray< typename SPxSolverBase< R >::VarStatus > _storedBasisStatusCols
void _computeDualScalingFactor(Rational &maxScale, Rational &primalScale, Rational &dualScale, Rational &redCostViolation, Rational &dualViolation)
computes dual scaling factor; limit increase in scaling by tolerance used in floating point solve
SPxSumST< R > _starterSum
bool ignoreUnscaledViolations()
sets the status to OPTIMAL in case the LP has been solved with unscaled violations
bool getDualFarkas(VectorBase< R > &vector)
gets the Farkas proof if available; returns true on success
bool getDualFarkasRational(mpq_t *vector, const int size)
gets the Farkas proof if LP is infeasible; returns true on success (GMP only method)
bool readBasisFile(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr)
reads basis information from filename and returns true on success; if rowNames and colNames are nullp...
SLUFactor< R > _slufactor
int numCols() const
Templated function that returns number of columns.
void _applyScaledBounds(SPxSolverBase< T > &solver, Rational &primalScale)
applies scaled bounds
bool _lowerFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite lower bound
SPxDevexPR< R > _pricerDevex
void _checkRefinementProgress(Rational &boundsViolation, Rational &sideViolation, Rational &redCostViolation, Rational &dualViolation, Rational &maxViolation, Rational &bestViolation, const Rational &violationImprovementFactor, int &numFailedRefinements)
checks refinement loop progress
void changeObjReal(int i, const R &obj)
changes objective coefficient of column i to obj
bool readFile(const char *filename, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
reads LP file in LP or MPS format according to READMODE parameter; gets row names,...
Rational objRational(int i) const
returns objective value of column i
VectorBase< R > _manualObj
SLUFactorRational _rationalLUSolver
void setRandomSeed(unsigned int seed)
set the random seeds of the solver instance
void _computeInfeasBox(SolRational &sol, bool transformed)
void printStatistics(std::ostream &os)
prints complete statistics
void writeStateReal(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const bool cpxFormat=false, const bool writeZeroObjective=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are nullptr,...
void _applyScaledSides(SPxSolverBase< T > &solver, Rational &primalScale)
applies scaled sides
int intParam(const IntParam param) const
returns integer parameter value
void changeBoundsRational(const VectorRational &lower, const VectorRational &upper)
changes vectors of column bounds to lower and upper
void _untransformEquality(SolRational &sol)
undoes transformation to equality form
@ SIMPLIFIER_INTERNAL
using internal presolving methods
@ SIMPLIFIER_PAPILO
using the presolve lib papilo
@ SIMPLIFIER_AUTO
SoPlex chooses automatically (currently always "internal")
@ SIMPLIFIER_OFF
disabling presolving
void removeRowsReal(int idx[], int n, int perm[]=nullptr)
remove all rows with indices in array idx of size n; an array perm of size numRows() may be passed as...
Real _epsPivotPrecisionRatio
const char * getRatiotesterName()
name of currently loaded ratiotester
Rational objValueRational()
returns the objective value if a primal solution is available
void _solveRealForRationalBoosted(VectorBase< BP > &primal, VectorBase< BP > &dual, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, typename SPxSolverBase< BP >::Status &boostedResult, bool initialSolve)
solves real LP during iterative refinement
Real realParam(const RealParam param) const
returns real parameter value
int totalSizePrimalRational(const int base=2)
get size of primal solution
bool getBoundViolation(R &maxviol, R &sumviol)
gets violation of bounds; returns true on success
bool getBoundViolationRational(Rational &maxviol, Rational &sumviol)
void changeRangeRational(int i, const mpq_t *lhs, const mpq_t *rhs)
changes left- and right-hand side of row i (GMP only method)
void changeObjRational(int i, const mpq_t *obj)
changes objective coefficient of column i to obj (GMP only method)
bool _upperFinite(const RangeType &rangeType) const
checks whether RangeType corresponds to finite upper bound
bool saveSettingsFile(const char *filename, const bool onlyChanged=false, int solvemode=1) const
writes settings file; returns true on success
SPxEquiliSC< BP > _boostedScalerBiequi
void changeRhsRational(int i, const Rational &rhs)
changes right-hand side of row i to rhs
SPxVectorST< R > _starterVector
void _convertDataArrayVarStatusToBoosted(DataArray< typename SPxSolverBase< R >::VarStatus > &base, DataArray< typename SPxSolverBase< BP >::VarStatus > ©)
SPxBoundFlippingRT< BP > _boostedRatiotesterBoundFlipping
void removeRowsRational(int idx[], int n, int perm[]=nullptr)
remove all rows with indices in array idx of size n; an array perm of size numRowsRational() may be p...
void _performOptIRStable(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minIRRoundsRemaining, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
solves current problem with iterative refinement and recovery mechanism
void _forceNonbasicToBound(SolRational &sol, int &c, const int &maxDimRational, bool toLower)
forces value of given nonbasic variable to bound
void _changeRangeReal(const VectorBase< R > &lhs, const VectorBase< R > &rhs)
changes left- and right-hand side vectors and adjusts basis
void _transformUnbounded()
transforms LP to unboundedness problem by moving the objective function to the constraints,...
void setBasis(const typename SPxSolverBase< R >::VarStatus rows[], const typename SPxSolverBase< R >::VarStatus cols[])
sets starting basis via arrays of statuses
std::shared_ptr< Tolerances > _tolerances
void _changeLowerReal(const VectorBase< R > &lower)
changes vector of lower bounds to lower and adjusts basis
void _changeUpperReal(const VectorBase< R > &upper)
changes vector of upper bounds to upper and adjusts basis
void removeColReal(int i)
removes column i
int dlcmSizePrimalRational(const int base=2)
get size of least common multiple of denominators in primal solution
void _computeBasisInverseRational()
computes rational inverse of basis matrix as defined by _rationalLUSolverBind
void _computeSidesViolation(SolRational &sol, Rational &sideViolation)
computes violation of sides during the refinement loop
R objReal(int i) const
returns objective value of column i
VectorRational _unboundedRhs
@ SCALER_GEOEQUI
geometric mean scaling (max 8 rounds) followed by equilibrium scaling (rows and columns)
@ SCALER_UNIEQUI
equilibrium scaling on rows or columns
@ SCALER_BIEQUI
equilibrium scaling on rows and columns
@ SCALER_LEASTSQ
least square scaling
@ SCALER_GEO1
geometric mean scaling on rows and columns, max 1 round
@ SCALER_GEO8
geometric mean scaling on rows and columns, max 8 rounds
SLUFactor< BP > _boostedSlufactor
DataArray< typename SPxSolverBase< R >::VarStatus > _oldFeasBasisStatusRows
void _performUnboundedIRStable(SolRational &sol, bool &hasUnboundedRay, bool &stoppedTime, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing unboundedness
bool getPrimal(VectorBase< R > &vector)
gets the primal solution vector if available; returns true on success
bool _readFileReal(const char *filename, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
reads real LP in LP or MPS format from file and returns true on success; gets row names,...
Settings * _currentSettings
void _switchToBoosted()
disable initial precision solver and switch to boosted solver
Presol< BP > _boostedSimplifierPaPILO
unsigned int randomSeed() const
returns the current random seed of the solver instance
SPxAutoPR< R > _pricerAuto
bool getExactCondition(R &condition)
computes the exact condition number for the current basis matrix using the power method; returns true...
void writeStateRational(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const bool cpxFormat=false, const bool writeZeroObjective=false) const
writes internal LP, basis information, and parameter settings; if rowNames and colNames are nullptr,...
Real _tolPrecisionRatio
ratios for computing the tolerances for precision boosting ratio denotes the proportion of precision ...
void _changeUpperReal(int i, const R &upper)
changes i 'th upper bound to upper and adjusts basis
void changeLowerRational(const VectorRational &lower)
changes vector of lower bounds to lower
void _solveBoostedRealLPAndRecordStatistics(volatile bool *interrupt=nullptr)
call floating-point solver and update statistics on iterations etc.
void changeRowReal(int i, const LPRowBase< R > &lprow)
replaces row i with lprow
void _recomputeRangeTypesReal()
recomputes range types from scratch using real LP
int numIterationsBoosted() const
number of iterations in higher precision since last call to solve
SPxSteepExPR< R > _pricerSteep
bool getBasisInverseColRational(const int c, SSVectorRational &vec)
computes column c of basis inverse; performs rational factorization if not available; returns true on...
void _checkScaling(SPxLPBase< R > *origLP) const
check scaling of LP
void _solveRealForRationalBoostedStable(SolRational &sol, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error, bool &needNewBoostedIt)
solves current problem using multiprecision floating-point solver return false if a new boosted itera...
void removeRowReal(int i)
removes row i
DataArray< RangeType > _rowTypes
SPxDefaultRT< R > _ratiotesterTextbook
void _storeLastStableBasisBoosted(bool vanished)
SPxSolverBase< R >::VarStatus basisRowStatus(int row) const
returns basis status for a single row
void _restoreLPReal()
restores objective, bounds, and sides of real LP
SPxMainSM< BP > _boostedSimplifierMainSM
bool setBoolParam(const BoolParam param, const bool value, const bool init=true)
sets boolean parameter value; returns true on success
void changeLowerReal(const VectorBase< R > &lower)
changes vector of lower bounds to lower
void printSolutionStatistics(std::ostream &os)
prints solution statistics
void changeUpperReal(int i, const R &upper)
changes i 'th upper bound to upper
const Rational & maxObjRational(int i) const
returns objective value of column i after transformation to a maximization problem; since this is how...
void printShortStatistics(std::ostream &os)
prints short statistics
const Rational & lhsRational(int i) const
returns left-hand side of row i
int dmaxSizePrimalRational(const int base=2)
get size of largest denominator in primal solution
void changeUpperRational(int i, const Rational &upper)
changes i 'th upper bound to upper
bool getRedCost(VectorBase< R > &vector)
gets the vector of reduced cost values if available; returns true on success
SPxBoundFlippingRT< R > _ratiotesterBoundFlipping
bool getRedCostReal(R *vector, int dim)
void _syncLPRational(bool time=true)
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, without looking at the sy...
bool _isBoostedStartingFromSlack(bool initialSolve=true)
return true if slack basis has to be loaded for boosted solver
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 removeColRangeReal(int start, int end, int perm[]=nullptr)
removes columns start to end including both; an array perm of size numColsReal() may be passed as buf...
const char * getSimplifierName()
name of simplifier
const SVectorRational & colVectorRational(int i) const
returns vector of column i
void _syncRationalSolution()
synchronizes real solution with rational solution, i.e., copies real solution to rational solution
void _storeLastStableBasis(bool vanished)
void _changeLhsReal(int i, const R &lhs)
changes left-hand side of row i to lhs and adjusts basis
SPxSteepExPR< BP > _boostedPricerSteep
VectorRational _unboundedUpper
SPxSolverBase< R >::Status _status
void changeElementRational(int i, int j, const mpq_t *val)
changes matrix entry in row i and column j to val (GMP only method)
void _removeRowRangeReal(int start, int end, int perm[])
removes rows start to end including both; an array perm of size numRows() may be passed as buffer mem...
void changeBoundsRational(int i, const Rational &lower, const Rational &upper)
changes bounds of column i to lower and upper
RangeType _switchRangeType(const RangeType &rangeType) const
switches RANGETYPE_LOWER to RANGETYPE_UPPER and vice versa
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
bool _evaluateResult(SPxSolverBase< T > &solver, typename SPxSolverBase< T >::Status result, bool usingRefinedLP, SolRational &sol, VectorBase< T > &dualReal, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
evaluates result of solve. Return true if the algorithm must to stopped, false otherwise.
@ ALGORITHM_PRIMAL
primal simplex algorithm, i.e., entering for column and leaving for row representation
@ ALGORITHM_DUAL
dual simplex algorithm, i.e., leaving for column and entering for row representation
void _factorizeColumnRational(SolRational &sol, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, bool &stoppedTime, bool &stoppedIter, bool &error, bool &optimal)
factorizes rational basis matrix in column representation
void syncLPReal()
synchronizes real LP with rational LP, i.e., copies (rounded) rational LP into real LP,...
void _transformEquality()
introduces slack variables to transform inequality constraints into equations for both rational and r...
void clearBasis()
clears starting basis
SPxScaler< BP > * _boostedScaler
DataArray< int > _rationalLUSolverBind
Real _epsZeroPrecisionRatio
SPxGeometSC< R > _scalerGeo8
void _ratrecAndOrRatfac(int &minIRRoundsRemaining, int &lastStallIterations, int &numberOfIterations, bool &factorSolNewBasis, int &nextRatrec, const Rational &errorCorrectionFactor, Rational &errorCorrection, Rational &maxViolation, SolRational &sol, bool &primalFeasible, bool &dualFeasible, bool &stoppedTime, bool &stoppedIter, bool &error, bool &breakAfter, bool &continueAfter)
performs rational reconstruction and/or factorizationd
std::string statisticString() const
statistical information in form of a string
void _ensureRationalLP()
ensures that the rational LP is available; performs no sync
DataArray< typename SPxSolverBase< R >::VarStatus > _oldBasisStatusRows
VectorBase< R > _manualLhs
void changeBoundsReal(const VectorBase< R > &lower, const VectorBase< R > &upper)
changes vectors of column bounds to lower and upper
void changeBoundsRational(int i, const mpq_t *lower, const mpq_t *upper)
changes bounds of column i to lower and upper (GMP only method)
void getNdualNorms(int &nnormsRow, int &nnormsCol) const
gets number of available dual norms
SPxSolverBase< BP > _boostedSolver
void changeLhsRational(const VectorRational &lhs)
changes left-hand side vector for constraints to lhs
bool _isConsistent() const
checks consistency
void changeRowRational(int i, const LPRowRational &lprow)
replaces row i with lprow
void _addRowReal(const LPRowBase< R > &lprow)
adds a single row to the real LP and adjusts basis
void getUpperReal(VectorBase< R > &upper) const
gets upper bound vector
VectorBase< R > _manualLower
SoPlexBase< R > & operator=(const SoPlexBase< R > &rhs)
assignment operator
const VectorRational & maxObjRational() const
returns objective function vector after transformation to a maximization problem; since this is how i...
bool hasPrimalRay() const
is a primal unbounded ray available?
bool getDual(VectorBase< R > &vector)
gets the dual solution vector if available; returns true on success
SPxSimplifier< BP > * _boostedSimplifier
void resetSettings(const bool quiet=false, const bool init=true)
resets default parameter settings
bool hasPrimal() const
deprecated: use hasSol() instead
void changeObjReal(const VectorBase< R > &obj)
changes objective function vector to obj
bool writeFile(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool unscale=true, const bool writeZeroObjective=false) const
Templated write function Real writes real LP to file; LP or MPS format is chosen from the extension i...
Rational maxAbsNonzeroRational() const
returns biggest non-zero element in absolute value
@ POLISHING_FRACTIONALITY
minimize number of basic slack variables, i.e. more variables between bounds
@ POLISHING_OFF
no solution polishing
@ POLISHING_INTEGRALITY
maximize number of basic slack variables, i.e. more variables on bounds
void _correctPrimalSolution(SolRational &sol, Rational &primalScale, int &primalSize, const int &maxDimRational, VectorBase< T > &primalReal)
corrects primal solution and aligns with basis
Array< UnitVectorRational * > _unitMatrixRational
void _switchToStandardMode()
indicate if we are testing feasibility, unboundedness or neither
void _preprocessAndSolveReal(bool applyPreprocessing, volatile bool *interrupt=nullptr)
solves real LP with/without preprocessing
@ RATIOTESTER_TEXTBOOK
textbook ratio test without stabilization
@ RATIOTESTER_FAST
modified Harris ratio test
@ RATIOTESTER_HARRIS
standard Harris ratio test
@ RATIOTESTER_BOUNDFLIPPING
bound flipping ratio test for long steps in the dual simplex
VectorBase< R > _manualUpper
R maxObjReal(int i) const
returns objective value of column i after transformation to a maximization problem; since this is how...
void _unscaleSolutionReal(SPxLPBase< R > &LP, bool persistent=true)
unscales stored solution to remove internal or external scaling of LP
bool _reapplyPersistentScaling() const
check whether persistent scaling is supposed to be reapplied again after unscaling
void removeRowsReal(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
bool _inStandardMode()
check if we are testing feasibility, unboundedness or neither
int numNonzeros() const
returns number of nonzeros
void _changeRhsReal(const VectorBase< R > &rhs)
changes right-hand side vector to rhs and adjusts basis
bool _readFileRational(const char *filename, NameSet *rowNames=nullptr, NameSet *colNames=nullptr, DIdxSet *intVars=nullptr)
reads rational LP in LP or MPS format from file and returns true on success; gets row names,...
SoPlexBase(const SoPlexBase< R > &rhs)
copy constructor
const VectorBase< R > & rhsRealInternal() const
returns right-hand side vector, ignoring scaling
void changeLowerRational(int i, const mpq_t *lower)
changes lower bound of column i to lower (GMP only method)
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 _addRowReal(R lhs, const SVectorBase< R > &lprow, R rhs)
adds a single row to the real LP and adjusts basis
bool getBasisInverseRowRational(const int r, SSVectorRational &vec)
computes row r of basis inverse; performs rational factorization if not available; returns true on su...
SPxLeastSqSC< R > _scalerLeastsq
bool getPrimalRayRational(mpq_t *vector, const int size)
gets the primal ray if LP is unbounded; returns true on success (GMP only method)
bool getPrimalRayRational(VectorRational &vector)
void _storeBasisAsOldBasisBoosted(DataArray< typename SPxSolverBase< BP >::VarStatus > &rows, DataArray< typename SPxSolverBase< BP >::VarStatus > &cols)
SPxGeometSC< BP > _boostedScalerGeo1
void printVersion() const
prints version and compilation options
Statistics * _statistics
statistics since last call to solveReal() or solveRational()
SPxSolverBase< R > _solver
bool _boostPrecision()
increase the multiprecision, return false if maximum precision is reached, true otherwise
SPxDevexPR< BP > _boostedPricerDevex
void syncLPRational()
synchronizes rational LP with real LP, i.e., copies real LP to rational LP, if sync mode is manual
bool writeFileReal(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool unscale=true, const bool writeZeroObjective=false) const
bool writeFileRational(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool writeZeroObjective=false) const
void clearLPReal()
clears the LP
@ HYPER_PRICING_AUTO
decide according to problem size
void getColVectorReal(int i, DSVectorBase< R > &col) const
gets vector of col i
bool hasDualFarkas() const
is Farkas proof of infeasibility available?
SPxLPRational * _rationalLP
void _changeRangeReal(int i, const R &lhs, const R &rhs)
changes left- and right-hand side of row i and adjusts basis
VectorRational _feasUpper
void getColsRational(int start, int end, LPColSetRational &lpcolset) const
gets columns start, ..., end
@ READMODE_REAL
standard floating-point parsing
@ READMODE_RATIONAL
rational parsing
@ FACTOR_UPDATE_TYPE_ETA
product form update
@ FACTOR_UPDATE_TYPE_FT
Forrest-Tomlin type update.
bool setSettings(const Settings &newSettings, const bool init=true)
sets parameter settings; returns true on success
bool getRedCostRational(mpq_t *vector, const int size)
gets the vector of reduced cost values if available; returns true on success (GMP only method)
@ PRICER_DEVEX
devex pricer
@ PRICER_STEEP
steepest edge pricer with exact initialization of norms
@ PRICER_QUICKSTEEP
steepest edge pricer with initialization to unit norms
@ PRICER_PARMULT
partial multiple pricer based on Dantzig pricing
@ PRICER_AUTO
automatic pricer
@ PRICER_DANTZIG
Dantzig pricer.
void _addColsReal(const LPColSetReal &lpcolset)
adds multiple columns to the real LP and adjusts basis
Real _epsUpdatePrecisionRatio
Real _epsFactorPrecisionRatio
void _changeRhsReal(int i, const R &rhs)
changes right-hand side of row i to rhs and adjusts basis
SPxSimplifier< R > * _simplifier
void getRowVectorReal(int i, DSVectorBase< R > &row) const
gets vector of row i
void _storeBasisAsOldBasis(DataArray< typename SPxSolverBase< R >::VarStatus > &rows, DataArray< typename SPxSolverBase< R >::VarStatus > &cols)
void changeLhsReal(int i, const R &lhs)
changes left-hand side of row i to lhs
DataArray< typename SPxSolverBase< R >::VarStatus > _oldUnbdBasisStatusCols
void removeRowsRational(int perm[])
removes all rows with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates the n...
const Settings & settings() const
returns current parameter settings
@ SOLVEMODE_RATIONAL
force iterative refinement
@ SOLVEMODE_REAL
apply standard floating-point algorithm
@ SOLVEMODE_AUTO
decide depending on tolerances whether to apply iterative refinement
LPRowBase< R >::Type rowTypeReal(int i) const
returns inequality type of row i
SPxFastRT< R > _ratiotesterFast
SPxDefaultRT< BP > _boostedRatiotesterTextbook
SPxFastRT< BP > _boostedRatiotesterFast
void _resetBoostedPrecision()
reset the boosted precision to the default value
Rational _rationalFeastol
const VectorRational & lhsRational() const
returns left-hand side vector
void changeObjRational(const VectorRational &obj)
changes objective function vector to obj
void getLhsReal(VectorBase< R > &lhs) const
gets left-hand side vector
SPxSolverBase< R >::Status status() const
returns the current solver status
bool getDualFarkasRational(VectorRational &vector)
R maxAbsNonzeroReal() const
returns biggest non-zero element in absolute value
SPxBasisBase< R >::SPxStatus basisStatus() const
returns the current basis status
bool isPrimalFeasible() const
is stored primal solution feasible?
void getLowerReal(VectorBase< R > &lower) const
gets lower bound vector
void _performFeasIRStable(SolRational &sol, bool &withDualFarkas, bool &stoppedTime, bool &stoppedIter, bool &error)
performs iterative refinement on the auxiliary problem for testing feasibility
SPxStarter< R > * _starter
void _restoreBasis()
restore basis
SPxSteepPR< BP > _boostedPricerQuickSteep
RangeType _rangeTypeReal(const R &lower, const R &upper) const
determines RangeType from real bounds
bool getPrimalReal(R *p_vector, int size)
bool writeDualFileReal(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const DIdxSet *intvars=nullptr, const bool writeZeroObjective=false) const
writes the dual of the real LP to file; LP or MPS format is chosen from the extension in filename; if...
bool getDualRational(VectorRational &vector)
bool hasBasis() const
is an advanced starting basis available?
void _untransformUnbounded(SolRational &sol, bool unbounded)
undoes transformation to unboundedness problem
bool _boostingLimitReached
void _verifySolutionReal()
verify computed solution and resolve if necessary
void removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
DataArray< typename SPxSolverBase< R >::VarStatus > _oldFeasBasisStatusCols
Real precisionBoostTime() const
time spen in higher precision since last call to solve
virtual ~SoPlexBase()
destructor
SPxSolverBase< R >::Status _solveRealStable(bool acceptUnbounded, bool acceptInfeasible, VectorBase< R > &primal, VectorBase< R > &dual, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, const bool forceNoSimplifier=false)
solves real LP with recovery mechanism
void changeLowerReal(int i, const R &lower)
changes lower bound of column i to lower
void _evaluateSolutionReal(typename SPxSimplifier< R >::Result simplificationStatus)
checks result of the solving process and solves again without preprocessing if necessary
void removeColRangeRational(int start, int end, int perm[]=nullptr)
removes columns start to end including both; an array perm of size numColsRational() may be passed as...
R upperReal(int i) const
returns upper bound of column i
bool setRealParam(const RealParam param, const Real value, const bool init=true)
sets real parameter value; returns true on success
const VectorRational & lowerRational() const
returns lower bound vector
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 _changeElementReal(int i, int j, const R &val)
changes matrix entry in row i and column j to val and adjusts basis
void addRowReal(const LPRowBase< R > &lprow)
adds a single row
void _removeColsReal(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
bool writeBasisFile(const char *filename, const NameSet *rowNames=nullptr, const NameSet *colNames=nullptr, const bool cpxFormat=false) const
writes basis information to filename; if rowNames and colNames are nullptr, default names are used; r...
SPxSolverBase< R >::VarStatus basisColStatus(int col) const
returns basis status for a single column
Rational minAbsNonzeroRational() const
returns smallest non-zero element in absolute value
bool setIntParam(const IntParam param, const int value, const bool init=true)
sets integer parameter value; returns true on success
bool getDualReal(R *p_vector, int dim)
void getRowsRational(int start, int end, LPRowSetRational &lprowset) const
gets rows start, ..., end.
SPxMainSM< R > _simplifierMainSM
bool getDualViolationRational(Rational &maxviol, Rational &sumviol)
@ VERBOSITY_HIGH
high verbosity level
@ VERBOSITY_WARNING
only error and warning output
@ VERBOSITY_DEBUG
only error, warning, and debug output
@ VERBOSITY_NORMAL
standard verbosity level
@ VERBOSITY_ERROR
only error output
@ VERBOSITY_FULL
full verbosity level
void _addRowsReal(const LPRowSetBase< R > &lprowset)
adds multiple rows to the real LP and adjusts basis
int numPrecisionBoosts() const
number of precision boosts since last call to solve
DataArray< typename SPxSolverBase< R >::VarStatus > _oldUnbdBasisStatusRows
void addColsReal(const LPColSetBase< R > &lpcolset)
adds multiple columns
void changeRhsReal(const VectorBase< R > &rhs)
changes right-hand side vector to rhs
const VectorRational & rhsRational() const
returns right-hand side vector
void changeRangeReal(const VectorBase< R > &lhs, const VectorBase< R > &rhs)
changes left- and right-hand side vectors
void addRowRational(const mpq_t *lhs, const mpq_t *rowValues, const int *rowIndices, const int rowSize, const mpq_t *rhs)
adds a single row (GMP only method)
bool computeBasisInverseRational()
compute rational basis inverse; returns true on success
@ REPRESENTATION_AUTO
automatic choice according to number of rows and columns
@ REPRESENTATION_COLUMN
column representation Ax - s = 0, lower <= x <= upper, lhs <= s <= rhs
@ REPRESENTATION_ROW
row representation (lower,lhs) <= (x,Ax) <= (upper,rhs)
bool loadSettingsFile(const char *filename)
reads settings file; returns true on success
void _storeSolutionRealFromPresol()
stores solution from the simplifier because problem vanished in presolving step
const char * getScalerName()
name of scaling method
SPxGeometSC< R > _scalerGeoequi
void addColRational(const mpq_t *obj, const mpq_t *lower, const mpq_t *colValues, const int *colIndices, const int colSize, const mpq_t *upper)
adds a single column (GMP only method)
bool multBasis(R *vec, bool unscale=true)
multiply with basis matrix; B * vec (inplace)
bool _reconstructSolutionRational(SolRational &sol, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusRows, DataArray< typename SPxSolverBase< R >::VarStatus > &basisStatusCols, const Rational &denomBoundSquared)
attempts rational reconstruction of primal-dual solution
void _changeLowerReal(int i, const R &lower)
changes lower bound of column i to lower and adjusts basis
void changeRangeRational(const VectorRational &lhs, const VectorRational &rhs)
changes left- and right-hand side vectors
void removeColsReal(int idx[], int n, int perm[]=nullptr)
remove all columns with indices in array idx of size n; an array perm of size numColsReal() may be pa...
void _addColReal(R obj, R lower, const SVectorBase< R > &lpcol, R upper)
adds a single column to the real LP and adjusts basis
void changeLhsRational(int i, const Rational &lhs)
changes left-hand side of row i to lhs
void _performOptIRWrapper(SolRational &sol, bool acceptUnbounded, bool acceptInfeasible, int minIRRoundsRemaining, bool &primalFeasible, bool &dualFeasible, bool &infeasible, bool &unbounded, bool &stoppedTime, bool &stoppedIter, bool &error)
perform iterative refinement using the right precision
Rational _rationalMaxscaleincr
DataArray< typename SPxSolverBase< R >::VarStatus > _oldBasisStatusCols
void setIntegralityInformation(int ncols, int *intInfo)
pass integrality information about the variables to the solver
void _computeReducedCostViolation(SolRational &sol, Rational &redCostViolation, const bool &maximizing)
computes violation of reduced costs during the refinement loop
R lhsReal(int i) const
returns left-hand side of row i
void addColsRational(const mpq_t *obj, const mpq_t *lower, const mpq_t *colValues, const int *colIndices, const int *colStarts, const int *colLengths, const int numCols, const int numValues, const mpq_t *upper)
adds a set of columns (GMP only method)
bool getPrimalRational(mpq_t *vector, const int size)
gets the primal solution vector if available; returns true on success (GMP only method)
void _computeBoundsViolation(SolRational &sol, Rational &boundsViolation)
computes violation of bounds during the refinement loop
void _disableSimplifierAndScaler()
disables simplifier and scaler
R minAbsNonzeroReal() const
returns smallest non-zero element in absolute value
void getObjRational(VectorRational &obj) const
gets objective function vector
SPxGeometSC< BP > _boostedScalerGeoequi
bool getPrimalRay(VectorBase< R > &vector)
gets the primal ray if available; returns true on success
void removeRowRangeReal(int start, int end, int perm[]=nullptr)
removes rows start to end including both; an array perm of size numRows() may be passed as buffer mem...
SPxHarrisRT< R > _ratiotesterHarris
const Rational & rhsRational(int i) const
returns right-hand side of row i
const UnitVectorRational * _unitVectorRational(const int i)
returns pointer to a constant unit vector available until destruction of the SoPlexBase class
void _changeRowReal(int i, const LPRowBase< R > &lprow)
replaces row i with lprow and adjusts basis
bool getRedCostRational(VectorRational &vector)
void _setupBoostedSolver()
setup boosted solver before launching iteration
R rhsReal(int i) const
returns right-hand side of row i
bool _isRefinementOver(bool &primalFeasible, bool &dualFeasible, Rational &boundsViolation, Rational &sideViolation, Rational &redCostViolation, Rational &dualViolation, int minIRRoundsRemaining, bool &stoppedTime, bool &stoppedIter, int numFailedRefinements)
checks termination criteria for refinement loop
const VectorBase< R > & upperRealInternal() const
returns upper bound vector
bool getRedCostViolationRational(Rational &maxviol, Rational &sumviol)
bool hasSol() const
is a solution available (not neccessarily feasible)?
SPxEquiliSC< BP > _boostedScalerUniequi
LPColSetRational _slackCols
void changeRhsReal(int i, const R &rhs)
changes right-hand side of row i to rhs
void _idxToPerm(int *idx, int idxSize, int *perm, int permSize) const
creates a permutation for removing rows/columns from an array of indices
void changeRangeRational(int i, const Rational &lhs, const Rational &rhs)
changes left- and right-hand side of row i
void _lift()
reduces matrix coefficient in absolute value by the lifting procedure of Thiele et al....
void removeColsRational(int perm[])
removes all columns with an index i such that perm[i] < 0; upon completion, perm[i] >= 0 indicates th...
const VectorRational & upperRational() const
returns upper bound vector
BoolParam
boolean parameters
@ TESTDUALINF
should dual infeasibility be tested in order to try to return a dual solution even if primal infeasib...
@ FORCEBASIC
try to enforce that the optimal solution is a basic solution
@ ENSURERAY
re-optimize the original problem to get a proof (ray) of infeasibility/unboundedness?
@ SIMPLIFIER_FIXCONTINUOUS
@ PRECISION_BOOSTING
enable precision boosting ?
@ SIMPLIFIER_PARALLELCOLDETECTION
@ ACCEPTCYCLING
should cycling solutions be accepted during iterative refinement?
@ SIMPLIFIER_SINGLETONCOLS
@ RATREC
apply rational reconstruction after each iterative refinement?
@ RATFAC
should a rational factorization be performed after iterative refinement?
@ ADAPT_TOLS_TO_MULTIPRECISION
adapt tolerances to the multiprecision used
@ LIFTING
should lifting be used to reduce range of nonzero matrix coefficients?
@ SIMPLIFIER_CONSTRAINTPROPAGATION
@ EQTRANS
should LP be transformed to equality form before a rational solve?
@ FULLPERTURBATION
perturb the entire problem or only the relevant bounds of s single pivot?
@ BOOSTED_WARM_START
boosted solver start from last basis
@ SIMPLIFIER_SINGLETONSTUFFING
@ POWERSCALING
round scaling factors for iterative refinement to powers of two?
@ BOOLPARAM_COUNT
number of boolean parameters
@ SIMPLIFIER_PARALLELROWDETECTION
@ PERSISTENTSCALING
use persistent scaling?
@ SIMPLIFIER_DOMINATEDCOLS
@ ROWBOUNDFLIPS
use bound flipping also for row representation?
@ RATFACJUMP
continue iterative refinement with exact basic solution if not optimal?
@ RECOVERY_MECHANISM
try different settings when solve fails
RangeType
type of bounds and sides
@ RANGETYPE_UPPER
upper bound is finite, lower bound is infinite
@ RANGETYPE_FIXED
lower bound equals upper bound
@ RANGETYPE_BOXED
lower and upper bound finite, but different
@ RANGETYPE_LOWER
lower bound is finite, upper bound is infinite
@ RANGETYPE_FREE
both bounds are infinite
void changeLowerRational(int i, const Rational &lower)
changes lower bound of column i to lower
void addRowRational(const LPRowRational &lprow)
adds a single row
void removeColsRational(int idx[], int n, int perm[]=nullptr)
remove all columns with indices in array idx of size n; an array perm of size numColsRational() may b...
Rational _rationalPosInfty
void _checkBasisScaling()
check correctness of (un)scaled basis matrix operations
RangeType _rangeTypeRational(const Rational &lower, const Rational &upper) const
determines RangeType from rational bounds
SPxEquiliSC< R > _scalerUniequi
void getRhsReal(VectorBase< R > &rhs) const
gets right-hand side vector
DataArray< typename SPxSolverBase< BP >::VarStatus > _tmpBasisStatusCols
bool getRowViolationRational(Rational &maxviol, Rational &sumviol)
Class for storing a primal-dual solution with basis information.
Everything should be within this namespace.
SoPlexBase< Real > SoPlex
number< gmp_rational, et_off > Rational
Implementation of Sparse Linear Solver.
Implementation of Sparse Linear Solver with Rational precision.
Types of solution classes.
Class for storing a primal-dual solution with basis information.
Bound flipping ratio test (long step dual) for SoPlex.
Textbook ratio test for SoPlex.
Debugging, floating point type and parameter definitions.
Fast shifting ratio test.
LP geometric mean scaling.
returns the current git hash of SoPlex
Harris pricing with shifting.
LP least squares scaling.
Saving LPs in a form suitable for SoPlex.
General methods in LP preprocessing.
Partial multiple pricing.
Abstract pricer base class.
Abstract ratio test base class.
LP simplification base class.
SoPlex start basis generation base class.
Steepest edge pricer with exact initialization of weights.
Simple heuristic SPxStarter.
Solution vector based start basis.
std::string name[SoPlexBase< R >::BOOLPARAM_COUNT]
array of names for boolean parameters
std::string description[SoPlexBase< R >::BOOLPARAM_COUNT]
array of descriptions for boolean parameters
bool defaultValue[SoPlexBase< R >::BOOLPARAM_COUNT]
array of default values for boolean parameters
std::string name[SoPlexBase< R >::INTPARAM_COUNT]
array of names for integer parameters
int lower[SoPlexBase< R >::INTPARAM_COUNT]
array of lower bounds for int parameter values
int upper[SoPlexBase< R >::INTPARAM_COUNT]
array of upper bounds for int parameter values
int defaultValue[SoPlexBase< R >::INTPARAM_COUNT]
array of default values for integer parameters
std::string description[SoPlexBase< R >::INTPARAM_COUNT]
array of descriptions for integer parameters
Real upper[SoPlexBase< R >::REALPARAM_COUNT]
array of upper bounds for real parameter values
Real defaultValue[SoPlexBase< R >::REALPARAM_COUNT]
array of default values for real parameters
Real lower[SoPlexBase< R >::REALPARAM_COUNT]
array of lower bounds for real parameter values
std::string description[SoPlexBase< R >::REALPARAM_COUNT]
array of descriptions for real parameters
std::string name[SoPlexBase< R >::REALPARAM_COUNT]
array of names for real parameters