<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/sparse_extract_sparse_row_double(_:_:_:_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@sparse_extract_sparse_row_double"
  },
  "title" : "sparse_extract_sparse_row_double(_:_:_:_:_:_:_:)"
}
-->

# sparse_extract_sparse_row_double(_:_:_:_:_:_:_:)

Extracts values from a specified row of a double-precision sparse matrix.

```
func sparse_extract_sparse_row_double(_ A: sparse_matrix_double!, _ row: sparse_index, _ column_start: sparse_index, _ column_end: UnsafeMutablePointer<sparse_index>!, _ nz: sparse_dimension, _ val: UnsafeMutablePointer<Double>!, _ jndx: UnsafeMutablePointer<sparse_index>!) -> sparse_status
```

## Parameters

`A`

The sparse matrix, *A*, which must have been created with [`sparse_matrix_create_double(_:_:)`](/documentation/Accelerate/sparse_matrix_create_double(_:_:)). [`SPARSE_ILLEGAL_PARAMETER`](/documentation/Accelerate/SPARSE_ILLEGAL_PARAMETER) is returned if not met.

`row`

The row for value extraction.

`column_start`

The index of the column to start extraction.

`column_end`

On return, holds the column index of the next nonzero value.

`nz`

The number of values to extract from `A`.  Each of `jndx` and `val` are of size `nz`.

`val`

Pointer to array to hold the values extracted from the sparse matrix.  The value is extracted from the location specified by the corresponding indices of `row` and `jndx`.  Must be of size `nz` elements.  If less than `nz` nonzero values are found, then the last `nz - actual_nonzero_count` elements of val are untouched.

`jndx`

An array to hold the extracted column indices that correspond to the values in `val`. Note that these indices are relative to the matrix row and not the starting column index specified by `column_start`.  Returned indices are 0 based (first element of pointer is `ptr[0]`).  Must be of size `nz` elements.

## Return Value

On success `val` and `jndx` have been updated with the nonzero values of the `row`’th row, `column_end` holds the column index of the next nonzero value, and the number of nonzero values written are returned.  If `A` creation requirements are not met, [`SPARSE_ILLEGAL_PARAMETER`](/documentation/Accelerate/SPARSE_ILLEGAL_PARAMETER) is returned and `val` and `jndx` are unchanged.

## Discussion

Extract the first `nz` values of the row beginning at `A[row,column_start]` for the sparse matrix `A`.  The number of nonzero values extracted is limited by `nz`, and the number of nonzero’s written to `jndx` and `val` are returned.  Additionally, the column index of the next nonzero value is returned in `column_end`. For example if `nz` is returned, not all nonzero values have been extracted, and a second extract can start from `column_end`.

> Important:
> Apple provides the BLAS and LAPACK libraries under the Accelerate framework to be in line with LAPACK 3.9.1. Starting with iOS 26, iPadOS 26, macOS 26, tvOS 26, visionOS 26, and watchOS 26, the libraries are in line with LAPACK 3.12.0. These new interfaces provide additional functionality, as well as a new ILP64 interface. To use the new interfaces, define `ACCELERATE_NEW_LAPACK` before including the Accelerate or vecLib headers. For ILP64 interfaces, also define `ACCELERATE_LAPACK_ILP64`. For Swift projects, specify `ACCELERATE_NEW_LAPACK=1` and `ACCELERATE_LAPACK_ILP64=1` as preprocessor macros in Xcode build settings under Apple Clang - Preprocessing > Preprocessor Macros.

---

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)