Function

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.

Declaration

sparse_status sparse_matrix_vector_product_dense_float(enum CBLAS_TRANSPOSE transa, float alpha, sparse_matrix_float A, const float *restrict x, sparse_stride incx, float *restrict y, sparse_stride incy);

Parameters

transa

Specifies whether to perform the operation with A or the transpose of A. Must be one of CblasNoTrans or CblasTrans.

alpha

Scalar multiplier of A.

A

The sparse matrix, A.

x

Pointer to the dense vector x. The dimension must be the number of columns of the matrix A when transa is no transpose or the number of rows of the matrix A when transa is transpose. The behavior of this function is undefined if this is not met. Negative strides are supported. Note, unlike dense BLAS routines, the pointer points to the last element when stride is negative.

incx

Increment between valid values in the dense vector x. Negative strides are supported.

y

Pointer to the dense vector y. The dimension must be the number of rows of the matrix A when transa is no transpose or the number of columns of the matrix A when transa is transpose. The behavior of this function is undefined if this is not met. Negative strides are supported. Note, unlike dense BLAS routines, the pointer points to the last element when stride is negative.

incy

Increment between valid values in the dense vector y. Negative strides are supported.

Return Value

On success SPARSE_SUCCESS (y will be updated with result of the operation). Retruns SPARSE_ILLEGAL_PARAMETER if transa is invalid and y will be unchanged.

Discussion

Multiplies the dense vector x by the sparse matrix A and adds the result to the dense vector y (y = alpha * op(A) * x + y, where op(A) is either A or the transpose of A).If the desired operation is y = A * x, then an efficient option is to create the y buffer of zeros and then perform the operation with the zero filled y.

See Also

Matrix-Vector Operations

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_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

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

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

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

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

sparse_permute_rows_float

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

sparse_permute_cols_double

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

sparse_permute_cols_float

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

sparse_elementwise_norm_double

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

sparse_elementwise_norm_float

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

sparse_operator_norm_double

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

sparse_operator_norm_float

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

sparse_matrix_trace_double

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

sparse_matrix_trace_float

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software