Vector<T>.Clip Method

Returns a vector whose elements are the components of a vector constrained to be within the specified interval.

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
public static Vector<T> Clip(
	Vector<T> vector,
	T lowerBound,
	T upperBound
)

Parameters

vector  Vector<T>
A Vector<T>.
lowerBound  T
The lower bound of the interval.
upperBound  T
The upper bound of the interval.

Return Value

Vector<T>
A vector whose elements are the corresponding element of vector constrained as follows: If the value is less than or equal to lowerBound, then lowerBound; otherwise, if the value is greater than or equal to upperBound, then upperBound; otherwise, the value is unchanged.

Exceptions

ArgumentNullExceptionvector is null.

See Also