Contents

sparse_permute_rows_float(_:_:)

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

Declaration

func sparse_permute_rows_float(_ A: sparse_matrix_float!, _ perm: UnsafePointer<sparse_index>!) -> sparse_status

Parameters

  • A:

    The sparse matrix, A.

  • perm:

    The permutation array. Holds number of rows in A values indicating the permutation of the matrix. The indices in perm are expected to be 0 based (first element of pointer is ptr[0]). The indices in perm are expected to be within bounds of the matrix. Undefined behavior if not met.

Return Value

On successful return, A has been permuted and SPARSE_SUCCESS is returned.

Discussion

Permute the rows of the sparse matrix A based on the provided permutation array. For each row in A, swap rows as:

 tmp[:] = A[i,:];
 A[i,:] = A[perm[i],:];
 A[perm[i],:] = tmp[:];

See Also

Matrix-Vector Operations