Template Function GridKit::Math::max

Function Documentation

template<class LeftT, class RightT>
inline auto GridKit::Math::max(const LeftT x, const RightT y)

Smooth binary maximum function.

Smooth approximation to max(x, y), composed from the smooth ramp function.

Note

The two input types intentionally may differ. Model equations often compare a differentiable state or signal with a plain real parameter, limit, or literal bound. Keeping both template parameters lets the expression promote to the differentiable scalar type without forcing callers to cast every parameter.

Template Parameters:
  • LeftT – - scalar type of x

  • RightT – - scalar type of y

Parameters:
  • x[in] - First input signal

  • y[in] - Second input signal

Returns:

Smooth maximum of x and y