sparseConvertTo

Functions
sparseConvertTo
Complete List of ArrayFire Functions ArrayFire Functions by Category » Linear Algebra » | Sparse functions

Convert an existing sparse array into a different storage format. More...

## Functions
AFAPI array | sparseConvertTo (const array in, const af::storage destStrorage)
AFAPI af_err | af_sparse_convert_to (af_array *out, const af_array in, const af_storage destStorage)

## Detailed Description

Convert an existing sparse array into a different storage format.

Converting storage formats is allowed between AF_STORAGE_CSR, AF_STORAGE_COO and AF_STORAGE_DENSE.

When converting to AF_STORAGE_DENSE, a dense array is returned.

Note
  AF_STORAGE_CSC is currently not supported.

## Function Documentation

## § af_sparse_convert_to()

AFAPI af_err af_sparse_convert_to | ( | af_array * | out,
|  | const af_array | in,
|  | const af_storage | destStorage
| ) |  |

Parameters

  [out] | out | af_array for the sparse array with the given storage type
  [in] | in | is the source sparse matrix to be converted
  [in] | destStorage | is the storage format of the output sparse array

Returns
  AF_SUCCESS if the execution completes properly

## § sparseConvertTo()

AFAPI array af::sparseConvertTo | ( | const array | in,
|  | const af::storage | destStrorage
| ) |  |

Parameters

  [in] | in | is the source sparse matrix to be converted
  [in] | destStrorage | is the storage format of the output sparse array

Returns
  af::array for the sparse array with the given storage type