aGrUM 3.3.2
a C++ library for (probabilistic) graphical models
math_utils.h File Reference

Useful macros for maths. More...

#include <cmath>
#include <limits>
#include <agrum/base/core/configuration/configuration.h>
#include <agrum/base/core/math/math_utils_tpl.h>
Include dependency graph for math_utils.h:

Go to the source code of this file.

Namespaces

namespace  gum
 gum is the global namespace for all aGrUM entities

Macros

#define M_LOG2E   1.4426950408889634074
#define M_PI   3.14159265358979323846
#define M_LN2   0.69314718055994530942
#define GUM_LOG_SQRT_2PI   .91893853320467274177
#define GUM_LOG2_OR_0(x)

Functions

template<typename T>
bool gum::isCloseToZero (T x, T tol=static_cast< T >(config().epsilonFine()))
 Is |x| <= tol ? By default, tol is the key core.epsilonFine of the configuration.
template<typename T>
bool gum::isCloseToOne (T x, T tol=static_cast< T >(config().epsilonFine()))
 Is |x - 1| <= tol ? By default, tol is the key core.epsilonFine of the configuration.
template<typename T>
bool gum::isfinite (T arg)

Detailed Description

Useful macros for maths.

Author
Christophe GONZALES(_at_AMU) and Pierre-Henri WUILLEMIN(_at_LIP6)

Definition in file math_utils.h.

Macro Definition Documentation

◆ GUM_LOG2_OR_0

◆ GUM_LOG_SQRT_2PI

#define GUM_LOG_SQRT_2PI   .91893853320467274177

Definition at line 69 of file math_utils.h.

◆ M_LN2

#define M_LN2   0.69314718055994530942

◆ M_LOG2E

#define M_LOG2E   1.4426950408889634074

Definition at line 57 of file math_utils.h.

◆ M_PI

#define M_PI   3.14159265358979323846

Definition at line 61 of file math_utils.h.