MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / TEST

Function TEST

test/sparse.cpp:95–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93CAST_TESTS(cdouble, cdouble)
94
95TEST(Sparse, ISSUE_1745) {
96 using af::where;
97
98 array A = randu(4, 4);
99 A(1, span) = 0;
100 A(2, span) = 0;
101
102 array idx = where(A);
103 array data = A(idx);
104 array row_idx = (idx / A.dims()[0]).as(s64);
105 array col_idx = (idx % A.dims()[0]).as(s64);
106
107 af_array A_sparse;
108 ASSERT_EQ(AF_ERR_ARG, af_create_sparse_array(
109 &A_sparse, A.dims(0), A.dims(1), data.get(),
110 row_idx.get(), col_idx.get(), AF_STORAGE_CSR));
111}
112
113TEST(Sparse, offsets_work_csr_to_dense_ISSUE_1918) {
114 array reference(2,2);

Callers 1

sparse.cppFile · 0.70

Calls 15

randuFunction · 0.85
sparseFunction · 0.85
seqClass · 0.85
denseFunction · 0.85
sparseGetInfoFunction · 0.85
sparseGetNNZFunction · 0.85
sparseGetValuesFunction · 0.85
asMethod · 0.80
TMethod · 0.80
whereFunction · 0.50
af_create_sparse_arrayFunction · 0.50
af_release_arrayFunction · 0.50

Tested by

no test coverage detected