SoPlex Documentation
Loading...
Searching...
No Matches
spxdefines.h File Reference

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   712
 
#define SOPLEX_SUBVERSION   0
 
#define SOPLEX_APIVERSION   17
 
#define SOPLEX_COPYRIGHT   "Copyright (c) 1996-2024 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 >
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
 

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

◆ SOPLEX_APIVERSION

#define SOPLEX_APIVERSION   17

Definition at line 96 of file spxdefines.h.

◆ SOPLEX_ASSERT_WARN

#define SOPLEX_ASSERT_WARN ( prefix,
expr )
Value:
( 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 126 of file spxdefines.h.

◆ SOPLEX_COPYRIGHT

#define SOPLEX_COPYRIGHT   "Copyright (c) 1996-2024 Zuse Institute Berlin (ZIB)"

Definition at line 97 of file spxdefines.h.

Referenced by runSoPlex().

◆ SOPLEX_DEFAULT_BND_VIOL

#define SOPLEX_DEFAULT_BND_VIOL   1e-6

default allowed bound violation

Definition at line 277 of file spxdefines.h.

◆ SOPLEX_DEFAULT_EPS_FACTOR

#define SOPLEX_DEFAULT_EPS_FACTOR   1e-20

Definition at line 284 of file spxdefines.h.

◆ SOPLEX_DEFAULT_EPS_PIVOR

#define SOPLEX_DEFAULT_EPS_PIVOR   1e-10

Definition at line 290 of file spxdefines.h.

◆ SOPLEX_DEFAULT_EPS_UPDATE

#define SOPLEX_DEFAULT_EPS_UPDATE   1e-16

Definition at line 287 of file spxdefines.h.

◆ SOPLEX_DEFAULT_EPS_ZERO

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

Referenced by Tolerances::setEpsilon().

◆ SOPLEX_DEFAULT_INFINITY

#define SOPLEX_DEFAULT_INFINITY   1e100

Definition at line 292 of file spxdefines.h.

◆ SOPLEX_DO_WITH_ERR_VERBOSITY

#define SOPLEX_DO_WITH_ERR_VERBOSITY ( do_something)
Value:
{ do_something; }

Definition at line 159 of file spxdefines.h.

◆ SOPLEX_DO_WITH_TMP_VERBOSITY

#define SOPLEX_DO_WITH_TMP_VERBOSITY ( verbosity,
spxout,
do_something )
Value:
{ \
if( &spxout != nullptr ) \
{ \
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 SPX_MSG_ERROR, SPX_MSG_WARNING, etc.

Definition at line 146 of file spxdefines.h.

◆ SOPLEX_MAX

◆ SOPLEX_MIN

#define SOPLEX_MIN ( x,
y )
Value:
((x)<(y) ? (x) : (y))

Definition at line 298 of file spxdefines.h.

◆ SOPLEX_REAL

#define SOPLEX_REAL ( x)
Value:
x

Definition at line 272 of file spxdefines.h.

◆ SOPLEX_REAL_FORMAT

#define SOPLEX_REAL_FORMAT   "lf"

Definition at line 273 of file spxdefines.h.

◆ SOPLEX_SUBVERSION

#define SOPLEX_SUBVERSION   0

Definition at line 95 of file spxdefines.h.

Referenced by SPxSolverBase< R >::subversion().

◆ SOPLEX_THREADLOCAL

#define SOPLEX_THREADLOCAL   thread_local

SOPLEX_DEBUG.

Definition at line 196 of file spxdefines.h.

◆ SOPLEX_VERSION

#define SOPLEX_VERSION   712

Definition at line 94 of file spxdefines.h.

Referenced by SPxSolverBase< R >::version().

◆ SPX_DEBUG

#define SPX_DEBUG ( x)

Definition at line 183 of file spxdefines.h.

◆ SPX_MAXSTRLEN

#define SPX_MAXSTRLEN   1024

maximum string length in SoPlex

Definition at line 300 of file spxdefines.h.

Referenced by NameSet::add(), and NameSet::memPack().

◆ SPX_MSG_DEBUG

#define SPX_MSG_DEBUG ( x)

Definition at line 182 of file spxdefines.h.

◆ SPX_MSG_ERROR

◆ SPX_MSG_INCONSISTENT

◆ SPX_MSG_INFO1

#define SPX_MSG_INFO1 ( spxout,
x )
Value:
{ SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::INFO1, spxout, x ) }
#define SOPLEX_DO_WITH_TMP_VERBOSITY(verbosity, spxout, do_something)
Definition spxdefines.h:146

Prints out message x if the verbosity level is at least SPxOut::INFO1.

Definition at line 167 of file spxdefines.h.

Referenced by checkSolution(), checkSolutionRational(), checkSolutionReal(), printDualSolution(), printPrimalSolution(), and runSoPlex().

◆ SPX_MSG_INFO2

#define SPX_MSG_INFO2 ( spxout,
x )
Value:
{ SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::INFO2, spxout, x ) }

Prints out message x if the verbosity level is at least SPxOut::INFO2.

Definition at line 169 of file spxdefines.h.

◆ SPX_MSG_INFO3

#define SPX_MSG_INFO3 ( spxout,
x )
Value:
{ SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::INFO3, spxout, x ) }

Prints out message x if the verbosity level is at least SPxOut::INFO3.

Definition at line 171 of file spxdefines.h.

◆ SPX_MSG_WARNING

#define SPX_MSG_WARNING ( spxout,
x )
Value:
{ SOPLEX_DO_WITH_TMP_VERBOSITY( SPxOut::WARNING, spxout, x ) }

Prints out message x if the verbosity level is at least SPxOut::WARNING.

Definition at line 165 of file spxdefines.h.

Referenced by runSoPlex().