AutoPas  3.0.0
Loading...
Searching...
No Matches
Namespaces | Functions
ConstexprMath.h File Reference
#include <limits>
Include dependency graph for ConstexprMath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  autopas
 This is the main namespace of AutoPas.
 
namespace  autopas::utils
 In this namespace some helper classes and functions can be found used inside of AutoPas.
 

Functions

template<typename T >
constexpr std::enable_if_t< std::is_floating_point_v< T >, T > autopas::utils::ConstexprMath::sqrt (T x, T epsilon)
 Calculates the square root of floating point values x based on Newton-Raphson methon.
 
template<typename T >
constexpr std::enable_if_t< std::is_integral_v< T >, T > autopas::utils::ConstexprMath::sqrt (T x)
 Calculates the square root of integral values x based on Newton-Raphson methon.
 

Detailed Description

Date
15.05.2023
Author
D. Martin

Function Documentation

◆ sqrt() [1/2]

template<typename T >
constexpr std::enable_if_t< std::is_integral_v< T >, T > autopas::utils::ConstexprMath::sqrt ( x)
constexpr

Calculates the square root of integral values x based on Newton-Raphson methon.

Template Parameters
Tintegral type
Parameters
xinput value
Returns
sqrt(x)

◆ sqrt() [2/2]

template<typename T >
constexpr std::enable_if_t< std::is_floating_point_v< T >, T > autopas::utils::ConstexprMath::sqrt ( x,
epsilon 
)
constexpr

Calculates the square root of floating point values x based on Newton-Raphson methon.

Template Parameters
Tfloating point type
Parameters
xinput value
epsilonepsilon value used for floating point accuracy comparison
Returns
sqrt(x)