-
Notifications
You must be signed in to change notification settings - Fork 550
Expand file tree
/
Copy pathsparse.cpp
More file actions
76 lines (64 loc) · 2.56 KB
/
sparse.cpp
File metadata and controls
76 lines (64 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*******************************************************
* Copyright (c) 2015, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <af/sparse.h>
#include "symbol_manager.hpp"
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) {
CHECK_ARRAYS(values, rowIdx, colIdx);
CALL(af_create_sparse_array, out, nRows, nCols, values, rowIdx, colIdx,
stype);
}
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 source) {
CALL(af_create_sparse_array_from_ptr, out, nRows, nCols, nNZ, values,
rowIdx, colIdx, type, stype, source);
}
af_err af_create_sparse_array_from_dense(af_array *out, const af_array in,
const af_storage stype) {
CHECK_ARRAYS(in);
CALL(af_create_sparse_array_from_dense, out, in, stype);
}
af_err af_sparse_convert_to(af_array *out, const af_array in,
const af_storage destStorage) {
CHECK_ARRAYS(in);
CALL(af_sparse_convert_to, out, in, destStorage);
}
af_err af_sparse_to_dense(af_array *out, const af_array in) {
CHECK_ARRAYS(in);
CALL(af_sparse_to_dense, out, in);
}
af_err af_sparse_get_info(af_array *values, af_array *rowIdx, af_array *colIdx,
af_storage *stype, const af_array in) {
CHECK_ARRAYS(in);
CALL(af_sparse_get_info, values, rowIdx, colIdx, stype, in);
}
af_err af_sparse_get_values(af_array *out, const af_array in) {
CHECK_ARRAYS(in);
CALL(af_sparse_get_values, out, in);
}
af_err af_sparse_get_row_idx(af_array *out, const af_array in) {
CHECK_ARRAYS(in);
CALL(af_sparse_get_row_idx, out, in);
}
af_err af_sparse_get_col_idx(af_array *out, const af_array in) {
CHECK_ARRAYS(in);
CALL(af_sparse_get_col_idx, out, in);
}
af_err af_sparse_get_nnz(dim_t *out, const af_array in) {
CHECK_ARRAYS(in);
CALL(af_sparse_get_nnz, out, in);
}
af_err af_sparse_get_storage(af_storage *out, const af_array in) {
CHECK_ARRAYS(in);
CALL(af_sparse_get_storage, out, in);
}