Debugging, floating point type and parameter definitions. More...
#include <cmath>#include <assert.h>#include <stdarg.h>#include <stdio.h>#include <iostream>#include <cstdlib>#include <memory>#include "soplex/config.h"#include "spxdefines.hpp"Go to the source code of this file.
Classes | |
| class | Tolerances |
Namespaces | |
| namespace | soplex |
| Everything should be within this namespace. | |
Macros | |
| #define | SOPLEX_VERSION 800 |
| #define | SOPLEX_VERSION_SUB 0 |
| #define | SOPLEX_SUBVERSION 0 |
| #define | SOPLEX_APIVERSION 20 |
| #define | SOPLEX_COPYRIGHT "Copyright (c) 1996-2025 Zuse Institute Berlin (ZIB)" |
| #define | SOPLEX_ASSERT_WARN(prefix, expr) ( assert( expr ) ) |
| Macro to turn some assertions into warnings. More... | |
| #define | SOPLEX_DO_WITH_TMP_VERBOSITY(verbosity, spxout, do_something) |
| #define | SOPLEX_DO_WITH_ERR_VERBOSITY(do_something) { do_something; } |
| #define | SPX_MSG_ERROR(x) { SOPLEX_DO_WITH_ERR_VERBOSITY( x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_ERROR. More... | |
| #define | SPX_MSG_WARNING(spxout, x) { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_WARNING, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_WARNING. More... | |
| #define | SPX_MSG_INFO1(spxout, x) { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_INFO1, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_INFO1. More... | |
| #define | SPX_MSG_INFO2(spxout, x) { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_INFO2, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_INFO2. More... | |
| #define | SPX_MSG_INFO3(spxout, x) { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_INFO3, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_INFO3. More... | |
| #define | SPX_MSG_INCONSISTENT(name) msginconsistent(name, __FILE__, __LINE__) |
| #define | SPX_MSG_DEBUG(x) |
| #define | SPX_DEBUG(x) |
| #define | SOPLEX_THREADLOCAL thread_local |
| SOPLEX_DEBUG. More... | |
| #define | SOPLEX_REAL(x) x |
| #define | SOPLEX_REAL_FORMAT "lf" |
| #define | SOPLEX_DEFAULT_BND_VIOL 1e-6 |
| default allowed bound violation More... | |
| #define | SOPLEX_DEFAULT_EPS_ZERO 1e-16 |
| default allowed additive zero: 1.0 + EPS_ZERO == 1.0 More... | |
| #define | SOPLEX_DEFAULT_EPS_FACTOR 1e-20 |
| #define | SOPLEX_DEFAULT_EPS_UPDATE 1e-16 |
| #define | SOPLEX_DEFAULT_EPS_PIVOR 1e-10 |
| #define | SOPLEX_DEFAULT_INFINITY 1e100 |
| #define | SOPLEX_MAX(x, y) ((x)>(y) ? (x) : (y)) |
| #define | SOPLEX_MIN(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 VERB_INFO1, VERB_INFO2, and VERB_INFO3 are set. If NDEBUG is not defined, the code within #TRACE is used. If SOPLEX_DEBUG is defined, the code within VERB_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 SOPLEX_APIVERSION 20 |
Definition at line 96 of file spxdefines.h.
| #define SOPLEX_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 126 of file spxdefines.h.
| #define SOPLEX_COPYRIGHT "Copyright (c) 1996-2025 Zuse Institute Berlin (ZIB)" |
Definition at line 97 of file spxdefines.h.
| #define SOPLEX_DEFAULT_BND_VIOL 1e-6 |
default allowed bound violation
Definition at line 277 of file spxdefines.h.
| #define SOPLEX_DEFAULT_EPS_FACTOR 1e-20 |
Definition at line 284 of file spxdefines.h.
| #define SOPLEX_DEFAULT_EPS_PIVOR 1e-10 |
Definition at line 290 of file spxdefines.h.
| #define SOPLEX_DEFAULT_EPS_UPDATE 1e-16 |
Definition at line 287 of file spxdefines.h.
| #define SOPLEX_DEFAULT_EPS_ZERO 1e-16 |
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition at line 281 of file spxdefines.h.
| #define SOPLEX_DEFAULT_INFINITY 1e100 |
Definition at line 292 of file spxdefines.h.
| #define SOPLEX_DO_WITH_ERR_VERBOSITY | ( | do_something | ) | { do_something; } |
Definition at line 159 of file spxdefines.h.
| #define SOPLEX_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 SPX_MSG_ERROR, SPX_MSG_WARNING, etc.
Definition at line 146 of file spxdefines.h.
| #define SOPLEX_MAX | ( | x, | |
| y | |||
| ) | ((x)>(y) ? (x) : (y)) |
Definition at line 297 of file spxdefines.h.
| #define SOPLEX_MIN | ( | x, | |
| y | |||
| ) | ((x)<(y) ? (x) : (y)) |
Definition at line 298 of file spxdefines.h.
| #define SOPLEX_REAL | ( | x | ) | x |
Definition at line 272 of file spxdefines.h.
| #define SOPLEX_REAL_FORMAT "lf" |
Definition at line 273 of file spxdefines.h.
| #define SOPLEX_SUBVERSION 0 |
Definition at line 95 of file spxdefines.h.
| #define SOPLEX_THREADLOCAL thread_local |
SOPLEX_DEBUG.
Definition at line 196 of file spxdefines.h.
| #define SOPLEX_VERSION 800 |
Definition at line 93 of file spxdefines.h.
| #define SOPLEX_VERSION_SUB 0 |
Definition at line 94 of file spxdefines.h.
| #define SPX_DEBUG | ( | x | ) |
Definition at line 183 of file spxdefines.h.
| #define SPX_MAXSTRLEN 1024 |
maximum string length in SoPlex
Definition at line 300 of file spxdefines.h.
| #define SPX_MSG_DEBUG | ( | x | ) |
Definition at line 182 of file spxdefines.h.
| #define SPX_MSG_ERROR | ( | x | ) | { SOPLEX_DO_WITH_ERR_VERBOSITY( x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_ERROR.
Definition at line 163 of file spxdefines.h.
| #define SPX_MSG_INCONSISTENT | ( | name | ) | msginconsistent(name, __FILE__, __LINE__) |
Definition at line 175 of file spxdefines.h.
| #define SPX_MSG_INFO1 | ( | spxout, | |
| x | |||
| ) | { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_INFO1, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_INFO1.
Definition at line 167 of file spxdefines.h.
| #define SPX_MSG_INFO2 | ( | spxout, | |
| x | |||
| ) | { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_INFO2, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_INFO2.
Definition at line 169 of file spxdefines.h.
| #define SPX_MSG_INFO3 | ( | spxout, | |
| x | |||
| ) | { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_INFO3, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_INFO3.
Definition at line 171 of file spxdefines.h.
| #define SPX_MSG_WARNING | ( | spxout, | |
| x | |||
| ) | { SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::VERB_WARNING, spxout, x ) } |
Prints out message x if the verbosity level is at least SPxOut::VERB_WARNING.
Definition at line 165 of file spxdefines.h.