<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/DenseVector_Double",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@SA@DenseVector_Double"
  },
  "title" : "DenseVector_Double"
}
-->

# DenseVector_Double

A structure that contains a dense vector of double-precision, floating-point values.

```
struct DenseVector_Double
```

## Overview

You typically use dense vectors to represent the unknowns vector, *x*, and the right-hand-side vector, *b*, in the matrix equation *Ax = b.* A [`DenseVector_Double`](/documentation/Accelerate/DenseVector_Double) structure provides a pointer to its underlying data and a count of its number of elements.

The following code shows an example of how to create a dense vector structure from an array of double-precision values. In this case, use [`withUnsafeMutableBufferPointer(_:)`](/documentation/Accelerate/AccelerateMutableBuffer/withUnsafeMutableBufferPointer(_:)) to pass a pointer to your collection. The [`DenseVector_Double`](/documentation/Accelerate/DenseVector_Double) structure is valid only during the execution of the closure. Don’t store or return the structure for later use.

```swift
var vectorValues: [Double] = [10, 20, 30, 40]
let vectorValuesCount = Int32(vectorValues.count)

vectorValues.withUnsafeMutableBufferPointer { vectorValuesPtr in
    
    let vector = DenseVector_Double(count: vectorValuesCount,
                                    data: vectorValuesPtr.baseAddress!)
    
    // Perform operations using `vector`.
}
```

## Topics

### Initializers

[`init(count:data:)`](/documentation/Accelerate/DenseVector_Double/init(count:data:))

Creates a new vector of double-precision values.

### Inspecting a Vector’s Structure and Data

[`count`](/documentation/Accelerate/DenseVector_Double/count)

The number of items in the vector.

[`data`](/documentation/Accelerate/DenseVector_Double/data)

The array of double-precision, floating-point values.



---

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)