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

# vDSP_ztocD

Copies the contents of a split double-precision complex vector to an interleaved vector.

```
extern void vDSP_ztocD(const DSPDoubleSplitComplex *__Z, vDSP_Stride __IZ, DSPDoubleComplex *__C, vDSP_Stride __IC, vDSP_Length __N);
```

## Parameters

`__Z`

The split-complex input vector.

`__IZ`

The distance between the elements in the input vector.

`__C`

The interleaved-complex output vector.

`__IC`

The distance between the real elements in the output vector. For example, a stride of `2` corresponds to a single complex element.

`__N`

The number of complex elements that the function processes.

## Discussion

For example, the following code converts the contents of a [`DSPDoubleSplitComplex`](/documentation/Accelerate/DSPDoubleSplitComplex) structure to an array of [`DSPDoubleComplex`](/documentation/Accelerate/DSPDoubleComplex) structures :

```swift
    let srcReal = UnsafeMutableBufferPointer<Double>.allocate(capacity: 4)
    _ = srcReal.initialize(from: [1.0, 2.0, 3.0, 4.0])
    
    let srcImag = UnsafeMutableBufferPointer<Double>.allocate(capacity: 4)
    _ = srcImag.initialize(from: [10.0, 20.0, 30.0, 40.0])
    
    var source = DSPDoubleSplitComplex(realp: srcReal.baseAddress!,
                                       imagp: srcImag.baseAddress!)
    
    let destination = [DSPDoubleComplex](unsafeUninitializedCapacity: 4) {
        buffer, initializedCount in
        
        vDSP_ztocD(&source, 1,
                   buffer.baseAddress!, 2,
                   4)
        
        initializedCount = 4
    }
    
    // Prints:
    //     "[ DSPComplex(real: 1.0, imag: 10.0),
    //        DSPComplex(real: 2.0, imag: 20.0),
    //        DSPComplex(real: 3.0, imag: 30.0),
    //        DSPComplex(real: 4.0, imag: 40.0) ]".
    print(destination)
```

---

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)