Scippy

SoPlex

Sequential object-oriented simPlex

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 "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   500
 
#define SOPLEX_SUBVERSION   0
 
#define SOPLEX_APIVERSION   11
 
#define SOPLEX_COPYRIGHT   "Copyright (c) 1996-2020 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 >
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...
 

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

◆ DEFAULT_BND_VIOL

#define DEFAULT_BND_VIOL   1e-6

default allowed bound violation

Definition at line 235 of file spxdefines.h.

◆ DEFAULT_EPS_FACTOR

#define DEFAULT_EPS_FACTOR   1e-20

Definition at line 242 of file spxdefines.h.

◆ DEFAULT_EPS_PIVOT

#define DEFAULT_EPS_PIVOT   1e-10

Definition at line 248 of file spxdefines.h.

◆ DEFAULT_EPS_UPDATE

#define DEFAULT_EPS_UPDATE   1e-16

Definition at line 245 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 239 of file spxdefines.h.

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

◆ DEFAULT_INFINITY

#define DEFAULT_INFINITY   1e100

Definition at line 250 of file spxdefines.h.

◆ DO_WITH_ERR_VERBOSITY

#define DO_WITH_ERR_VERBOSITY (   do_something)    { do_something; }

Definition at line 119 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 106 of file spxdefines.h.

◆ MAXIMUM

#define MAXIMUM (   x,
 
)    ((x)>(y) ? (x) : (y))

Definition at line 255 of file spxdefines.h.

Referenced by StableSum< double >::operator double().

◆ MINIMUM

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

Definition at line 256 of file spxdefines.h.

◆ MSG_DEBUG

◆ MSG_ERROR

◆ MSG_INFO1

#define MSG_INFO1 (   spxout,
 
)    { DO_WITH_TMP_VERBOSITY( SPxOut::INFO1, spxout, x ) }

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

Definition at line 127 of file spxdefines.h.

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

◆ MSG_INFO2

#define MSG_INFO2 (   spxout,
 
)    { DO_WITH_TMP_VERBOSITY( SPxOut::INFO2, spxout, x ) }

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

Definition at line 129 of file spxdefines.h.

Referenced by soplex::MPSreadBounds(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), soplex::MPSreadRows(), SPxLPBase< R >::readLPF(), and SPxLPBase< R >::readMPS().

◆ MSG_INFO3

#define MSG_INFO3 (   spxout,
 
)    { DO_WITH_TMP_VERBOSITY( SPxOut::INFO3, spxout, x ) }

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

Definition at line 131 of file spxdefines.h.

Referenced by soplex::MPSreadRhs().

◆ MSG_WARNING

#define MSG_WARNING (   spxout,
 
)    { DO_WITH_TMP_VERBOSITY( SPxOut::WARNING, spxout, x ) }

◆ MSGinconsistent

◆ REAL

#define REAL (   x)    x

Definition at line 230 of file spxdefines.h.

◆ REAL_FORMAT

#define REAL_FORMAT   "lf"

Definition at line 231 of file spxdefines.h.

◆ SOPLEX_APIVERSION

#define SOPLEX_APIVERSION   11

Definition at line 56 of file spxdefines.h.

◆ SOPLEX_COPYRIGHT

#define SOPLEX_COPYRIGHT   "Copyright (c) 1996-2020 Konrad-Zuse-Zentrum fuer Informationstechnik Berlin (ZIB)"

Definition at line 57 of file spxdefines.h.

Referenced by main().

◆ SOPLEX_SUBVERSION

#define SOPLEX_SUBVERSION   0

Definition at line 55 of file spxdefines.h.

◆ SOPLEX_VERSION

#define SOPLEX_VERSION   500

Definition at line 54 of file spxdefines.h.

◆ SPX_MAXSTRLEN

#define SPX_MAXSTRLEN   1024

maximum string length in SoPlex

Definition at line 258 of file spxdefines.h.

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

◆ THREADLOCAL

#define THREADLOCAL   thread_local

SOPLEX_DEBUG.

Definition at line 154 of file spxdefines.h.