<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/SparseMatrix_Double/init(structure:data:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "s:So19SparseMatrix_Doublea9structure4dataABSo0aB9Structurea_SpySdGtcfc"
  },
  "title" : "init(structure:data:)"
}
-->

# init(structure:data:)

Creates a sparse matrix with the specified structure that contains double-precision values.

```
init(structure: SparseMatrixStructure, data: UnsafeMutablePointer<Double>)
```

## Parameters

`structure`

The sparsity structure of the matrix.

`data`

The array of contiguous values in the nonzero blocks of the matrix. The matrix stores each block in column-major order. The number of elements in [`data`](/documentation/Accelerate/SparseMatrix_Double/data) must be equal to [`blockSize`](/documentation/Accelerate/SparseMatrixStructure/blockSize) x [`blockSize`](/documentation/Accelerate/SparseMatrixStructure/blockSize) x the number of nonzero blocks in the matrix.

---

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)