inbounds function

Clip value to a given range

Clip value to a given range

Clip xx to the interval [l,u][l, u]. This is useful to enforce box constraints.

inbounds(x, l, u)

Arguments

  • x: Value to clip.
  • l: Lower limit.
  • u: Upper limit.

Returns

l if x < l, u if x > u else x.

Author(s)

Olaf Mersmann olafm@statistik.tu-dortmund.de