Function

vDSP_minmgvD(_:_:_:_:)

Calculates the minimum magnitude in a double-precision vector.

Declaration

func vDSP_minmgvD(_ __A: UnsafePointer<Double>, _ __IA: vDSP_Stride, _ __C: UnsafeMutablePointer<Double>, _ __N: vDSP_Length)

Parameters

__A

Double-precision real input vector.

__I

Stride for A

__C

Output scalar

__N

The number of elements to process. If N is zero (0), this function returns -INFINITY.

Discussion

This function calculates the minimum magnitude of the first N elements of A and writes the result to C:

A diagram showing the operation of the vDSP_minmgv function. There are three rows. The top row represents the input, vector A. The second row represents the minimum value operation. The bottom row represents the output, vector C. The diagram has connecting lines from the input vectors to the operation and from the operation to the output vector indicating the relationships between the input and output.

The operation is:

*C = INFINITY;
for (n = 0; n < N; ++n)
    if (*C > |A[n*I]|)
        *C = |A[n*I]|;

See Also

Minimum Calculation

static func minimum<U>(U) -> Double

Returns the minimum element of a double-precision vector.

static func minimum<U>(U) -> Float

Returns the minimum element of a single-precision vector.

static func indexOfMinimum<U>(U) -> (UInt, Double)

Returns the minimum element, and its index, of a double-precision vector.

static func indexOfMinimum<U>(U) -> (UInt, Float)

Returns the minimum element, and its index, of a single-precision vector.

func vDSP_minmgv(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Float>, vDSP_Length)

Calculates the minimum magnitude in a single-precision vector.

func vDSP_minmgvi(UnsafePointer<Float>, vDSP_Stride, UnsafeMutablePointer<Float>, UnsafeMutablePointer<vDSP_Length>, vDSP_Length)

Calculates the minimum magnitude and corresponding index in a single-precision vector.