OpenGM  2.3.x
Discrete Graphical Model Library
Classes | Namespaces | Macros | Typedefs | Functions
opengm.hxx File Reference
#include <stdexcept>
#include <sstream>
#include "opengm/config.hxx"
#include "opengm/utilities/metaprogramming.hxx"
+ Include dependency graph for opengm.hxx:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  opengm::RuntimeError
 OpenGM runtime error. More...
 

Namespaces

 opengm
 The OpenGM namespace.
 

Macros

#define OPENGM_HXX
 
#define OPENGM_CHECK_OP(a, op, b, message)
 
#define OPENGM_CHECK(expression, message)
 
#define OPENGM_ASSERT_OP(a, op, b)
 runtime assertion More...
 
#define OPENGM_ASSERT(expression)
 
#define OPENGM_META_ASSERT(assertion, msg)
 opengm compile time assertion More...
 

Typedefs

typedef double opengm::DefaultTimingType
 
typedef opengm::UIntType opengm::SerializationIndexType
 

Functions

template<class T >
opengm::abs (const T &x)
 
template<class T >
opengm::opengmMax (const T &x, const T &y)
 
template<class T >
opengm::opengmMin (const T &x, const T &y)
 

Macro Definition Documentation

#define OPENGM_ASSERT (   expression)
Value:
if(!(expression)) { \
std::stringstream s; \
s << "OpenGM assertion " << #expression \
<< " failed in file " << __FILE__ \
<< ", line " << __LINE__ << std::endl; \
throw std::runtime_error(s.str()); \
}

Definition at line 77 of file opengm.hxx.

#define OPENGM_ASSERT_OP (   a,
  op,
 
)
Value:
if(! static_cast<bool>( a op b ) ) { \
std::stringstream s; \
s << "OpenGM assertion : " << #a <<#op <<#b<< " failed:\n"; \
s << #a " = "<<a<<"\n"; \
s << #b " = "<<b<<"\n"; \
s << "in file " << __FILE__ << ", line " << __LINE__ << "\n"; \
throw std::runtime_error(s.str()); \
}

runtime assertion

Definition at line 53 of file opengm.hxx.

#define OPENGM_CHECK (   expression,
  message 
)
Value:
if(!(expression)) { \
std::stringstream s; \
s << message <<"\n";\
s << "OpenGM assertion " << #expression \
<< " failed in file " << __FILE__ \
<< ", line " << __LINE__ << std::endl; \
throw std::runtime_error(s.str()); \
}

Definition at line 27 of file opengm.hxx.

#define OPENGM_CHECK_OP (   a,
  op,
  b,
  message 
)
Value:
if(! static_cast<bool>( a op b ) ) { \
std::stringstream s; \
s << "OpenGM Error: "<< message <<"\n";\
s << "OpenGM check : " << #a <<#op <<#b<< " failed:\n"; \
s << #a " = "<<a<<"\n"; \
s << #b " = "<<b<<"\n"; \
s << "in file " << __FILE__ << ", line " << __LINE__ << "\n"; \
throw std::runtime_error(s.str()); \
}

Definition at line 16 of file opengm.hxx.

#define OPENGM_HXX

Definition at line 3 of file opengm.hxx.

#define OPENGM_META_ASSERT (   assertion,
  msg 
)
Value:
{ \
meta::Assert< meta::Compare< meta::Bool<(assertion)> , meta::Bool<true> >::value > \
OPENGM_COMPILE_TIME_ASSERTION_FAILED_____REASON_____##msg; \
(void) OPENGM_COMPILE_TIME_ASSERTION_FAILED_____REASON_____##msg; \
}

opengm compile time assertion

Definition at line 87 of file opengm.hxx.