Returns a dense array from a sparse input. More...

Functions

AFAPI array dense (const array sparse)
 
AFAPI af_err af_sparse_to_dense (af_array *out, const af_array sparse)
 

Detailed Description

Returns a dense array from a sparse input.

Converts the sparse matrix into a dense matrix and returns it


Function Documentation

◆ af_sparse_to_dense()

AFAPI af_err af_sparse_to_dense ( af_array out,
const af_array  sparse 
)
Parameters
[out]outdense af_array from sparse
[in]sparseis the source sparse matrix
Returns
AF_SUCCESS if the execution completes properly

◆ dense()

AFAPI array af::dense ( const array  sparse)
Parameters
[in]sparseis the source sparse matrix
Returns
dense af::array from sparse
// sparse
// values: [ 5.0, 8.0, 3.0, 6.0 ]
// row_ptr: [ 0, 0, 2, 3, 4 ]
// col_idx: [ 0, 1, 2, 1 ]
// Get dense representation of given sparse af::array.
// dense
// 0 0 0 0
// 5 8 0 0
// 0 0 3 0
// 0 6 0 0
af::sparse
AFAPI array sparse(const dim_t nRows, const dim_t nCols, const array values, const array rowIdx, const array colIdx, const af::storage stype=AF_STORAGE_CSR)
This function converts af::array of values, row indices and column indices into a sparse array.
afcl::array
static af::array array(af::dim4 idims, cl_mem buf, af::dtype type, bool retain=false)
Create an af::array object from an OpenCL cl_mem buffer.
Definition: opencl.h:327
af::dense
AFAPI array dense(const array sparse)