Function

vDSP_vfilli(_:_:_:_:)

Populates an integer vector with a specified scalar value.

Declaration

func vDSP_vfilli(_ __A: UnsafePointer<Int32>, _ __C: UnsafeMutablePointer<Int32>, _ __IC: vDSP_Stride, _ __N: vDSP_Length)

Discussion

The functions in this group populate a vector with a specified scalar value.

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

let n = vDSP_Length(10)
let stride = vDSP_Stride(1)

var a = Float.pi

var c = [Float](repeating: .nan,
                count: Int(n))

vDSP_vfill(&a,
           &c,
           stride,
           n)

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

See Also

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.