36 #ifndef NEKTAR_LIB_LIBUTILITIES_BASSICUTILS_SCALARMATH_H
37 #define NEKTAR_LIB_LIBUTILITIES_BASSICUTILS_SCALARMATH_H
53 template <
class T> T
Smax(
const T a,
const T b,
const T k)
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;
64 template int Smax(
const int a,
const int b,
const int k);
The above copyright notice and this permission notice shall be included.
template int Smax(const int a, const int b, const int k)
scalarT< T > log(scalarT< T > in)