---
title: "formRamp(withInitialValue:increment:result:)"
framework: accelerate
role: symbol
role_heading: Type Method
path: "accelerate/vdsp/formramp(withinitialvalue:increment:result:)-40zxg"
---

# formRamp(withInitialValue:increment:result:)

Populates a single-precision vector with monotonically incrementing or decrementing values using an initial value and increment.

## Declaration

```swift
static func formRamp<V>(withInitialValue initialValue: Float, increment: Float, result: inout V) where V : AccelerateMutableBuffer, V.Element == Float
```

## Parameters

- `initialValue`: The initial value of the ramp.
- `increment`: The increment, or decrement if negative, between each generated element.
- `result`: The array that receives the generated ramp.

## Discussion

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 n = 8          let ramp = [Float](unsafeUninitializedCapacity: n) {         buffer, initializedCount in                  vDSP.formRamp(withInitialValue: 0,                       increment: 1,                       result: &buffer)                  initializedCount = n     }          // Prints "[0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0]".     print(ramp)

## See Also

### Type Methods

- [absolute(_:)](accelerate/vdsp/absolute(_:)-9c3ge.md)
- [absolute(_:)](accelerate/vdsp/absolute(_:)-5ehc1.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-9x5jn.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-1wu9x.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-657bd.md)
- [absolute(_:result:)](accelerate/vdsp/absolute(_:result:)-4pigo.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-9mv1a.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-2ftxc.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-53nh9.md)
- [add(_:_:)](accelerate/vdsp/add(_:_:)-7swvf.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-2531u.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-2w0o9.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-338hl.md)
- [add(_:_:result:)](accelerate/vdsp/add(_:_:result:)-3vzwi.md)
- [add(_:to:count:result:)](accelerate/vdsp/add(_:to:count:result:)-g1dk.md)
