Contents

ramp(in:count:)

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

Declaration

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

Parameters

  • range:

    The start and end values of the generated ramp.

  • count:

    The number of elements in the ramp.

Mentioned in

Discussion

Use this function to generate and return a vector populated with ramped values.

The following code generates a ramped vector with values in the range 0 ... 7:

    let ramp = vDSP.ramp(in: Float(0) ... 7,
                         count: 8)
    
    // Prints "[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0]".
    print(ramp)

See Also

Type Methods