---
title: "sparse_permute_cols_float(_:_:)"
framework: accelerate
role: symbol
role_heading: Function
path: "accelerate/sparse_permute_cols_float(_:_:)"
---

# sparse_permute_cols_float(_:_:)

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

## Declaration

```swift
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

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

## Discussion

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[:]; important: Apple provides the BLAS and LAPACK libraries under the Accelerate framework to be in line with LAPACK 3.9.1. Starting with iOS 26, iPadOS 26, macOS 26, tvOS 26, visionOS 26, and watchOS 26, the libraries are in line with LAPACK 3.12.0. These new interfaces provide additional functionality, as well as a new ILP64 interface. To use the new interfaces, define ACCELERATE_NEW_LAPACK before including the Accelerate or vecLib headers. For ILP64 interfaces, also define ACCELERATE_LAPACK_ILP64. For Swift projects, specify ACCELERATE_NEW_LAPACK=1 and ACCELERATE_LAPACK_ILP64=1 as preprocessor macros in Xcode build settings under Apple Clang - Preprocessing > Preprocessor Macros.

## See Also

### Matrix-Vector Operations

- [sparse_matrix_vector_product_dense_double(_:_:_:_:_:_:_:)](accelerate/sparse_matrix_vector_product_dense_double(_:_:_:_:_:_:_:).md)
- [sparse_matrix_vector_product_dense_float(_:_:_:_:_:_:_:)](accelerate/sparse_matrix_vector_product_dense_float(_:_:_:_:_:_:_:).md)
- [sparse_vector_triangular_solve_dense_double(_:_:_:_:_:)](accelerate/sparse_vector_triangular_solve_dense_double(_:_:_:_:_:).md)
- [sparse_vector_triangular_solve_dense_float(_:_:_:_:_:)](accelerate/sparse_vector_triangular_solve_dense_float(_:_:_:_:_:).md)
- [sparse_outer_product_dense_double(_:_:_:_:_:_:_:_:_:)](accelerate/sparse_outer_product_dense_double(_:_:_:_:_:_:_:_:_:).md)
- [sparse_outer_product_dense_float(_:_:_:_:_:_:_:_:_:)](accelerate/sparse_outer_product_dense_float(_:_:_:_:_:_:_:_:_:).md)
- [sparse_permute_rows_double(_:_:)](accelerate/sparse_permute_rows_double(_:_:).md)
- [sparse_permute_rows_float(_:_:)](accelerate/sparse_permute_rows_float(_:_:).md)
- [sparse_permute_cols_double(_:_:)](accelerate/sparse_permute_cols_double(_:_:).md)
- [sparse_elementwise_norm_double(_:_:)](accelerate/sparse_elementwise_norm_double(_:_:).md)
- [sparse_elementwise_norm_float(_:_:)](accelerate/sparse_elementwise_norm_float(_:_:).md)
- [sparse_operator_norm_double(_:_:)](accelerate/sparse_operator_norm_double(_:_:).md)
- [sparse_operator_norm_float(_:_:)](accelerate/sparse_operator_norm_float(_:_:).md)
- [sparse_matrix_trace_double(_:_:)](accelerate/sparse_matrix_trace_double(_:_:).md)
- [sparse_matrix_trace_float(_:_:)](accelerate/sparse_matrix_trace_float(_:_:).md)
