Debugging, floating point type and parameter definitions. More...
#include <cmath>
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include "soplex/config.h"
#include "boost/multiprecision/number.hpp"
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/gmp.hpp>
#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 600 |
#define | SOPLEX_SUBVERSION 0 |
#define | SOPLEX_APIVERSION 13 |
#define | SOPLEX_COPYRIGHT "Copyright (c) 1996-2022 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... | |
template<boost::multiprecision::expression_template_option eto> | |
number< gmp_rational, eto > | ldexp (number< gmp_rational, eto >, int exp) |
template<boost::multiprecision::expression_template_option eto> | |
number< gmp_rational, eto > | frexp (number< gmp_rational, eto >, int *exp) |
template<typename T , boost::multiprecision::expression_template_option eto> | |
boost::multiprecision::number< T, eto > | spxFrexp (boost::multiprecision::number< T, eto > y, int *exp) |
template<typename T , boost::multiprecision::expression_template_option eto> | |
boost::multiprecision::number< T > | spxLdexp (boost::multiprecision::number< T, eto > x, int exp) |
template<typename T , expression_template_option ep> | |
number< T, ep > | spxSqrt (number< T, ep > a) |
template<typename T , expression_template_option eto> | |
number< T, eto > | spxNextafter (number< T, eto > x, number< T, eto > y) |
template<typename T > | |
number< T > | spxSqrt (number< T > a) |
template<typename T , expression_template_option et> | |
number< T, et > | maxAbs (number< T, et > a, number< T, et > b) |
returns max(|a|,|b|) More... | |
template<typename T , expression_template_option et> | |
number< T, et > | relDiff (number< T, et > a, number< T, et > b) |
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 115 of file spxdefines.h.
#define DEFAULT_BND_VIOL 1e-6 |
default allowed bound violation
Definition at line 264 of file spxdefines.h.
Referenced by Presol< R >::getBasis().
#define DEFAULT_EPS_FACTOR 1e-20 |
Definition at line 271 of file spxdefines.h.
#define DEFAULT_EPS_PIVOT 1e-10 |
Definition at line 277 of file spxdefines.h.
#define DEFAULT_EPS_UPDATE 1e-16 |
Definition at line 274 of file spxdefines.h.
#define DEFAULT_EPS_ZERO 1e-16 |
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition at line 268 of file spxdefines.h.
Referenced by Presol< R >::getBasis(), SPxRatioTester< R >::setDelta(), and SPxFastRT< R >::setDelta().
#define DEFAULT_INFINITY 1e100 |
Definition at line 279 of file spxdefines.h.
#define DO_WITH_ERR_VERBOSITY | ( | do_something | ) | { do_something; } |
Definition at line 148 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 135 of file spxdefines.h.
#define MAXIMUM | ( | x, | |
y | |||
) | ((x)>(y) ? (x) : (y)) |
Definition at line 284 of file spxdefines.h.
Referenced by StableSum< double >::operator double().
#define MINIMUM | ( | x, | |
y | |||
) | ((x)<(y) ? (x) : (y)) |
Definition at line 285 of file spxdefines.h.
#define MSG_DEBUG | ( | x | ) |
Definition at line 170 of file spxdefines.h.
Referenced by SVSetBase< Rational >::countUnusedMem(), SVSetBase< Rational >::deleteVec(), SVSetBase< Rational >::ensureMem(), SVSetBase< Rational >::memPack(), SVSetBase< Rational >::memRemax(), soplex::powRound(), MPSInput::readLine(), SPxBasisBase< R >::setStatus(), 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 152 of file spxdefines.h.
Referenced by TimerFactory::createTimer(), soplex::dlcmSizeRational(), soplex::dmaxSizeRational(), MPSInput::entryIgnored(), Presol< R >::getBasis(), SSVectorBase< Rational >::isConsistent(), main(), soplex::msginconsistent(), soplex::ratFromString(), runSoPlex(), LPRowBase< R >::setType(), LPRowSetBase< R >::setType(), soplex::sizeInBase(), 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 156 of file spxdefines.h.
Referenced by checkSolution(), checkSolutionRational(), checkSolutionReal(), Presol< R >::getBasis(), printDualSolution(), printPrimalSolution(), and runSoPlex().
#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 158 of file spxdefines.h.
#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 160 of file spxdefines.h.
#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 154 of file spxdefines.h.
Referenced by Presol< R >::getBasis(), and runSoPlex().
#define MSGinconsistent | ( | name | ) | msginconsistent(name, __FILE__, __LINE__) |
Definition at line 164 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< int >::isConsistent(), ClassSet< 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 259 of file spxdefines.h.
#define REAL_FORMAT "lf" |
Definition at line 260 of file spxdefines.h.
#define SOPLEX_APIVERSION 13 |
Definition at line 85 of file spxdefines.h.
#define SOPLEX_COPYRIGHT "Copyright (c) 1996-2022 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)" |
Definition at line 86 of file spxdefines.h.
Referenced by runSoPlex().
#define SOPLEX_SUBVERSION 0 |
Definition at line 84 of file spxdefines.h.
#define SOPLEX_VERSION 600 |
Definition at line 83 of file spxdefines.h.
#define SPX_MAXSTRLEN 1024 |
maximum string length in SoPlex
Definition at line 287 of file spxdefines.h.
Referenced by NameSet::add(), and NameSet::memPack().
#define THREADLOCAL thread_local |
SOPLEX_DEBUG.
Definition at line 183 of file spxdefines.h.