<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.10.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/vDSP_vrampmulD",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@vDSP_vrampmulD"
  },
  "title" : "vDSP_vrampmulD"
}
-->

# vDSP_vrampmulD

Generates a double-precision vector that contains monotonically incrementing or decrementing values, and multiplies that vector by a source vector.

```
void vDSP_vrampmulD(const double *__I, vDSP_Stride __IS, double *__Start, const double *__Step, double *__O, vDSP_Stride __OS, vDSP_Length __N);
```

## Parameters

`__I`

The input vector that the function multiplies by the ramp.

`__IS`

The distance between the elements in the input vector.

`__Start`

On input, the initial value of the ramp. On output, the next value in the ramp.

`__Step`

The increment, or decrement if negative, between each generated element.

`__O`

The output vector.

`__OS`

The distance between the elements in the output vector.

`__N`

The number of elements that the function processes.

## Discussion

Use this function to generate and return a vector populated with ramped values with each element multiplied by the corresponding element in a second vector.

The following code generates a ramped vector with values in the range `0 ... 7`. The function multiplies elements at even indices by `10` and multiplies elements at odd indices by `100`.

```swift
    let n = 8
    let stride = 1
    
    var initialValue: Double = 0
    var increment: Double = 1
    
    let ramp = [Double](unsafeUninitializedCapacity: n) {
        buffer, initializedCount in
        
        vDSP_vrampmulD([10, 100, 10, 100, 10, 100, 10, 100],
                       stride,
                       &initialValue,
                       &increment,
                       buffer.baseAddress!,
                       stride,
                       vDSP_Length(n))
        
        initializedCount = n
    }
    
    // Prints "[0.0, 100.0, 20.0, 300.0, 40.0, 500.0, 60.0, 700.0]".
    print(ramp)
    
    // Prints "8".
    print(initialValue)
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)