copapy.clamp#

copapy.clamp(x, min_value, max_value)#

Clamp function to limit a value between a minimum and maximum.

Overloads:

The elements of a vector, tensor or array are clamped by array stencils for arrays and packed vectors or tensors. For x = nan the result is min_value.

Parameters:
  • x (Any) – Input value, vector, tensor or array

  • min_value (Any) – Minimum limit

  • max_value (Any) – Maximum limit

Returns:

Clamped value of x