Vector Generation

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

Topics

Vector Generation with Ramps

static func ramp(withInitialValue: Double, increment: Double, count: Int) -> [Double]

Returns a double-precision vector that contains monotonically incrementing or decrementing values.

static func ramp(withInitialValue: Float, increment: Float, count: Int) -> [Float]

Returns a single-precision vector that contains monotonically incrementing or decrementing values.

static func formRamp<V>(withInitialValue: Double, increment: Double, result: inout V)

Populates a double-precision vector with monotonically incrementing or decrementing values.

static func formRamp<V>(withInitialValue: Float, increment: Float, result: inout V)

Populates a single-precision vector with monotonically incrementing or decrementing values.

Vector Generation with Tapered Ramps

static func ramp(in: ClosedRange<Double>, count: Int) -> [Double]

Returns a double-precision vector that contains monotonically incrementing or decrementing values within a specified range.

static func ramp(in: ClosedRange<Float>, count: Int) -> [Float]

Returns a single-precision vector that contains monotonically incrementing or decrementing values within a specified range.

static func formRamp<V>(in: ClosedRange<Double>, result: inout V)

Populates a double-precision vector with monotonically incrementing or decrementing values within a specified range.

static func formRamp<V>(in: ClosedRange<Float>, result: inout V)

Populates a single-precision vector with monotonically incrementing or decrementing values within a specified range.

Vector Generation with Ramps, Multiplying by a Second Vector

static func ramp<U>(withInitialValue: inout Double, multiplyingBy: U, increment: Double) -> [Double]

Returns a double-precision vector that contains monotonically incrementing or decrementing values, multiplied by a source vector.

static func ramp<U>(withInitialValue: inout Float, multiplyingBy: U, increment: Float) -> [Float]

Returns a single-precision vector that contains monotonically incrementing or decrementing values, multiplied by a source vector.

static func stereoRamp<U>(withInitialValue: inout Double, multiplyingBy: U, U, increment: Double) -> (firstOutput: [Double], secondOutput: [Double])

Returns a double-precision vector that contains stereo monotonically incrementing or decrementing values, multiplied by a source vector.

static func stereoRamp<U>(withInitialValue: inout Float, multiplyingBy: U, U, increment: Float) -> (firstOutput: [Float], secondOutput: [Float])

Returns a single-precision vector that contains stereo monotonically incrementing or decrementing values, multiplied by a source vector.

static func formRamp<U, V>(withInitialValue: inout Double, multiplyingBy: U, increment: Double, result: inout V)

Populates a double-precision vector with monotonically incrementing or decrementing values, multiplied by a source vector.

static func formRamp<U, V>(withInitialValue: inout Float, multiplyingBy: U, increment: Float, result: inout V)

Populates a single-precision vector with monotonically incrementing or decrementing values, multiplied by a source vector.

static func formStereoRamp<U, V>(withInitialValue: inout Double, multiplyingBy: U, U, increment: Double, results: inout V, inout V)

Populates a double-precision vector with stereo monotonically incrementing or decrementing values, multiplied by a source vector.

static func formStereoRamp<U, V>(withInitialValue: inout Float, multiplyingBy: U, U, increment: Float, results: inout V, inout V)

Populates a single-precision vector with stereo monotonically incrementing or decrementing values, multiplied by a source vector.

Vector Addition with Ramps, Multiplying by a Second Vector

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

Multiplies a single-precision input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

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

Multiplies a double-precision input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

func vDSP_vrampmuladd_s1_15(UnsafePointer<Int16>, vDSP_Stride, UnsafeMutablePointer<Int16>, UnsafePointer<Int16>, UnsafeMutablePointer<Int16>, vDSP_Stride, vDSP_Length)

Multiplies a fixed-point, 1.15 format, input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

func vDSP_vrampmuladd_s8_24(UnsafePointer<Int32>, vDSP_Stride, UnsafeMutablePointer<Int32>, UnsafePointer<Int32>, UnsafeMutablePointer<Int32>, vDSP_Stride, vDSP_Length)

Multiplies a fixed-point, 8.24 format, input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

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

Multiplies a single-precision, stereo input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

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

Multiplies a double-precision, stereo input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

func vDSP_vrampmuladd2_s1_15(UnsafePointer<Int16>, UnsafePointer<Int16>, vDSP_Stride, UnsafeMutablePointer<Int16>, UnsafePointer<Int16>, UnsafeMutablePointer<Int16>, UnsafeMutablePointer<Int16>, vDSP_Stride, vDSP_Length)

Multiplies a fixed-point, 1.15 format, stereo input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

func vDSP_vrampmuladd2_s8_24(UnsafePointer<Int32>, UnsafePointer<Int32>, vDSP_Stride, UnsafeMutablePointer<Int32>, UnsafePointer<Int32>, UnsafeMutablePointer<Int32>, UnsafeMutablePointer<Int32>, vDSP_Stride, vDSP_Length)

Multiplies a fixed-point, 8.24 format, stereo input vector by a value that ramps up on successive calls, and cumulatively adds the result to the output vector.

Vector Generation with Window Functions

See Also

Vector Generation, Filling, and Clearing

Vector Clear and Fill Functions

Populate vectors with zeros or a scalar value.