# Matrix and Vector Operations

Perform computations with matrices and vectors.

## Topics

### Matrix-Matrix Operations

func sparse_matrix_product_sparse_double(CBLAS_ORDER, CBLAS_TRANSPOSE, Double, sparse_matrix_double!, sparse_matrix_double!, UnsafeMutablePointer<Double>!, sparse_dimension) -> sparse_status

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

func sparse_matrix_product_sparse_float(CBLAS_ORDER, CBLAS_TRANSPOSE, Float, sparse_matrix_float!, sparse_matrix_float!, UnsafeMutablePointer<Float>!, sparse_dimension) -> sparse_status

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

func sparse_matrix_triangular_solve_dense_double(CBLAS_ORDER, CBLAS_TRANSPOSE, sparse_dimension, Double, sparse_matrix_double!, UnsafeMutablePointer<Double>!, sparse_dimension) -> sparse_status

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.

func sparse_matrix_triangular_solve_dense_float(CBLAS_ORDER, CBLAS_TRANSPOSE, sparse_dimension, Float, sparse_matrix_float!, UnsafeMutablePointer<Float>!, sparse_dimension) -> sparse_status

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

func sparse_matrix_vector_product_dense_double(CBLAS_TRANSPOSE, Double, sparse_matrix_double!, UnsafePointer<Double>!, sparse_stride, UnsafeMutablePointer<Double>!, sparse_stride) -> sparse_status

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.

func sparse_matrix_vector_product_dense_float(CBLAS_TRANSPOSE, Float, sparse_matrix_float!, UnsafePointer<Float>!, sparse_stride, UnsafeMutablePointer<Float>!, sparse_stride) -> sparse_status

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.

func sparse_vector_triangular_solve_dense_double(CBLAS_TRANSPOSE, Double, sparse_matrix_double!, UnsafeMutablePointer<Double>!, sparse_stride) -> sparse_status

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.

func sparse_vector_triangular_solve_dense_float(CBLAS_TRANSPOSE, Float, sparse_matrix_float!, UnsafeMutablePointer<Float>!, sparse_stride) -> sparse_status

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.

func sparse_permute_rows_double(sparse_matrix_double!, UnsafePointer<sparse_index>!) -> sparse_status

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

func sparse_permute_rows_float(sparse_matrix_float!, UnsafePointer<sparse_index>!) -> sparse_status

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

func sparse_permute_cols_double(sparse_matrix_double!, UnsafePointer<sparse_index>!) -> sparse_status

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

func sparse_permute_cols_float(sparse_matrix_float!, UnsafePointer<sparse_index>!) -> sparse_status

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

func sparse_elementwise_norm_double(sparse_matrix_double!, sparse_norm) -> Double

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

func sparse_elementwise_norm_float(sparse_matrix_float!, sparse_norm) -> Float

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

func sparse_operator_norm_double(sparse_matrix_double!, sparse_norm) -> Double

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

func sparse_operator_norm_float(sparse_matrix_float!, sparse_norm) -> Float

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

func sparse_matrix_trace_double(sparse_matrix_double!, sparse_index) -> Double

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

func sparse_matrix_trace_float(sparse_matrix_float!, sparse_index) -> Float

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

### Vector-Vector Operations

func sparse_inner_product_dense_double(sparse_dimension, UnsafePointer<Double>!, UnsafePointer<sparse_index>!, UnsafePointer<Double>!, sparse_stride) -> Double

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

func sparse_inner_product_dense_float(sparse_dimension, UnsafePointer<Float>!, UnsafePointer<sparse_index>!, UnsafePointer<Float>!, sparse_stride) -> Float

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

func sparse_vector_add_with_scale_dense_double(sparse_dimension, Double, UnsafePointer<Double>!, UnsafePointer<sparse_index>!, UnsafeMutablePointer<Double>!, sparse_stride)

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

func sparse_vector_add_with_scale_dense_float(sparse_dimension, Float, UnsafePointer<Float>!, UnsafePointer<sparse_index>!, UnsafeMutablePointer<Float>!, sparse_stride)

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

### Supporting Types

typealias sparse_matrix_double

Sparse matrix opaque type for Double.

typealias sparse_matrix_float

Sparse matrix opaque type for Float.

struct sparse_status

The type reflecting the status of an operations.

typealias sparse_dimension

The dimension type.

typealias sparse_index

The index type.

struct sparse_norm

The norm specifier.

typealias sparse_stride

The stride type.

### Sparse Computation

Pointwise Matrix Operations

Create, insert values into, and extract values from a pointwise sparse matrix.

Blockwise Matrix Operations

Create, insert values into, and extract values from a blockwise sparse matrix.

General Sparse Matrix Management Operations

Operations to manage and work with sparse matrix properties.

Sparse Utility Operations

Various utility operations for creating and working with sparse structures.