SoPlex
|
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 714 |
#define | SOPLEX_SUBVERSION 0 |
#define | SOPLEX_APIVERSION 17 |
#define | SOPLEX_COPYRIGHT "Copyright (c) 1996-2025 Zuse Institute Berlin (ZIB)" |
#define | SOPLEX_ASSERT_WARN(prefix, expr) |
Macro to turn some assertions into warnings. | |
#define | SOPLEX_DO_WITH_TMP_VERBOSITY(verbosity, spxout, do_something) |
#define | SOPLEX_DO_WITH_ERR_VERBOSITY(do_something) |
#define | SPX_MSG_ERROR(x) |
Prints out message x if the verbosity level is at least SPxOut::ERROR. | |
#define | SPX_MSG_WARNING(spxout, x) |
Prints out message x if the verbosity level is at least SPxOut::WARNING. | |
#define | SPX_MSG_INFO1(spxout, x) |
Prints out message x if the verbosity level is at least SPxOut::INFO1. | |
#define | SPX_MSG_INFO2(spxout, x) |
Prints out message x if the verbosity level is at least SPxOut::INFO2. | |
#define | SPX_MSG_INFO3(spxout, x) |
Prints out message x if the verbosity level is at least SPxOut::INFO3. | |
#define | SPX_MSG_INCONSISTENT(name) |
#define | SPX_MSG_DEBUG(x) |
#define | SPX_DEBUG(x) |
#define | SOPLEX_THREADLOCAL thread_local |
SOPLEX_DEBUG. | |
#define | SOPLEX_REAL(x) |
#define | SOPLEX_REAL_FORMAT "lf" |
#define | SOPLEX_DEFAULT_BND_VIOL 1e-6 |
default allowed bound violation | |
#define | SOPLEX_DEFAULT_EPS_ZERO 1e-16 |
default allowed additive zero: 1.0 + EPS_ZERO == 1.0 | |
#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) |
#define | SOPLEX_MIN(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| | |
Real | spxSqrt (Real a) |
returns square root | |
Real | maxAbs (Real a, Real b) |
returns max(|a|,|b|) | |
Real | relDiff (Real a, Real b) |
returns (a-b) / max(|a|,|b|,1.0) | |
int | spxSnprintf (char *t, size_t len, const char *s,...) |
safe version of snprintf | |
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 SOPLEX_APIVERSION 17 |
Definition at line 95 of file spxdefines.h.
#define SOPLEX_ASSERT_WARN | ( | prefix, | |
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 125 of file spxdefines.h.
#define SOPLEX_COPYRIGHT "Copyright (c) 1996-2025 Zuse Institute Berlin (ZIB)" |
Definition at line 96 of file spxdefines.h.
Referenced by runSoPlex().
#define SOPLEX_DEFAULT_BND_VIOL 1e-6 |
default allowed bound violation
Definition at line 276 of file spxdefines.h.
Referenced by SPxFastRT< R >::SPxFastRT(), SPxFastRT< R >::SPxFastRT(), and Tolerances::Tolerances().
#define SOPLEX_DEFAULT_EPS_FACTOR 1e-20 |
Definition at line 283 of file spxdefines.h.
Referenced by Tolerances::Tolerances().
#define SOPLEX_DEFAULT_EPS_PIVOR 1e-10 |
Definition at line 289 of file spxdefines.h.
Referenced by Tolerances::Tolerances().
#define SOPLEX_DEFAULT_EPS_UPDATE 1e-16 |
Definition at line 286 of file spxdefines.h.
Referenced by Tolerances::Tolerances().
#define SOPLEX_DEFAULT_EPS_ZERO 1e-16 |
default allowed additive zero: 1.0 + EPS_ZERO == 1.0
Definition at line 280 of file spxdefines.h.
Referenced by Tolerances::setEpsilon(), SPxFastRT< R >::SPxFastRT(), SPxFastRT< R >::SPxFastRT(), and Tolerances::Tolerances().
#define SOPLEX_DEFAULT_INFINITY 1e100 |
Definition at line 291 of file spxdefines.h.
#define SOPLEX_DO_WITH_ERR_VERBOSITY | ( | do_something | ) |
Definition at line 158 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 145 of file spxdefines.h.
#define SOPLEX_MAX | ( | x, | |
y ) |
Definition at line 296 of file spxdefines.h.
Referenced by SPxSolverBase< Real >::delta(), StableSum< double >::operator double(), Random::setSeed(), SPxSolverBase< Real >::shiftLBbound(), SPxSolverBase< Real >::shiftLCbound(), SPxSolverBase< Real >::shiftLPbound(), SPxSolverBase< Real >::shiftUBbound(), SPxSolverBase< Real >::shiftUCbound(), and SPxSolverBase< Real >::shiftUPbound().
#define SOPLEX_MIN | ( | x, | |
y ) |
Definition at line 297 of file spxdefines.h.
#define SOPLEX_REAL | ( | x | ) |
Definition at line 271 of file spxdefines.h.
#define SOPLEX_REAL_FORMAT "lf" |
Definition at line 272 of file spxdefines.h.
#define SOPLEX_SUBVERSION 0 |
Definition at line 94 of file spxdefines.h.
Referenced by SPxSolverBase< Real >::subversion().
#define SOPLEX_THREADLOCAL thread_local |
SOPLEX_DEBUG.
Definition at line 195 of file spxdefines.h.
#define SOPLEX_VERSION 714 |
Definition at line 93 of file spxdefines.h.
Referenced by SPxSolverBase< Real >::version().
#define SPX_DEBUG | ( | x | ) |
Definition at line 182 of file spxdefines.h.
#define SPX_MAXSTRLEN 1024 |
maximum string length in SoPlex
Definition at line 299 of file spxdefines.h.
Referenced by NameSet::add(), and NameSet::memPack().
#define SPX_MSG_DEBUG | ( | x | ) |
Definition at line 181 of file spxdefines.h.
#define SPX_MSG_ERROR | ( | x | ) |
Prints out message x
if the verbosity level is at least SPxOut::ERROR.
Definition at line 162 of file spxdefines.h.
Referenced by TimerFactory::createTimer(), soplex::dlcmSizeRational(), soplex::dmaxSizeRational(), MPSInput::entryIgnored(), SSVectorBase< Real >::isConsistent(), main(), soplex::msginconsistent(), Rational::rationalErrorMessage(), runSoPlex(), LPRowBase< Real >::setType(), LPRowSetBase< Real >::setType(), soplex::sizeInBase(), soplex::spxSnprintf(), and MPSInput::syntaxError().
#define SPX_MSG_INCONSISTENT | ( | name | ) |
Definition at line 174 of file spxdefines.h.
Referenced by ClassArray< Nonzero< R > >::isConsistent(), ClassSet< T >::isConsistent(), DataArray< T >::isConsistent(), DataHashTable< HashItem, Info >::isConsistent(), DataSet< DATA >::isConsistent(), DSVectorBase< Real >::isConsistent(), IdList< T >::isConsistent(), IdxSet::isConsistent(), IsList< T >::isConsistent(), LPColSetBase< Real >::isConsistent(), LPRowSetBase< Real >::isConsistent(), NameSet::isConsistent(), SPxLPBase< Real >::isConsistent(), SSVectorBase< Real >::isConsistent(), SVectorBase< Real >::isConsistent(), SVSetBase< Real >::isConsistent(), and UnitVectorBase< Real >::isConsistent().
#define SPX_MSG_INFO1 | ( | spxout, | |
x ) |
Prints out message x
if the verbosity level is at least SPxOut::INFO1.
Definition at line 166 of file spxdefines.h.
Referenced by checkSolution(), checkSolutionRational(), checkSolutionReal(), printDualSolution(), printPrimalSolution(), and runSoPlex().
#define SPX_MSG_INFO2 | ( | spxout, | |
x ) |
Prints out message x
if the verbosity level is at least SPxOut::INFO2.
Definition at line 168 of file spxdefines.h.
#define SPX_MSG_INFO3 | ( | spxout, | |
x ) |
Prints out message x
if the verbosity level is at least SPxOut::INFO3.
Definition at line 170 of file spxdefines.h.
#define SPX_MSG_WARNING | ( | spxout, | |
x ) |
Prints out message x
if the verbosity level is at least SPxOut::WARNING.
Definition at line 164 of file spxdefines.h.
Referenced by runSoPlex().