Vector Clear and Fill Functions

Populate vectors with zeros or a scalar value.

Topics

Clearing Vectors

static func clear<V>(inout V)

Populates a double-precision vector with zeros.

static func clear<V>(inout V)

Populates a single-precision vector with zeros.

func vDSP_vclr(UnsafeMutablePointer<Float>, vDSP_Stride, vDSP_Length)

Populates a single-precision vector with zeros.

Filling Vectors with a Single Scalar Value

static func fill<V>(inout V, with: Double)

Populates a double-precision vector with a specified scalar value.

static func fill<V>(inout V, with: Float)

Populates a single-precision vector with a specified scalar value.

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

Populates a single-precision vector with a specified scalar value.

func vDSP_vfillD(UnsafePointer<Double>, UnsafeMutablePointer<Double>, vDSP_Stride, vDSP_Length)

Populates a double-precision vector with a specified scalar value.

func vDSP_zvfill(UnsafePointer<DSPSplitComplex>, UnsafePointer<DSPSplitComplex>, vDSP_Stride, vDSP_Length)

Populates a complex single-precision vector with a specified scalar value.

See Also

Vector Generation, Filling, and Clearing

Vector Generation

Populate vectors with ramps, values from lookup tables, and window functions.