Function lupnt::Max¶
Defined in File math_utils.cc
Function Documentation¶
-
Real lupnt::Max(Real x, Real y)¶
Return the larger of two autodiff scalars, comparing by underlying value (
.val()) and returning the correspondingReal(preserving its derivative information).Used e.g. by
environment/forces.ccto clamp an intermediate quantity to be non-negative before taking its square root (sqrt(Max(y2, 0.0))).- Parameters:
x – First value
y – Second value
- Returns:
xifx.val() > y.val(), elsey