Function

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.

Declaration

func sparse_outer_product_dense_float(_ M: sparse_dimension, _ N: sparse_dimension, _ nz: sparse_dimension, _ alpha: Float, _ x: UnsafePointer<Float>!, _ incx: sparse_stride, _ y: UnsafePointer<Float>!, _ indy: UnsafePointer<sparse_index>!, _ C: UnsafeMutablePointer<sparse_matrix_float?>!) -> sparse_status

Parameters

M

The number of rows of x and the resulting matrix.

N

The number of columns of the resulting matrix. The number of nonzero values must be less than or equal to N.

nz

The number of nonzero values in the sparse vector y. Must be less than or equal to N.

alpha

Scalar multiplier of x.

x

Pointer to the dense vector x. Must be M number of elements. 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 storage for the values of the sparse vector y. The corresponding entry in indy holds the index of the value. Contains nz values.

indy

Pointer to the dense storage for the index values of the sparse vector y. The corresponding entry in y holds the values of the vector. Contains nz values.

C

Pointer to an uninitialized sparse matrix object. On success a newly allocated sparse matrix object is returned in this pointer. On error, this set to NULL.You are responsible for calling sparse_matrix_destroy(_:) on this matrix object.

Return Value

On success SPARSE_SUCCESS is returned an C is valid matrix object. The caller is responsible for cleaning up the sparse matrix object with sparse_matrix_destroy(_:).

Will return SPARSE_ILLEGAL_PARAMETER if nz > N, and C will be unchanged.

Discussion

Compute the outer product of the dense vector x and the sparse vector y and return a new sparse matrix in the uninitialized pointer sparse matrix pointer C. C = alpha * x * y'. You are responsible for calling sparse_matrix_destroy(_:) on the returned matrix.The matrix object returned on success is a point wise based sparse matrix.

Indices in indx are always assumed to be stored in ascending order. Additionally, indices are assumed to be unique. The behavior of this function is undefined if either of these assumptions are not met.

All indices are 0 based (the first element of a pointer is ptr[0]).

See Also

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.

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