Nektar++
Functions
Smath Namespace Reference

Functions

template<class T >
Smax (const T a, const T b, const T k)
 Return the soft max of between two scalars. More...
 
template NekDouble Smax (const NekDouble a, const NekDouble b, const NekDouble k)
 
template int Smax (const int a, const int b, const int k)
 

Function Documentation

◆ Smax() [1/3]

template int Smath::Smax ( const int  a,
const int  b,
const int  k 
)

◆ Smax() [2/3]

template NekDouble Smath::Smax ( const NekDouble  a,
const NekDouble  b,
const NekDouble  k 
)

◆ Smax() [3/3]

template<class T >
T Smath::Smax ( const T  a,
const T  b,
const T  k 
)

Return the soft max of between two scalars.

Definition at line 53 of file Smath.hpp.

54{
55 T maxi = std::max(a, b) * k;
56 T mini = std::min(a, b) * k;
57 T xmax = (maxi + log(1.0 + exp(mini - maxi))) / k;
58 return xmax;
59}
scalarT< T > log(scalarT< T > in)
Definition: scalar.hpp:303

References tinysimd::log().

Referenced by Nektar::VariableConverter::GetMuAv().