Contents

sparse_permute_cols_float(_:_:)

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

Declaration

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

Parameters

  • A:

    The sparse matrix, A.

  • perm:

    The permutation array. Holds number of columns 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 columns of the sparse matrix A based on the provided permutation array. For each column in A, swap columns as:

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

See Also

Matrix-Vector Operations