36#ifndef NEKTAR_LIB_LIBUTILITIES_BASSICUTILS_SCALARMATH_H
37#define NEKTAR_LIB_LIBUTILITIES_BASSICUTILS_SCALARMATH_H
53template <
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;
64template int Smax(
const int a,
const int b,
const int k);
T Smax(const T a, const T b, const T k)
Return the soft max of between two scalars.
scalarT< T > log(scalarT< T > in)