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 "soplex/config.h"
#include "boost/multiprecision/number.hpp"
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/gmp.hpp>
#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   600
 
#define SOPLEX_SUBVERSION   0
 
#define SOPLEX_APIVERSION   13
 
#define SOPLEX_COPYRIGHT   "Copyright (c) 1996-2022 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...
 
template<boost::multiprecision::expression_template_option eto>
number< gmp_rational, eto > ldexp (number< gmp_rational, eto >, int exp)
 
template<boost::multiprecision::expression_template_option eto>
number< gmp_rational, eto > frexp (number< gmp_rational, eto >, int *exp)
 
template<typename T , boost::multiprecision::expression_template_option eto>
boost::multiprecision::number< T, eto > spxFrexp (boost::multiprecision::number< T, eto > y, int *exp)
 
template<typename T , boost::multiprecision::expression_template_option eto>
boost::multiprecision::number< T > spxLdexp (boost::multiprecision::number< T, eto > x, int exp)
 
template<typename T , expression_template_option ep>
number< T, ep > spxSqrt (number< T, ep > a)
 
template<typename T , expression_template_option eto>
number< T, eto > spxNextafter (number< T, eto > x, number< T, eto > y)
 
template<typename T >
number< T > spxSqrt (number< T > a)
 
template<typename T , expression_template_option et>
number< T, et > maxAbs (number< T, et > a, number< T, et > b)
 returns max(|a|,|b|) More...
 
template<typename T , expression_template_option et>
number< T, et > relDiff (number< T, et > a, number< T, et > b)
 

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

◆ DEFAULT_BND_VIOL

#define DEFAULT_BND_VIOL   1e-6

default allowed bound violation

Definition at line 264 of file spxdefines.h.

Referenced by Presol< R >::getBasis().

◆ DEFAULT_EPS_FACTOR

#define DEFAULT_EPS_FACTOR   1e-20

Definition at line 271 of file spxdefines.h.

◆ DEFAULT_EPS_PIVOT

#define DEFAULT_EPS_PIVOT   1e-10

Definition at line 277 of file spxdefines.h.

◆ DEFAULT_EPS_UPDATE

#define DEFAULT_EPS_UPDATE   1e-16

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

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

◆ DEFAULT_INFINITY

#define DEFAULT_INFINITY   1e100

Definition at line 279 of file spxdefines.h.

◆ DO_WITH_ERR_VERBOSITY

#define DO_WITH_ERR_VERBOSITY (   do_something)    { do_something; }

Definition at line 148 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 ); \
} \
} \
}
Verbosity
Verbosity level.
Definition: spxout.h:72

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

◆ MAXIMUM

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

Definition at line 284 of file spxdefines.h.

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

◆ MINIMUM

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

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

Referenced by checkSolution(), checkSolutionRational(), checkSolutionReal(), Presol< R >::getBasis(), printDualSolution(), printPrimalSolution(), and runSoPlex().

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

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

◆ MSG_WARNING

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

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

Definition at line 154 of file spxdefines.h.

Referenced by Presol< R >::getBasis(), and runSoPlex().

◆ MSGinconsistent

◆ REAL

#define REAL (   x)    x

Definition at line 259 of file spxdefines.h.

◆ REAL_FORMAT

#define REAL_FORMAT   "lf"

Definition at line 260 of file spxdefines.h.

◆ SOPLEX_APIVERSION

#define SOPLEX_APIVERSION   13

Definition at line 85 of file spxdefines.h.

◆ SOPLEX_COPYRIGHT

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

Definition at line 86 of file spxdefines.h.

Referenced by runSoPlex().

◆ SOPLEX_SUBVERSION

#define SOPLEX_SUBVERSION   0

Definition at line 84 of file spxdefines.h.

◆ SOPLEX_VERSION

#define SOPLEX_VERSION   600

Definition at line 83 of file spxdefines.h.

◆ SPX_MAXSTRLEN

#define SPX_MAXSTRLEN   1024

maximum string length in SoPlex

Definition at line 287 of file spxdefines.h.

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

◆ THREADLOCAL

#define THREADLOCAL   thread_local

SOPLEX_DEBUG.

Definition at line 183 of file spxdefines.h.