Contents

clear(_:)

Populates a double-precision vector with zeros.

Declaration

static func clear<V>(_ vector: inout V) where V : AccelerateMutableBuffer, V.Element == Double

Parameters

  • vector:

    The vector to populate with zeros.

Discussion

This function populates a vector with zeros.

The following code shows how to clear the array c, setting the value of each element to zero:

var c = [Double](repeating: .nan,
                count: 10)

vDSP.clear(&c)

// Prints "[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]"
print(c)

See Also

Type Methods