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

# la_vector_to_double_buffer(_:_:_:)

```
func la_vector_to_double_buffer(_ buffer: UnsafeMutablePointer<Double>, _ buffer_stride: la_index_t, _ vector: la_object_t) -> la_status_t
```

## Parameters

`buffer`

Pointer to the destination buffer.

`buffer_stride`

Offset (in doubles) between the destinations of consecutive vector elements
in the buffer.  Negative strides are not supported (you can get the same
effect by reversing the vector before calling this function).

`vector`

The vector to store.

## Return Value

If vector is a valid vector object, its status is returned.  Otherwise
the return value is LA_INVALID_PARAMETER_ERROR.

## Discussion\abstract Stores the elements of a vector to a buffer.
\discussion The buffer must be large enough to accomodate the vector being stored.
Specifically, it must have have sufficient space to hold

buffer_stride*(la_vector_length(vector)-1) + 1

double elements.  Real usage in the most common case (stride = 1) will
look roughly like this:

la_count_t length = la_vector_length(vector);
if (!length) {
// an error occured.
}
double *buffer = malloc(length * sizeof buffer[0]);
la_vector_to_double_buffer(buffer, 1, vector);

This function supports storing the contents of a vector, or a matrix that
has only one row or only one column.  If the object satisfies those
requirements, and it does not have an error status, its contents are stored
to the buffer.  If it has an error status, NaNs are stored to the buffer.

If the object is not a matrix or vector, or if it is a matrix with both
dimensions larger than one, nothing is written to the buffer and
LA_INVALID_PARAMETER_ERROR is returned.

---

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)