<!--
{
  "documentType" : "article",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/matrix-and-vector-operations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Matrix and Vector Operations"
}
-->

# Matrix and Vector Operations

Perform computations with matrices and vectors.

## Topics

### Complex vector operations

[`sparse_pack_vector_double_complex`](/documentation/Accelerate/sparse_pack_vector_double_complex(_:_:_:_:_:_:))

[`sparse_pack_vector_float_complex`](/documentation/Accelerate/sparse_pack_vector_float_complex(_:_:_:_:_:_:))

[`sparse_unpack_vector_double_complex`](/documentation/Accelerate/sparse_unpack_vector_double_complex(_:_:_:_:_:_:_:))

[`sparse_unpack_vector_float_complex`](/documentation/Accelerate/sparse_unpack_vector_float_complex(_:_:_:_:_:_:_:))

[`sparse_vector_norm_double_complex`](/documentation/Accelerate/sparse_vector_norm_double_complex(_:_:_:_:))

[`sparse_vector_norm_float_complex`](/documentation/Accelerate/sparse_vector_norm_float_complex(_:_:_:_:))

### Complex matrix operations

[`sparse_elementwise_norm_double_complex`](/documentation/Accelerate/sparse_elementwise_norm_double_complex(_:_:))

[`sparse_elementwise_norm_float_complex`](/documentation/Accelerate/sparse_elementwise_norm_float_complex(_:_:))

[`sparse_get_vector_nonzero_count_double_complex`](/documentation/Accelerate/sparse_get_vector_nonzero_count_double_complex(_:_:_:))

[`sparse_get_vector_nonzero_count_float_complex`](/documentation/Accelerate/sparse_get_vector_nonzero_count_float_complex(_:_:_:))

[`sparse_operator_norm_double_complex`](/documentation/Accelerate/sparse_operator_norm_double_complex(_:_:))

[`sparse_operator_norm_float_complex`](/documentation/Accelerate/sparse_operator_norm_float_complex(_:_:))

[`sparse_permute_cols_double_complex`](/documentation/Accelerate/sparse_permute_cols_double_complex(_:_:))

[`sparse_permute_cols_float_complex`](/documentation/Accelerate/sparse_permute_cols_float_complex(_:_:))

[`sparse_permute_rows_double_complex`](/documentation/Accelerate/sparse_permute_rows_double_complex(_:_:))

[`sparse_permute_rows_float_complex`](/documentation/Accelerate/sparse_permute_rows_float_complex(_:_:))

[`sparse_permute_rows_float_complex`](/documentation/Accelerate/sparse_permute_rows_float_complex(_:_:))

### Matrix-Matrix Operations

[`sparse_matrix_product_dense_double`](/documentation/Accelerate/sparse_matrix_product_dense_double(_:_:_:_:_:_:_:_:_:))

Multiplies the dense matrix *B* by the sparse matrix *A* and adds the result to the dense matrix *C*, all with double-precision values.

[`sparse_matrix_product_dense_float`](/documentation/Accelerate/sparse_matrix_product_dense_float(_:_:_:_:_:_:_:_:_:))

Multiplies the dense matrix *B* by the sparse matrix *A* and adds the result to the dense matrix *C*, all with single-precision values.

[`sparse_matrix_product_sparse_double`](/documentation/Accelerate/sparse_matrix_product_sparse_double(_:_:_:_:_:_:_:))

Multiplies the sparse matrix *B* by the sparse matrix *A* and adds the result to the dense matrix *C*, all with double-precision values.

[`sparse_matrix_product_sparse_float`](/documentation/Accelerate/sparse_matrix_product_sparse_float(_:_:_:_:_:_:_:))

Multiplies the sparse matrix *B* by the sparse matrix *A* and adds the result to the dense matrix *C*, all with single-precision values.

[`sparse_matrix_triangular_solve_dense_double`](/documentation/Accelerate/sparse_matrix_triangular_solve_dense_double(_:_:_:_:_:_:_:))

Solves the system of equations *B = alpha * T⁻¹  * B* for *B* where *B* is a dense matrix and *T* is a triangular sparse matrix, both with double-precision values.

[`sparse_matrix_triangular_solve_dense_float`](/documentation/Accelerate/sparse_matrix_triangular_solve_dense_float(_:_:_:_:_:_:_:))

Solves the system of equations *B = alpha * T⁻¹  * B* for *B* where *B* is a dense matrix and *T* is a triangular sparse matrix, both with double-precision values.

### Matrix-Vector Operations

[`sparse_matrix_vector_product_dense_double`](/documentation/Accelerate/sparse_matrix_vector_product_dense_double(_:_:_:_:_:_:_:))

Multiplies the dense vector *x* by the sparse matrix *A* and adds the result to the dense vector *y*, with all operands containing double-precision values.

[`sparse_matrix_vector_product_dense_float`](/documentation/Accelerate/sparse_matrix_vector_product_dense_float(_:_:_:_:_:_:_:))

Multiplies the dense vector *x* by the sparse matrix *A* and adds the result to the dense vector *y*, with all operands containing single-precision values.

[`sparse_vector_triangular_solve_dense_double`](/documentation/Accelerate/sparse_vector_triangular_solve_dense_double(_:_:_:_:_:))

Solves the system of equations *x = alpha * T⁻¹ * x* for x where *x* is a dense vector and *T* is a triangular sparse matrix, with all operands containing double-precision values.

[`sparse_vector_triangular_solve_dense_float`](/documentation/Accelerate/sparse_vector_triangular_solve_dense_float(_:_:_:_:_:))

Solves the system of equations *x = alpha * T⁻¹ * x* for x where *x* is a dense vector and *T* is a triangular sparse matrix, with all operands containing single-precision values.

[`sparse_outer_product_dense_double`](/documentation/Accelerate/sparse_outer_product_dense_double(_:_:_:_:_:_:_:_:_:))

Computes the outer product of the dense vector *x* and the sparse vector *y*, with both operands containing double-precision values.

[`sparse_outer_product_dense_float`](/documentation/Accelerate/sparse_outer_product_dense_float(_:_:_:_:_:_:_:_:_:))

Computes the outer product of the dense vector *x* and the sparse vector *y*, with both operands containing single-precision values.

[`sparse_permute_rows_double`](/documentation/Accelerate/sparse_permute_rows_double(_:_:))

Permutes the rows of the double-precision sparse matrix *A* based on the provided permutation array.

[`sparse_permute_rows_float`](/documentation/Accelerate/sparse_permute_rows_float(_:_:))

Permutes the rows of the single-precision sparse matrix *A* based on the provided permutation array.

[`sparse_permute_cols_double`](/documentation/Accelerate/sparse_permute_cols_double(_:_:))

Permutes the columns of the double-precision sparse matrix *A* based on the provided permutation array.

[`sparse_permute_cols_float`](/documentation/Accelerate/sparse_permute_cols_float(_:_:))

Permutes the columns of the single-precision sparse matrix *A* based on the provided permutation array.

[`sparse_elementwise_norm_double`](/documentation/Accelerate/sparse_elementwise_norm_double(_:_:))

Computes the specified element-wise norm of the double-precision sparse matrix *A*.

[`sparse_elementwise_norm_float`](/documentation/Accelerate/sparse_elementwise_norm_float(_:_:))

Computes the specified element-wise norm of the single-precision sparse matrix *A*.

[`sparse_operator_norm_double`](/documentation/Accelerate/sparse_operator_norm_double(_:_:))

Computes the specified operator norm of the double-precision sparse matrix *A*.

[`sparse_operator_norm_float`](/documentation/Accelerate/sparse_operator_norm_float(_:_:))

Computes the specified operator norm of the single-precision sparse matrix *A*.

[`sparse_matrix_trace_double`](/documentation/Accelerate/sparse_matrix_trace_double(_:_:))

Computes the sum along the specified diagonal of the double-precision sparse matrix *A*.

[`sparse_matrix_trace_float`](/documentation/Accelerate/sparse_matrix_trace_float(_:_:))

Computes the sum along the specified diagonal of the single-precision sparse matrix *A*.

### Vector-Vector Operations

[`sparse_inner_product_dense_double`](/documentation/Accelerate/sparse_inner_product_dense_double(_:_:_:_:_:))

Computes the inner product of sparse vector *x* with double-precision *y*, with both vectors containing double-precision values.

[`sparse_inner_product_dense_float`](/documentation/Accelerate/sparse_inner_product_dense_float(_:_:_:_:_:))

Computes the inner product of sparse vector *x* with dense vector *y,* with both vectors containing single-precision values.

[`sparse_inner_product_sparse_double`](/documentation/Accelerate/sparse_inner_product_sparse_double(_:_:_:_:_:_:))

Computes the inner product of sparse vector *x* with sparse vector *y,* with both vectors containing double-precision values.

[`sparse_inner_product_sparse_float`](/documentation/Accelerate/sparse_inner_product_sparse_float(_:_:_:_:_:_:))

Computes the inner product of sparse vector *x* with sparse vector *y,* with both vectors containing single-precision values.

[`sparse_vector_add_with_scale_dense_double`](/documentation/Accelerate/sparse_vector_add_with_scale_dense_double(_:_:_:_:_:_:))

Scales the sparse vector *x* by *alpha* and adds the result to the dense vector *y,* with both vectors containing double-precision values.

[`sparse_vector_add_with_scale_dense_float`](/documentation/Accelerate/sparse_vector_add_with_scale_dense_float(_:_:_:_:_:_:))

Scales the sparse vector *x* by *alpha* and adds the result to the dense vector *y,* with both vectors containing single-precision values.

[`sparse_vector_norm_double`](/documentation/Accelerate/sparse_vector_norm_double(_:_:_:_:))

Computes the specified norm of the double-precision sparse vector *x*.

[`sparse_vector_norm_float`](/documentation/Accelerate/sparse_vector_norm_float(_:_:_:_:))

Computes the specified norm of the single-precision sparse vector *x*.

### Supporting Types

[`sparse_matrix_double`](/documentation/Accelerate/sparse_matrix_double)

Sparse matrix opaque type for double.

[`sparse_matrix_float`](/documentation/Accelerate/sparse_matrix_float)

Sparse matrix opaque type for float.

[`sparse_status`](/documentation/Accelerate/sparse_status)

The type reflecting the status of an operations.

[`sparse_dimension`](/documentation/Accelerate/sparse_dimension)

The dimension type.

[`sparse_index`](/documentation/Accelerate/sparse_index)

The index type.

[`sparse_norm`](/documentation/Accelerate/sparse_norm)

The norm specifier.

[`sparse_stride`](/documentation/Accelerate/sparse_stride)

The stride type.



---

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)