Contents

maximum(_:)

Returns the single-precision maximum value of a vector.

Declaration

static func maximum<U>(_ vector: U) -> Float where U : AccelerateBuffer, U.Element == Float

Parameters

  • vector:

    The input vector.

Return Value

The maximum value of the vector.

Discussion

This function calculates the maximum value of the first N elements of input vector A, and writes the result to output scalar C.

[Image]

The following code shows an example of using this function:

let a: [Float] = [-1.5, 2.25, 3.6,
                  0.2, -0.1, -4.3]

let maximum = vDSP.maximum(a)
print("maximum", maximum) // Prints "maximum 3.6"

See Also

Type Methods