Skip to contents

Clip mlx array values into a range

Usage

mlx_clip(x, min = NULL, max = NULL)

Arguments

x

An mlx array, or an R array/matrix/vector that will be converted via as_mlx().

min, max

Scalar bounds. Use NULL to leave a bound open.

Value

An mlx array with values clipped to [min, max].

See also

Examples

if (FALSE) { # \dontrun{
x <- as_mlx(rnorm(4))
mlx_clip(x, min = -1, max = 1)
} # }