newton.math.vec_inside_limits#

newton.math.vec_inside_limits(a, lower, upper)[source]#

Check whether every element of a vector lies within the given bounds.

Returns True when lower[i] <= a[i] <= upper[i] for all elements.

Parameters:
  • a (Any) – Vector to test.

  • lower (Any) – Element-wise lower bounds (inclusive).

  • upper (Any) – Element-wise upper bounds (inclusive).

Returns:

True if all elements are within bounds, False otherwise.

Return type:

bool