Debugging, floating point type and parameter definitions. More...
#include <cmath>
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include "spxdefines.hpp"
Go to the source code of this file.
Classes | |
class | Param |
Namespaces | |
soplex | |
Everything should be within this namespace. | |
Macros | |
#define | SOPLEX_VERSION 500 |
#define | SOPLEX_SUBVERSION 0 |
#define | SOPLEX_APIVERSION 11 |
#define | SOPLEX_COPYRIGHT "Copyright (c) 1996-2020 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 | EQ (int a, int b) |
bool | msginconsistent (const char *name, const char *file, int line) |
template<class R > | |
R | spxAbs (R a) |
Real | spxNextafter (Real x, Real y) |
template<> | |
Real | spxAbs (Real a) |
returns |a| More... | |
Real | spxSqrt (Real a) |
returns square root More... | |
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... | |
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 86 of file spxdefines.h.
#define DEFAULT_BND_VIOL 1e-6 |
default allowed bound violation
Definition at line 235 of file spxdefines.h.
#define DEFAULT_EPS_FACTOR 1e-20 |
Definition at line 242 of file spxdefines.h.
#define DEFAULT_EPS_PIVOT 1e-10 |
Definition at line 248 of file spxdefines.h.
#define DEFAULT_EPS_UPDATE 1e-16 |
Definition at line 245 of file spxdefines.h.
#define DEFAULT_EPS_ZERO 1e-16 |
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition at line 239 of file spxdefines.h.
Referenced by soplex::dmaxSizeRational(), SPxRatioTester< R >::setDelta(), and SPxFastRT< R >::setDelta().
#define DEFAULT_INFINITY 1e100 |
Definition at line 250 of file spxdefines.h.
#define DO_WITH_ERR_VERBOSITY | ( | do_something | ) | { do_something; } |
Definition at line 119 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 106 of file spxdefines.h.
#define MAXIMUM | ( | x, | |
y | |||
) | ((x)>(y) ? (x) : (y)) |
Definition at line 255 of file spxdefines.h.
Referenced by StableSum< double >::operator double().
#define MINIMUM | ( | x, | |
y | |||
) | ((x)<(y) ? (x) : (y)) |
Definition at line 256 of file spxdefines.h.
#define MSG_DEBUG | ( | x | ) |
Definition at line 141 of file spxdefines.h.
Referenced by SLUFactorRational::change(), SVSetBase< Rational >::countUnusedMem(), SVSetBase< Rational >::deleteVec(), SVSetBase< Rational >::ensureMem(), CLUFactorRational::factor(), SLUFactorRational::load(), soplex::LPFreadColName(), soplex::LPFreadValue(), SVSetBase< Rational >::memPack(), SVSetBase< Rational >::memRemax(), Rational::powRound(), MPSInput::readLine(), SPxLPBase< R >::readLPF(), soplex::Reconstruct(), soplex::reconstructVector(), SPxBasisBase< R >::setStatus(), CLUFactorRational::solveLright(), 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 123 of file spxdefines.h.
Referenced by SPxLPBase< R >::buildDualProblem(), TimerFactory::createTimer(), MPSInput::entryIgnored(), SSVectorBase< Rational >::isConsistent(), main(), soplex::MPSreadCols(), soplex::msginconsistent(), SPxLPBase< R >::readLPF(), LPRowBase< R >::setType(), LPRowSetBase< R >::setType(), soplex::spxSnprintf(), and MPSInput::syntaxError().
#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 127 of file spxdefines.h.
Referenced by checkSolution(), checkSolutionRational(), checkSolutionReal(), main(), printDualSolution(), and printPrimalSolution().
#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 129 of file spxdefines.h.
Referenced by soplex::MPSreadBounds(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), soplex::MPSreadRows(), SPxLPBase< R >::readLPF(), and SPxLPBase< R >::readMPS().
#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 131 of file spxdefines.h.
Referenced by soplex::MPSreadRhs().
#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 125 of file spxdefines.h.
Referenced by soplex::LPFreadColName(), soplex::LPFreadValue(), soplex::LPFwriteBounds(), soplex::LPFwriteRow(), soplex::LPFwriteSVector(), main(), soplex::MPSreadBounds(), soplex::MPSreadCols(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), soplex::MPSwriteRecord(), SPxLPBase< R >::readLPF(), and SPxLPBase< R >::writeMPS().
#define MSGinconsistent | ( | name | ) | msginconsistent(name, __FILE__, __LINE__) |
Definition at line 135 of file spxdefines.h.
Referenced by UnitVectorBase< R >::isConsistent(), IdxSet::isConsistent(), DataHashTable< soplex::NameSet::Name, soplex::DataKey >::isConsistent(), DSVectorBase< Rational >::isConsistent(), DataArray< const soplex::SVectorBase< R > * >::isConsistent(), ClassArray< Nonzero< Rational > >::isConsistent(), IdList< soplex::SVSetBase::DLPSV >::isConsistent(), NameSet::isConsistent(), IsList< soplex::SVSetBase::DLPSV >::isConsistent(), DataSet< soplex::SVSetBase::DLPSV >::isConsistent(), LPColSetBase< Rational >::isConsistent(), SSVectorBase< Rational >::isConsistent(), LPRowSetBase< R >::isConsistent(), SVectorBase< Rational >::isConsistent(), SVSetBase< Rational >::isConsistent(), and SPxLPBase< R >::isConsistent().
#define REAL | ( | x | ) | x |
Definition at line 230 of file spxdefines.h.
#define REAL_FORMAT "lf" |
Definition at line 231 of file spxdefines.h.
#define SOPLEX_APIVERSION 11 |
Definition at line 56 of file spxdefines.h.
#define SOPLEX_COPYRIGHT "Copyright (c) 1996-2020 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)" |
Definition at line 57 of file spxdefines.h.
Referenced by main().
#define SOPLEX_SUBVERSION 0 |
Definition at line 55 of file spxdefines.h.
#define SOPLEX_VERSION 500 |
Definition at line 54 of file spxdefines.h.
#define SPX_MAXSTRLEN 1024 |
maximum string length in SoPlex
Definition at line 258 of file spxdefines.h.
Referenced by NameSet::add(), and NameSet::memPack().
#define THREADLOCAL thread_local |
SOPLEX_DEBUG.
Definition at line 154 of file spxdefines.h.