tfel
Loading...
Searching...
No Matches
ConstExprMathFunctions.hxx File Reference
#include <limits>
#include "TFEL/Math/Forward/General.hxx"

Namespaces

namespace  tfel
 the namespace tfel encloses all the TFEL project. This namespace is empty.
namespace  tfel::math
 This namespace contains various classes and functions défining mathematical objects and numerical algorithms.

Functions

template<StandardArithmeticTypeConcept T>
TFEL_HOST_DEVICE constexpr T tfel::math::constexpr_fct::abs (const T v)
 compute the absolute value of a number using a TFEL_HOST_DEVICE constexpr function.
template<typename T>
TFEL_HOST_DEVICE constexpr T tfel::math::constexpr_fct::sqrt_helper (const T x, const T g)
template<typename T>
TFEL_HOST_DEVICE constexpr T tfel::math::constexpr_fct::sqrt (const T v)
 compute the square root of a number using the Heron algorithm using a TFEL_HOST_DEVICE constexpr function.

Detailed Description

Author
Thomas Helfer
Date
18/01/2015

Function Documentation

◆ sqrt()

template<typename T>
TFEL_HOST_DEVICE constexpr T tfel::math::constexpr_fct::sqrt ( const T v)
constexpr

compute the square root of a number using the Heron algorithm using a TFEL_HOST_DEVICE constexpr function.

This function is meant to compute some usefull constant at compile-time (see Cste for sqrt(2) and sqrt(3)).

Template Parameters
T: numerical type
Precondition
T must be a floatting point type
std::numeric_limits<T>::epsilon must be defined