Stats.MinMax Method

Definition

Namespace: Numerics.NET.Statistics
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2

Overload List

MinMax<T>(Vector<T>) Returns the minimum and maximum value of the elements of a numerical variable.
MinMax<T>(IEnumerable<T>, Boolean) Returns the maximum value of the elements of a sequence.
MinMax<T>(IEnumerable<T>, IComparer<T>, Boolean) Returns the smallest and largest value of the elements of an array.

MinMax<T>(Vector<T>)

Returns the minimum and maximum value of the elements of a numerical variable.
C#
public static (T , T ) MinMax<T>(
	Vector<T> values
)

Parameters

values  Vector<T>
A Vector<T>.

Type Parameters

T

Return Value

ValueTuple<T, T>
A two-element array containing the minimum and maximum value of the elements of values.

Exceptions

ArgumentNullException

values is null.

MinMax<T>(IEnumerable<T>, Boolean)

Returns the maximum value of the elements of a sequence.
C#
public static (T , T ) MinMax<T>(
	IEnumerable<T> values,
	bool skipMissingValues = false
)
where T : Object, IComparable<T>

Parameters

values  IEnumerable<T>
A Double array.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the calculation. The default is false.

Type Parameters

T
The type of the elements of the sequence.

Return Value

ValueTuple<T, T>
The maximum value of the elements of values.

Exceptions

ArgumentNullException

values is null.

MinMax<T>(IEnumerable<T>, IComparer<T>, Boolean)

Returns the smallest and largest value of the elements of an array.
C#
public static (T , T ) MinMax<T>(
	IEnumerable<T> values,
	IComparer<T> comparer,
	bool skipMissingValues = false
)

Parameters

values  IEnumerable<T>
A Double array.
comparer  IComparer<T>
An IComparer<T> object that is used to compare instances of the generic type.
skipMissingValues  Boolean  (Optional)
Optional. Specifies whether missing values should be excluded from the calculation. The default is false.

Type Parameters

T
The type

Return Value

ValueTuple<T, T>
The maximum value of the elements of values.

Exceptions

ArgumentNullException

values is null.

See Also