| 13 | |
| 14 | namespace af { |
| 15 | array sparse(const dim_t nRows, const dim_t nCols, |
| 16 | const array values, // NOLINT(performance-unnecessary-value-param) |
| 17 | const array rowIdx, // NOLINT(performance-unnecessary-value-param) |
| 18 | const array colIdx, // NOLINT(performance-unnecessary-value-param) |
| 19 | const af::storage stype) { |
| 20 | af_array out = 0; |
| 21 | AF_THROW(af_create_sparse_array(&out, nRows, nCols, values.get(), |
| 22 | rowIdx.get(), colIdx.get(), stype)); |
| 23 | return array(out); |
| 24 | } |
| 25 | |
| 26 | array sparse(const dim_t nRows, const dim_t nCols, const dim_t nNZ, |
| 27 | const void* const values, const int* const rowIdx, |