Version: SMASH-3.1
numerics.h File Reference

Generic numerical functions. More...

#include <cmath>
#include <initializer_list>
#include "constants.h"

Go to the source code of this file.

Namespaces

 smash
 

Functions

template<typename N >
bool smash::almost_equal (const N x, const N y)
 Checks two numbers for relative approximate equality. More...
 
template<typename N >
bool smash::almost_equal_physics (const N x, const N y)
 Same as smash::almost_equal, but for physical checks like energy-momentum conservation small_number is enough precision-wise. More...
 
template<typename T = std::initializer_list<double>>
bool smash::is_any_nan (const T &collection)
 This function iterates through the elements of a collection and checks if any of them is NaN using the std::isnan function. More...
 

Detailed Description

Generic numerical functions.

This file collects generic numerical functions such as for approximate equality checks between to floating point values.

Definition in file numerics.h.