Function

sparse_extract_block_float

Extracts values from a specified block of a single-precision matrix.

Declaration

sparse_status sparse_extract_block_float(sparse_matrix_float A, sparse_index bi, sparse_index bj, sparse_dimension row_stride, sparse_dimension col_stride, float *restrict val);

Parameters

A

The sparse matrix, A, which must have been created with sparse_matrix_block_create_float or sparse_matrix_variable_block_create_float. SPARSE_ILLEGAL_PARAMETER is returned if not met. A holds block dimensions (fixed or variable) set with matrix object creation routine.

bi

The block row index for value extraction. Indices are 0 based (first block of matrix is A[0,0]). Indices expected to be in the bounds of matrix dimensions, undefined behavior if not met.

bj

The block column index for value extraction. Indices are 0 based (first block of matrix is A[0,0]). Indices expected to be in the bounds of matrix dimensions, undefined behavior if not met.

row_stride

The row stride in number of elements to move from one row to the next for the block val.

col_stride

The column stride in number of elements to move from one column to the next for the block val.

val

Pointer to dense block to place the extracted values. Expected to be of size K * L where K * L is the block size for the matrix object at block index bi,bj. This dimensions is set at matrix object creation time.

Return Value

On success SPARSE_SUCCESS is return and val has been updated with the block from block index bi,bj. If A creation requirements are not met, SPARSE_ILLEGAL_PARAMETER is returned and val is unchanged.

Discussion

Extract the bi,bj'th block from the sparse matrix A.

See Also

Value Extraction

sparse_extract_block_double

Extracts values from a specified block of a double-precision matrix.