ILNumerics Ultimate VSExtensionMethodsGetLimits Method (BaseArrayDouble, Double, Double, Boolean)ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Finds the minimum and maximum values among all elements of A, optionally ignoring special floating point values.

[ILNumerics Core Module]

Namespace: ILNumerics
Assembly: ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.3.0.0 (5.3.7131.2749)
Syntax

public static bool GetLimits(
	this BaseArray<double> A,
	out double min,
	out double max,
	bool ignoreInfinity = false
)

Parameters

A
Type: ILNumericsBaseArrayDouble
Input array.
min
Type: SystemDouble
[Output] The minimum value in A.
max
Type: SystemDouble
[Output] The maximum value in A.
ignoreInfinity (Optional)
Type: SystemBoolean
[Optional] When true only non-infinity and non-NaN values will be considered as regular values. Default: false.

Return Value

Type: Boolean
True, if the minimum and maximum values could be computed. False otherwise.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BaseArrayDouble. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions

ExceptionCondition
ArgumentExceptionIf A is empty.
Remarks

For complex values the real and imaginary parts of all elements are considered independently and the limits are returned separated in the real and imaginary parts of min and max.

The operation is efficiently performed on all elements of the input A in a single run.

The operation is performed in multiple threads, according to the current settings of MaxNumberThreads.

The input A is not altered.

The function always succeeds and returns true for non-empty arrays of integer (non-floating point) element types. Overloads for floating point element types: the function succeeds on non-empty arrays which have at least one element other than NaN and / or 'Infinity' - depending on the setting of ignoreInfinity.

The optional parameter ignoreInfinity is useful, for example, to determine the minimum and maximum values stored inside this array in order to find scaling factors and for normalization purposes. Here, NegativeInfinity and PositiveInfinity can be ignored since they would be not useful as scaling factors. For the default value ('false') infinity values are considered regular values and contribute to the result.

For arrays of real element types (Double and Single) the value of the output parameters min and max is undefined if the function returns . For complex element types the individual parts of min and max determine the limits found among the real parts and among the imaginary parts. If limits could be computed for the real parts of the elements these limits will be stored into the real parts of min and max. Similarly, the limits among the imaginary elements are stored into the imaginary parts of min and max. If no limit could be computed (because all real or all imaginary element parts are all either NaN or Infinity (and ignoreInfinity was ) the corresponding part of min and max will be NaN.

[ILNumerics Core Module]

See Also

Reference