Template Function GridKit::Math::min

Function Documentation

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

Smooth binary minimum function.

Smooth approximation to min(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 minimum of x and y