Scippy

SoPlex

Sequential object-oriented simPlex

spxdefines.h File Reference

Debugging, floating point type and parameter definitions. More...

#include <math.h>

Go to the source code of this file.

Classes

class  Param
 

Namespaces

namespace  soplex
 Everything should be within this namespace.
 

Macros

#define SOPLEX_VERSION   220
 
#define SOPLEX_SUBVERSION   0
 
#define ASSERT_WARN(prefix, expr)   ( assert( expr ) )
 Macro to turn some assertions into warnings.
 
#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.
 
#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.
 
#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.
 
#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.
 
#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.
 
#define MSGinconsistent(name)   msginconsistent(name, __FILE__, __LINE__)
 
#define MSG_DEBUG(x)
 
#define REAL(x)   x
 
#define REAL_FORMAT   "lf"
 
#define DEFAULT_BND_VIOL   1e-6
 default allowed bound violation
 
#define DEFAULT_EPS_ZERO   1e-16
 default allowed additive zero: 1.0 + EPS_ZERO == 1.0
 
#define DEFAULT_EPS_FACTOR   1e-20
 
#define DEFAULT_EPS_UPDATE   1e-16
 
#define DEFAULT_EPS_PIVOT   1e-10
 
#define DEFAULT_INFINITY   1e100
 

Typedefs

typedef double Real
 SOPLEX_DEBUG.
 

Functions

bool msginconsistent (const char *name, const char *file, int line)
 
Real spxAbs (Real a)
 returns |a|
 
Real spxSqrt (Real a)
 returns square root
 
Real spxNextafter (Real x, Real y)
 
Real spxLdexp (Real x, int exp)
 returns x * 2^exp
 
Real spxFrexp (Real y, int *exp)
 
Real maxAbs (Real a, Real b)
 returns max(|a|,|b|)
 
Real relDiff (Real a, Real b)
 returns (a-b) / max(|a|,|b|,1.0)
 
bool EQ (Real a, Real b, Real eps=Param::epsilon())
 returns true iff |a-b| <= eps
 
bool NE (Real a, Real b, Real eps=Param::epsilon())
 returns true iff |a-b| > eps
 
bool LT (Real a, Real b, Real eps=Param::epsilon())
 returns true iff a < b + eps
 
bool LE (Real a, Real b, Real eps=Param::epsilon())
 returns true iff a <= b + eps
 
bool GT (Real a, Real b, Real eps=Param::epsilon())
 returns true iff a > b + eps
 
bool GE (Real a, Real b, Real eps=Param::epsilon())
 returns true iff a >= b + eps
 
bool isZero (Real a, Real eps=Param::epsilon())
 returns true iff |a| <= eps
 
bool isNotZero (Real a, Real eps=Param::epsilon())
 returns true iff |a| > eps
 
bool EQrel (Real a, Real b, Real eps=Param::epsilon())
 returns true iff |relDiff(a,b)| <= eps
 
bool NErel (Real a, Real b, Real eps=Param::epsilon())
 returns true iff |relDiff(a,b)| > eps
 
bool LTrel (Real a, Real b, Real eps=Param::epsilon())
 returns true iff relDiff(a,b) <= -eps
 
bool LErel (Real a, Real b, Real eps=Param::epsilon())
 returns true iff relDiff(a,b) <= eps
 
bool GTrel (Real a, Real b, Real eps=Param::epsilon())
 returns true iff relDiff(a,b) > eps
 
bool GErel (Real a, Real b, Real eps=Param::epsilon())
 returns true iff relDiff(a,b) > -eps
 

Detailed Description

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.

Macro Definition Documentation

#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().

Parameters
prefixShort string for grepping in source code.
exprExpression that must be satisfied.

Definition at line 69 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::removeEmpty(), SPxDefaultRT::selectLeave(), SPxMainSM::simplifyCols(), SPxMainSM::simplifyDual(), SPxMainSM::simplifyRows(), and CLUFactor::solveUleft().

#define DEFAULT_BND_VIOL   1e-6

default allowed bound violation

Definition at line 205 of file spxdefines.h.

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

#define DEFAULT_EPS_FACTOR   1e-20

Definition at line 212 of file spxdefines.h.

Referenced by main(), and SoPlex::Settings::Settings().

#define DEFAULT_EPS_PIVOT   1e-10

Definition at line 218 of file spxdefines.h.

Referenced by SoPlex::Settings::Settings().

#define DEFAULT_EPS_UPDATE   1e-16

Definition at line 215 of file spxdefines.h.

Referenced by main(), and SoPlex::Settings::Settings().

#define DEFAULT_EPS_ZERO   1e-16

default allowed additive zero: 1.0 + EPS_ZERO == 1.0

Definition at line 209 of file spxdefines.h.

Referenced by main(), soplex::operator!=(), soplex::operator==(), SPxRatioTester::setDelta(), SPxFastRT::setDelta(), and SoPlex::Settings::Settings().

#define DEFAULT_INFINITY   1e100

Definition at line 220 of file spxdefines.h.

Referenced by SoPlex::Settings::Settings().

#define DO_WITH_ERR_VERBOSITY (   do_something)    { do_something; }

Definition at line 102 of file spxdefines.h.

#define DO_WITH_TMP_VERBOSITY (   verbosity,
  spxout,
  do_something 
)
Value:
{ \
if( &spxout != NULL ) \
{ \
if( verbosity <= spxout.getVerbosity() ) \
{ \
const SPxOut::Verbosity old_verbosity = spxout.getVerbosity(); \
spxout.setVerbosity( verbosity ); \
do_something; \
spxout.setVerbosity( old_verbosity ); \
} \
} \
}

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 89 of file spxdefines.h.

#define MSG_DEBUG (   x)

Definition at line 124 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(), SLUFactorRational::change(), SLUFactor::change(), SPxSolver::changeLhsStatus(), SPxSolver::changeLowerStatus(), SPxSolver::changeRhsStatus(), SPxSolver::changeUpperStatus(), SVSetBase< Real >::countUnusedMem(), SVSetBase< Real >::deleteVec(), SVSetBase< Real >::ensureMem(), SPxSolver::enter(), SPxMainSM::RowObjPS::execute(), CLUFactorRational::factor(), SPxSolver::factorize(), SPxBoundFlippingRT::flipAndUpdate(), SPxWeightST::generate(), SoPlex::getDualViolationRational(), SPxSolver::getEnterVals(), SPxSolver::getEnterVals2(), SPxSolver::getLeaveVals(), SPxSolver::getLeaveVals2(), SoPlex::getRedCostViolationRational(), SPxBasis::isDescValid(), SPxSolver::leave(), SLUFactor::load(), SLUFactorRational::load(), soplex::LPFhasKeyword(), soplex::LPFreadColName(), soplex::LPFreadSense(), soplex::LPFreadValue(), SVSetBase< Real >::memPack(), SVSetBase< Real >::memRemax(), SPxSolver::perturbMaxEnter(), SPxSolver::perturbMaxLeave(), SPxSolver::perturbMinEnter(), SPxSolver::perturbMinLeave(), SPxBasis::readBasis(), MPSInput::readLine(), SPxLPBase< R >::readLPF(), soplex::reconstructVector(), SPxBasis::reDim(), SPxSolver::rejectLeave(), SPxBasis::removedRow(), SPxBasis::removedRows(), SPxDefaultRT::selectEnter(), SPxHarrisRT::selectEnter(), SPxFastRT::selectEnter(), SPxBoundFlippingRT::selectEnter(), SPxFastRT::selectLeave(), SPxBoundFlippingRT::selectLeave(), SPxBasis::setStatus(), SPxVectorST::setupWeights(), SPxWeightST::setupWeights(), SPxSolver::shiftFvec(), SPxSolver::shiftPvec(), SPxSolver::solve(), CLUFactor::solveLright(), CLUFactorRational::solveLright(), SPxSolver::terminate(), SPxMainSM::unsimplify(), SPxSolver::updateNonbasicValue(), SPxBasis::writeBasis(), and SVSetBase< Real >::xtend().

#define REAL_FORMAT   "lf"
#define SOPLEX_SUBVERSION   0
#define SOPLEX_VERSION   220