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  Param
 

Namespaces

namespace  soplex
 Everything should be within this namespace.
 

Macros

#define SOPLEX_VERSION   604
 
#define SOPLEX_SUBVERSION   0
 
#define SOPLEX_APIVERSION   13
 
#define SOPLEX_COPYRIGHT   "Copyright (c) 1996-2023 Zuse Institute Berlin (ZIB)"
 
#define ASSERT_WARN(prefix, expr)   ( assert( expr ) )
 Macro to turn some assertions into warnings.
 
#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.
 
#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.
 
#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.
 
#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.
 
#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.
 
#define MSGinconsistent(name)   msginconsistent(name, __FILE__, __LINE__)
 
#define MSG_DEBUG(x)
 
#define THREADLOCAL   thread_local
 SOPLEX_DEBUG.
 
#define REAL(x)   x
 
#define REAL_FORMAT   "lf"
 
#define DEFAULT_BND_VIOL   1e-6
 default allowed bound violation
 
#define DEFAULT_EPS_ZERO   1e-16
 default allowed additive zero: 1.0 + EPS_ZERO == 1.0
 
#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|
 
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

◆ ASSERT_WARN

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

Parameters
prefixShort string for grepping in source code.
exprExpression that must be satisfied.

Definition at line 125 of file spxdefines.h.

◆ DEFAULT_BND_VIOL

#define DEFAULT_BND_VIOL   1e-6

default allowed bound violation

Definition at line 274 of file spxdefines.h.

◆ DEFAULT_EPS_FACTOR

#define DEFAULT_EPS_FACTOR   1e-20

Definition at line 281 of file spxdefines.h.

◆ DEFAULT_EPS_PIVOT

#define DEFAULT_EPS_PIVOT   1e-10

Definition at line 287 of file spxdefines.h.

◆ DEFAULT_EPS_UPDATE

#define DEFAULT_EPS_UPDATE   1e-16

Definition at line 284 of file spxdefines.h.

◆ DEFAULT_EPS_ZERO

#define DEFAULT_EPS_ZERO   1e-16

default allowed additive zero: 1.0 + EPS_ZERO == 1.0

Definition at line 278 of file spxdefines.h.

Referenced by SPxFastRT< R >::setDelta(), and SPxRatioTester< R >::setDelta().

◆ DEFAULT_INFINITY

#define DEFAULT_INFINITY   1e100

Definition at line 289 of file spxdefines.h.

◆ DO_WITH_ERR_VERBOSITY

#define DO_WITH_ERR_VERBOSITY ( do_something)    { do_something; }

Definition at line 158 of file spxdefines.h.

◆ DO_WITH_TMP_VERBOSITY

#define DO_WITH_TMP_VERBOSITY ( verbosity,
spxout,
do_something )
Value:
{ \
if( &spxout != NULL ) \
{ \
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 MSG_ERROR, MSG_WARNING, etc.

Definition at line 145 of file spxdefines.h.

◆ MAXIMUM

◆ MINIMUM

#define MINIMUM ( x,
y )   ((x)<(y) ? (x) : (y))

Definition at line 295 of file spxdefines.h.

◆ MSG_DEBUG

◆ MSG_ERROR

◆ MSG_INFO1

#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 166 of file spxdefines.h.

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

◆ MSG_INFO2

#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 168 of file spxdefines.h.

◆ MSG_INFO3

#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 170 of file spxdefines.h.

◆ MSG_WARNING

#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 164 of file spxdefines.h.

Referenced by runSoPlex().

◆ MSGinconsistent

◆ REAL

#define REAL ( x)    x

Definition at line 269 of file spxdefines.h.

◆ REAL_FORMAT

#define REAL_FORMAT   "lf"

Definition at line 270 of file spxdefines.h.

◆ SOPLEX_APIVERSION

#define SOPLEX_APIVERSION   13

Definition at line 95 of file spxdefines.h.

◆ SOPLEX_COPYRIGHT

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

Definition at line 96 of file spxdefines.h.

Referenced by runSoPlex().

◆ SOPLEX_SUBVERSION

#define SOPLEX_SUBVERSION   0

Definition at line 94 of file spxdefines.h.

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

◆ SOPLEX_VERSION

#define SOPLEX_VERSION   604

Definition at line 93 of file spxdefines.h.

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

◆ SPX_MAXSTRLEN

#define SPX_MAXSTRLEN   1024

maximum string length in SoPlex

Definition at line 297 of file spxdefines.h.

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

◆ THREADLOCAL

#define THREADLOCAL   thread_local

SOPLEX_DEBUG.

Definition at line 193 of file spxdefines.h.