Debugging, floating point type and parameter definitions. More...
#include <math.h>
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <iostream>
Go to the source code of this file.
Classes | |
class | Param |
Namespaces | |
soplex | |
Everything should be within this namespace. | |
Macros | |
#define | SOPLEX_VERSION 401 |
#define | SOPLEX_SUBVERSION 0 |
#define | SOPLEX_APIVERSION 6 |
#define | SOPLEX_COPYRIGHT "Copyright (c) 1996-2019 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)" |
#define | ASSERT_WARN(prefix, expr) ( assert( expr ) ) |
Macro to turn some assertions into warnings. More... | |
#define | DO_WITH_TMP_VERBOSITY(verbosity, spxout, do_something) |
#define | DO_WITH_ERR_VERBOSITY(do_something) { do_something; } |
#define | MSG_ERROR(x) { DO_WITH_ERR_VERBOSITY( x ) } |
Prints out message x if the verbosity level is at least SPxOut::ERROR. More... | |
#define | MSG_WARNING(spxout, x) { DO_WITH_TMP_VERBOSITY( SPxOut::WARNING, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::WARNING. More... | |
#define | MSG_INFO1(spxout, x) { DO_WITH_TMP_VERBOSITY( SPxOut::INFO1, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::INFO1. More... | |
#define | MSG_INFO2(spxout, x) { DO_WITH_TMP_VERBOSITY( SPxOut::INFO2, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::INFO2. More... | |
#define | MSG_INFO3(spxout, x) { DO_WITH_TMP_VERBOSITY( SPxOut::INFO3, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::INFO3. More... | |
#define | MSGinconsistent(name) msginconsistent(name, __FILE__, __LINE__) |
#define | MSG_DEBUG(x) |
#define | THREADLOCAL thread_local |
SOPLEX_DEBUG. More... | |
#define | REAL(x) x |
#define | REAL_FORMAT "lf" |
#define | DEFAULT_BND_VIOL 1e-6 |
default allowed bound violation More... | |
#define | DEFAULT_EPS_ZERO 1e-16 |
default allowed additive zero: 1.0 + EPS_ZERO == 1.0 More... | |
#define | DEFAULT_EPS_FACTOR 1e-20 |
#define | DEFAULT_EPS_UPDATE 1e-16 |
#define | DEFAULT_EPS_PIVOT 1e-10 |
#define | DEFAULT_INFINITY 1e100 |
#define | MAXIMUM(x, y) ((x)>(y) ? (x) : (y)) |
#define | MINIMUM(x, y) ((x)<(y) ? (x) : (y)) |
#define | SPX_MAXSTRLEN 1024 |
Typedefs | |
typedef double | Real |
Functions | |
bool | msginconsistent (const char *name, const char *file, int line) |
Real | spxAbs (Real a) |
returns |a| More... | |
Real | spxSqrt (Real a) |
returns square root More... | |
Real | spxNextafter (Real x, Real y) |
Real | spxLdexp (Real x, int exp) |
returns x * 2^exp More... | |
Real | spxFrexp (Real y, int *exp) |
Real | maxAbs (Real a, Real b) |
returns max(|a|,|b|) More... | |
Real | relDiff (Real a, Real b) |
returns (a-b) / max(|a|,|b|,1.0) More... | |
bool | EQ (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff |a-b| <= eps More... | |
bool | NE (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff |a-b| > eps More... | |
bool | LT (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff a < b + eps More... | |
bool | LE (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff a <= b + eps More... | |
bool | GT (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff a > b + eps More... | |
bool | GE (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff a >= b + eps More... | |
bool | isZero (Real a, Real eps=Param::epsilon()) |
returns true iff |a| <= eps More... | |
bool | isNotZero (Real a, Real eps=Param::epsilon()) |
returns true iff |a| > eps More... | |
bool | EQrel (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff |relDiff(a,b)| <= eps More... | |
bool | NErel (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff |relDiff(a,b)| > eps More... | |
bool | LTrel (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff relDiff(a,b) <= -eps More... | |
bool | LErel (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff relDiff(a,b) <= eps More... | |
bool | GTrel (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff relDiff(a,b) > eps More... | |
bool | GErel (Real a, Real b, Real eps=Param::epsilon()) |
returns true iff relDiff(a,b) > -eps More... | |
int | spxSnprintf (char *t, size_t len, const char *s,...) |
safe version of snprintf More... | |
Debugging, floating point type and parameter definitions.
In optimized code with NDEBUG
defined, only INFO1, INFO2, and INFO3 are set. If NDEBUG
is not defined, the code within #TRACE is used. If SOPLEX_DEBUG
is defined, the code within DEBUG is also used.
If WITH_LONG_DOUBLE
is defined, all Real numbers are of type long double instead of just double.
Definition in file spxdefines.h.
#define ASSERT_WARN | ( | prefix, | |
expr | |||
) | ( assert( expr ) ) |
Macro to turn some assertions into warnings.
If both NDEBUG
and WITH_WARNINGS
are defined then the failed assertion is converted to a warning. In all other cases this macro is equivalent to assert().
prefix | Short string for grepping in source code. |
expr | Expression that must be satisfied. |
Definition at line 77 of file spxdefines.h.
Referenced by SPxWeightPR::computeCP(), SPxWeightPR::computeRP(), SPxMainSM::duplicateCols(), SPxMainSM::duplicateRows(), SPxMainSM::ZeroObjColSingletonPS::execute(), SPxMainSM::DoubletonEquationPS::execute(), SPxMainSM::DuplicateRowsPS::execute(), SPxMainSM::DuplicateColsPS::execute(), SPxMainSM::multiaggregation(), SPxMainSM::removeEmpty(), SPxDefaultRT::selectLeave(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), SPxMainSM::simplifyRows(), CLUFactor::solveUleft(), and SPxMainSM::trivialHeuristic().
#define DEFAULT_BND_VIOL 1e-6 |
default allowed bound violation
Definition at line 226 of file spxdefines.h.
Referenced by SPxSolver::factorize(), and SPxSolver::SPxSolver().
#define DEFAULT_EPS_FACTOR 1e-20 |
Definition at line 233 of file spxdefines.h.
Referenced by SoPlex::Settings::RealParam::RealParam().
#define DEFAULT_EPS_PIVOT 1e-10 |
Definition at line 239 of file spxdefines.h.
Referenced by SoPlex::Settings::RealParam::RealParam(), and SoPlex::setRealParam().
#define DEFAULT_EPS_UPDATE 1e-16 |
Definition at line 236 of file spxdefines.h.
Referenced by SoPlex::Settings::RealParam::RealParam().
#define DEFAULT_EPS_ZERO 1e-16 |
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition at line 230 of file spxdefines.h.
Referenced by soplex::operator!=(), soplex::operator==(), SoPlex::Settings::RealParam::RealParam(), SPxRatioTester::setDelta(), and SPxFastRT::setDelta().
#define DEFAULT_INFINITY 1e100 |
Definition at line 241 of file spxdefines.h.
Referenced by SoPlex::Settings::RealParam::RealParam().
#define DO_WITH_ERR_VERBOSITY | ( | do_something | ) | { do_something; } |
Definition at line 110 of file spxdefines.h.
#define DO_WITH_TMP_VERBOSITY | ( | verbosity, | |
spxout, | |||
do_something | |||
) |
Prints/Executes stream
with verbosity level verbosity
, resetting the old verbosity level afterwards. Usually the parameter stream
prints something out. This is an internal define used by MSG_ERROR, MSG_WARNING, etc.
Definition at line 97 of file spxdefines.h.
#define MAXIMUM | ( | x, | |
y | |||
) | ((x)>(y) ? (x) : (y)) |
Definition at line 246 of file spxdefines.h.
Referenced by SPxSolver::calculateProblemRanges(), SPxSolver::maxInfeas(), SPxSolver::printDisplayLine(), SPxSolver::solve(), and SPxMainSM::trivialHeuristic().
#define MINIMUM | ( | x, | |
y | |||
) | ((x)<(y) ? (x) : (y)) |
Definition at line 247 of file spxdefines.h.
Referenced by SoPlex::_updateDecompReducedProblem(), SoPlex::_updateDecompReducedProblemViol(), SPxSolver::calculateProblemRanges(), SPxSolver::terminate(), and SPxMainSM::trivialHeuristic().
#define MSG_DEBUG | ( | x | ) |
Definition at line 132 of file spxdefines.h.
Referenced by SoPlex::_computeInfeasBox(), SoPlex::_factorizeColumnRational(), SoPlex::_lift(), SoPlex::_performFeasIRStable(), SoPlex::_performOptIRStable(), SoPlex::_performUnboundedIRStable(), SoPlex::_project(), SoPlex::_reconstructSolutionRational(), SoPlex::_solveRealStable(), SoPlex::_transformEquality(), SoPlex::_transformFeasibility(), SoPlex::_transformUnbounded(), SoPlex::_untransformEquality(), SoPlex::_untransformFeasibility(), SoPlex::_untransformUnbounded(), SPxMainSM::aggregateVars(), SPxScaler::applyScaling(), SLUFactorRational::change(), SLUFactor::change(), SPxBasis::change(), SPxSolver::changeLhsStatus(), SPxSolver::changeLowerStatus(), SPxSolver::changeRhsStatus(), SPxSolver::changeUpperStatus(), SVSetBase< Rational >::countUnusedMem(), SVSetBase< Rational >::deleteVec(), SPxMainSM::duplicateCols(), SPxMainSM::duplicateRows(), SVSetBase< Rational >::ensureMem(), SPxSolver::enter(), SPxMainSM::RowObjPS::execute(), CLUFactorRational::factor(), SPxSolver::factorize(), SPxMainSM::fixColumn(), SPxBoundFlippingRT::flipAndUpdate(), SPxWeightST::generate(), SoPlex::getBoundViolationRational(), SoPlex::getDualViolationRational(), SPxSolver::getEnterVals(), SPxSolver::getEnterVals2(), SPxSolver::getLeaveVals(), SPxSolver::getLeaveVals2(), SoPlex::getRedCostViolationRational(), SoPlex::getRowViolationRational(), SPxMainSM::handleExtremes(), SPxBasis::isDescValid(), SPxSolver::leave(), SLUFactor::load(), SLUFactorRational::load(), soplex::LPFhasKeyword(), soplex::LPFreadColName(), soplex::LPFreadSense(), soplex::LPFreadValue(), SVSetBase< Rational >::memPack(), SVSetBase< Rational >::memRemax(), SPxMainSM::multiaggregation(), SPxSolver::performSolutionPolishing(), SPxSolver::perturbMaxEnter(), SPxSolver::perturbMaxLeave(), SPxSolver::perturbMinEnter(), SPxSolver::perturbMinLeave(), SPxBasis::readBasis(), MPSInput::readLine(), SPxLPBase< Real >::readLPF(), soplex::reconstructVector(), SPxBasis::reDim(), SPxSolver::rejectLeave(), SPxBasis::removedRow(), SPxBasis::removedRows(), SPxMainSM::removeEmpty(), SPxMainSM::removeRowSingleton(), SPxDefaultRT::selectEnter(), SPxHarrisRT::selectEnter(), SPxFastRT::selectEnter(), SPxBoundFlippingRT::selectEnter(), SPxFastRT::selectLeave(), SPxBoundFlippingRT::selectLeave(), SPxBasis::setStatus(), SPxVectorST::setupWeights(), SPxWeightST::setupWeights(), SPxSolver::shiftFvec(), SPxSolver::shiftPvec(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), SPxMainSM::simplifyRows(), SPxSolver::solve(), CLUFactor::solveLright(), CLUFactorRational::solveLright(), SPxSolver::terminate(), SPxMainSM::unsimplify(), SPxSolver::updateNonbasicValue(), SPxBasis::writeBasis(), and SVSetBase< Rational >::xtend().
#define MSG_ERROR | ( | x | ) | { DO_WITH_ERR_VERBOSITY( x ) } |
Prints out message x
if the verbosity level is at least SPxOut::ERROR.
Definition at line 114 of file spxdefines.h.
Referenced by SoPlex::_computeReducedProbObjCoeff(), SoPlex::_decompResolveWithoutPreprocessing(), SoPlex::_decompSimplifyAndSolve(), SoPlex::_getCompatibleBoundCons(), SoPlex::_getCompatibleColumns(), SoPlex::_updateDecompReducedProblemViol(), SPxBasis::addedCols(), SPxBasis::addedRows(), SPxSolver::basisStatusToVarStatus(), SPxLPBase< Real >::buildDualProblem(), SPxSolver::computeFrhs(), SPxSolver::computeFrhs1(), SPxSolver::computeFrhs2(), SPxSolver::computeFrhsXtra(), TimerFactory::createTimer(), MPSInput::entryIgnored(), SPxMainSM::AggregationPS::execute(), SPxMainSM::MultiAggregationPS::execute(), SPxBasis::factorize(), SPxSolver::getEnterVals(), SPxSolver::getEnterVals2(), SPxSolver::getLeaveVals2(), SPxStarter::isConsistent(), SPxSteepPR::isConsistent(), SSVectorBase< Real >::isConsistent(), main(), soplex::MPSreadCols(), soplex::msginconsistent(), SPxSolver::nonbasicValue(), SPxLPBase< Real >::readLPF(), CLUFactor::setPivot(), LPRowBase< R >::setType(), LPRowSetBase< Real >::setType(), soplex::spxSnprintf(), MPSInput::syntaxError(), SPxSolver::varStatusToBasisStatusCol(), and SPxSolver::varStatusToBasisStatusRow().
#define MSG_INFO1 | ( | spxout, | |
x | |||
) | { DO_WITH_TMP_VERBOSITY( SPxOut::INFO1, spxout, x ) } |
Prints out message x
if the verbosity level is at least SPxOut::INFO1.
Definition at line 118 of file spxdefines.h.
Referenced by SoPlex::_checkBasisScaling(), SoPlex::_checkOriginalProblemOptimality(), SoPlex::_checkScaling(), SoPlex::_computeBasisInverseRational(), SoPlex::_computeInfeasBox(), SoPlex::_evaluateSolutionReal(), SoPlex::_factorizeColumnRational(), SoPlex::_lift(), SoPlex::_optimizeRational(), SoPlex::_parseSettingsLine(), SoPlex::_performOptIRStable(), SoPlex::_project(), SoPlex::_reconstructSolutionRational(), SoPlex::_resolveWithoutPreprocessing(), SoPlex::_solveDecompositionDualSimplex(), SoPlex::_solveRealForRational(), SoPlex::_solveRealLPAndRecordStatistics(), SoPlex::_solveRealStable(), SoPlex::_storeSolutionReal(), SoPlex::_storeSolutionRealFromPresol(), SoPlex::_transformEquality(), SoPlex::_transformFeasibility(), SoPlex::_transformUnbounded(), SoPlex::_unscaleSolutionReal(), SoPlex::_verifySolutionReal(), SoPlex::areLPsInSync(), checkSolution(), checkSolutionRational(), checkSolutionReal(), SPxSolver::factorize(), SoPlex::getBasisInverseColRational(), SoPlex::getBasisInverseColReal(), SoPlex::getBasisInverseRowRational(), SoPlex::getBasisInverseRowReal(), SoPlex::getBasisInverseTimesVecRational(), SoPlex::getBasisInverseTimesVecReal(), SoPlex::loadSettingsFile(), main(), SoPlex::optimize(), SoPlex::parseSettingsString(), SPxSolver::performSolutionPolishing(), SoPlex::printDecompDisplayLine(), SPxSolver::printDisplayLine(), printDualSolution(), printPrimalSolution(), SoPlex::printVersion(), SPxLeastSqSC::scale(), SPxEquiliSC::scale(), SPxGeometSC::scale(), SPxAutoPR::selectEnter(), SPxAutoPR::selectLeave(), SPxHybridPR::setType(), SPxSteepPR::setupWeights(), SPxMainSM::simplify(), SPxSolver::solve(), SPxSolver::testVecs(), and SPxMainSM::unsimplify().
#define MSG_INFO2 | ( | spxout, | |
x | |||
) | { DO_WITH_TMP_VERBOSITY( SPxOut::INFO2, spxout, x ) } |
Prints out message x
if the verbosity level is at least SPxOut::INFO2.
Definition at line 120 of file spxdefines.h.
Referenced by SoPlex::_computeBasisInverseRational(), SoPlex::_factorizeColumnRational(), SoPlex::_formDecompReducedProblem(), SoPlex::_optimizeRational(), SoPlex::_performOptIRStable(), SoPlex::_solveDecompositionDualSimplex(), SoPlex::_updateDecompComplementaryDualProblem(), SoPlex::_updateDecompComplementaryPrimalProblem(), SPxSolver::computeCoTest(), SPxSolver::computeFtest(), SPxSolver::computeTest(), SoPlex::decompTerminate(), SPxMainSM::duplicateCols(), SPxMainSM::duplicateRows(), SPxSolver::enter(), SoPlex::getOriginalProblemBasisColStatus(), SoPlex::getOriginalProblemBasisRowStatus(), SPxMainSM::handleExtremes(), SPxSolver::leave(), soplex::MPSreadBounds(), soplex::MPSreadName(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), soplex::MPSreadRows(), SPxMainSM::multiaggregation(), SPxSolver::performSolutionPolishing(), SPxLPBase< Real >::readLPF(), SPxLPBase< Real >::readMPS(), SPxMainSM::removeEmpty(), SPxLeastSqSC::scale(), SPxEquiliSC::scale(), SPxGeometSC::scale(), SPxMainSM::simplify(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), SPxMainSM::simplifyRows(), SPxSolver::solve(), SPxSolver::terminate(), and SPxSolver::testBounds().
#define MSG_INFO3 | ( | spxout, | |
x | |||
) | { DO_WITH_TMP_VERBOSITY( SPxOut::INFO3, spxout, x ) } |
Prints out message x
if the verbosity level is at least SPxOut::INFO3.
Definition at line 122 of file spxdefines.h.
Referenced by SoPlex::_identifyComplementaryDualFixedPrimalVars(), SoPlex::_identifyComplementaryPrimalFixedPrimalVars(), SoPlex::_transformFeasibility(), SoPlex::_verifySolutionReal(), SPxBasis::change(), SPxSolver::enter(), SPxSolver::factorize(), SPxBasis::invalidate(), SPxSolver::leave(), SPxDevexPR::left4(), SPxSteepPR::left4(), SLUFactor::load(), SPxBasis::loadBasisSolver(), SPxBasis::loadDesc(), SPxBasis::loadMatrixVecs(), soplex::MPSreadRhs(), SPxSolver::precisionReached(), SPxBasis::reDim(), SPxBasis::restoreInitialBasis(), SPxLeastSqSC::scale(), SPxEquiliSC::scale(), SPxGeometSC::scale(), SPxDevexPR::selectEnter(), SPxSteepPR::selectEnter(), SPxDevexPR::selectLeave(), SPxSteepPR::selectLeave(), SPxSolver::setType(), SPxMainSM::simplify(), SPxSolver::solve(), SPxSolver::terminate(), SPxSolver::testVecs(), SPxLPBase< Real >::unscaleLP(), SPxSolver::unShift(), and SoPlex::writeFileReal().
#define MSG_WARNING | ( | spxout, | |
x | |||
) | { DO_WITH_TMP_VERBOSITY( SPxOut::WARNING, spxout, x ) } |
Prints out message x
if the verbosity level is at least SPxOut::WARNING.
Definition at line 116 of file spxdefines.h.
Referenced by SoPlex::_factorizeColumnRational(), SoPlex::_parseSettingsLine(), SoPlex::_performOptIRStable(), SoPlex::_reconstructSolutionRational(), SoPlex::_solveDecompositionDualSimplex(), SoPlex::_updateDecompReducedProblem(), SPxSolver::computeFrhs2(), SPxBoundFlippingRT::flipAndUpdate(), SPxMainSM::handleExtremes(), soplex::LPFreadColName(), soplex::LPFreadValue(), soplex::LPFwriteBounds(), soplex::LPFwriteRow(), soplex::LPFwriteSVector(), main(), soplex::MPSreadBounds(), soplex::MPSreadCols(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), soplex::MPSwriteRecord(), SoPlex::optimize(), SoPlex::parseSettingsString(), SPxLPBase< Real >::readLPF(), SoPlex::setRealParam(), SPxMainSM::simplifyRows(), SPxSolver::solve(), SPxSolver::terminate(), and SPxLPBase< Real >::writeMPS().
#define MSGinconsistent | ( | name | ) | msginconsistent(name, __FILE__, __LINE__) |
Definition at line 126 of file spxdefines.h.
Referenced by SPxHybridPR::isConsistent(), UnitVectorBase< R >::isConsistent(), SPxDevexPR::isConsistent(), SPxWeightPR::isConsistent(), UpdateVector::isConsistent(), IdxSet::isConsistent(), SPxSteepPR::isConsistent(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::isConsistent(), DSVectorBase< Real >::isConsistent(), DataArray< const soplex::SVectorBase * >::isConsistent(), DVectorBase< Real >::isConsistent(), ClassArray< Nonzero< Real > >::isConsistent(), IdList< soplex::SVSetBase::DLPSV >::isConsistent(), NameSet::isConsistent(), Array< soplex::UnitVectorBase >::isConsistent(), IsList< soplex::SVSetBase::DLPSV >::isConsistent(), VectorBase< Real >::isConsistent(), DataSet< soplex::SVSetBase::DLPSV >::isConsistent(), LPColSetBase< Rational >::isConsistent(), SSVectorBase< Real >::isConsistent(), LPRowSetBase< Real >::isConsistent(), SVectorBase< Real >::isConsistent(), SPxBasis::isConsistent(), SVSetBase< Rational >::isConsistent(), SPxLPBase< Real >::isConsistent(), and SPxSolver::isConsistent().
#define REAL | ( | x | ) | x |
Definition at line 221 of file spxdefines.h.
Referenced by soplex::betterThreshold(), CLUFactor::selectPivots(), CLUFactor::setPivot(), and CLUFactor::setupColVals().
#define REAL_FORMAT "lf" |
Definition at line 222 of file spxdefines.h.
Referenced by soplex::MPSwriteRecord(), and SPxBasis::printMatrixMTX().
#define SOPLEX_APIVERSION 6 |
Definition at line 47 of file spxdefines.h.
#define SOPLEX_COPYRIGHT "Copyright (c) 1996-2019 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)" |
Definition at line 48 of file spxdefines.h.
Referenced by main().
#define SOPLEX_SUBVERSION 0 |
Definition at line 46 of file spxdefines.h.
Referenced by SoPlex::printVersion(), SoPlex::saveSettingsFile(), and SPxSolver::writeState().
#define SOPLEX_VERSION 401 |
Definition at line 45 of file spxdefines.h.
Referenced by SoPlex::printVersion(), SoPlex::saveSettingsFile(), and SPxSolver::writeState().
#define SPX_MAXSTRLEN 1024 |
maximum string length in SoPlex
Definition at line 249 of file spxdefines.h.
Referenced by NameSet::add(), NameSet::memPack(), and SPxBasis::printMatrixMTX().
#define THREADLOCAL thread_local |
SOPLEX_DEBUG.
Definition at line 145 of file spxdefines.h.