sparse.h (2022-02-24 14:07:56 -0500, (build 8c2561559))
Go to the documentation of this file.
1/*******************************************************
2 * Copyright (c) 2014, ArrayFire
3 * All rights reserved.
4 *
5 * This file is distributed under 3-clause BSD license.
6 * The complete license agreement can be obtained at:
7 * http://arrayfire.com/licenses/BSD-3-Clause
8 ********************************************************/
9
10#pragma once
11#include <af/defines.h>
12
13#ifdef __cplusplus
14namespace af
15{
16 class array;
17
18#if AF_API_VERSION >= 34
39 AFAPI array sparse(const dim_t nRows, const dim_t nCols,
40 const array values, const array rowIdx, const array colIdx,
41 const af::storage stype = AF_STORAGE_CSR);
42#endif
43
44#if AF_API_VERSION >= 34
69 AFAPI array sparse(const dim_t nRows, const dim_t nCols, const dim_t nNZ,
70 const void* const values,
71 const int * const rowIdx, const int * const colIdx,
72 const dtype type = f32, const af::storage stype = AF_STORAGE_CSR,
73 const af::source src = afHost);
74#endif
75
76#if AF_API_VERSION >= 34
89#endif
90
91#if AF_API_VERSION >= 34
99 AFAPI array sparseConvertTo(const array in, const af::storage destStrorage);
100#endif
101
102#if AF_API_VERSION >= 34
112#endif
113
114#if AF_API_VERSION >= 34
124 AFAPI void sparseGetInfo(array &values, array &rowIdx, array &colIdx, af::storage &stype,
125 const array in);
126#endif
127
128#if AF_API_VERSION >= 34
136#endif
137
138#if AF_API_VERSION >= 34
146#endif
147
148#if AF_API_VERSION >= 34
156#endif
157
158#if AF_API_VERSION >= 34
166#endif
167
168#if AF_API_VERSION >= 34
176#endif
177}
178#endif
179
180#ifdef __cplusplus
181extern "C" {
182#endif
183
184#if AF_API_VERSION >= 34
206 af_array *out,
207 const dim_t nRows, const dim_t nCols,
208 const af_array values, const af_array rowIdx, const af_array colIdx,
209 const af_storage stype);
210#endif
211
212#if AF_API_VERSION >= 34
238 af_array *out,
239 const dim_t nRows, const dim_t nCols, const dim_t nNZ,
240 const void * const values,
241 const int * const rowIdx, const int * const colIdx,
242 const af_dtype type, const af_storage stype,
243 const af_source src);
244#endif
245
246#if AF_API_VERSION >= 34
259 af_array *out, const af_array dense,
260 const af_storage stype);
261#endif
262
263#if AF_API_VERSION >= 34
274 const af_storage destStorage);
275#endif
276
277#if AF_API_VERSION >= 34
287#endif
288
289#if AF_API_VERSION >= 34
302 const af_array in);
303#endif
304
305#if AF_API_VERSION >= 34
315#endif
316
317#if AF_API_VERSION >= 34
327#endif
328
329#if AF_API_VERSION >= 34
339#endif
340
341#if AF_API_VERSION >= 34
351#endif
352
353#if AF_API_VERSION >= 34
363#endif
364
365#ifdef __cplusplus
366}
367#endif
A multi dimensional data container.
Definition: array.h:37
af_dtype
Definition: defines.h:210
@ f32
32-bit floating point values
Definition: defines.h:211
af_storage
Definition: defines.h:489
@ AF_STORAGE_CSR
Storage type is CSR.
Definition: defines.h:491
long long dim_t
Definition: defines.h:56
af_err
Definition: defines.h:71
void * af_array
Definition: defines.h:240
#define AFAPI
Definition: defines.h:38
af_source
Definition: defines.h:232
@ afHost
Host pointer.
Definition: defines.h:234
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
AFAPI array sparseGetColIdx(const array in)
AFAPI af_err af_sparse_get_col_idx(af_array *out, const af_array in)
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)
AFAPI af_err af_create_sparse_array(af_array *out, const dim_t nRows, const dim_t nCols, const af_array values, const af_array rowIdx, const af_array colIdx, const af_storage stype)
This function converts af::array of values, row indices and column indices into a sparse array.
AFAPI af_err af_create_sparse_array_from_dense(af_array *out, const af_array dense, const af_storage stype)
This function converts a dense af_array into a sparse array.
AFAPI af_err af_create_sparse_array_from_ptr(af_array *out, const dim_t nRows, const dim_t nCols, const dim_t nNZ, const void *const values, const int *const rowIdx, const int *const colIdx, const af_dtype type, const af_storage stype, const af_source src)
This function converts host or device arrays of values, row indices and column indices into a sparse ...
AFAPI array sparse(const array dense, const af::storage stype=AF_STORAGE_CSR)
This function converts a dense af::array into a sparse array.
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.
AFAPI array dense(const array sparse)
AFAPI af_err af_sparse_to_dense(af_array *out, const af_array sparse)
AFAPI void sparseGetInfo(array &values, array &rowIdx, array &colIdx, af::storage &stype, const array in)
AFAPI af_err af_sparse_get_info(af_array *values, af_array *rowIdx, af_array *colIdx, af_storage *stype, const af_array in)
AFAPI af_err af_sparse_get_nnz(dim_t *out, const af_array in)
AFAPI dim_t sparseGetNNZ(const array in)
AFAPI af_err af_sparse_get_row_idx(af_array *out, const af_array in)
AFAPI array sparseGetRowIdx(const array in)
AFAPI af_err af_sparse_get_storage(af_storage *out, const af_array in)
AFAPI af::storage sparseGetStorage(const array in)
AFAPI af_err af_sparse_get_values(af_array *out, const af_array in)
AFAPI array sparseGetValues(const array in)
Definition: algorithm.h:15