[ILNumerics Core Module]
Namespace: ILNumerics
Assembly: ILNumerics.Core (in ILNumerics.Core.dll) Version: 5.5.0.0 (5.5.7503.3146)
public static bool GetLimits( this BaseArray<fcomplex> A, out fcomplex min, out fcomplex max, bool ignoreInfinity = false )
Parameters
- A
- Type: ILNumerics.BaseArray<fcomplex>
Input array. - min
- Type: ILNumerics.fcomplex
[Output] The minimum value in A. - max
- Type: ILNumerics.fcomplex
[Output] The maximum value in A. - ignoreInfinity (Optional)
- Type: System.Boolean
[Optional] When true only non-infinity and non-NaN values will be considered as regular values. Default: false.
Return Value
Type: BooleanTrue, 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 BaseArray<fcomplex>. 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).Exception | Condition |
---|---|
ArgumentException | If A is empty. |
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, [!:fcomplex.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 false. 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 true) the corresponding part of min and max will be NaN.
[ILNumerics Core Module]