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

Method getNNZ

src/backend/common/SparseArray.cpp:109–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107SparseArrayBase::~SparseArrayBase() = default;
108
109dim_t SparseArrayBase::getNNZ() const {
110 if (stype == AF_STORAGE_COO || stype == AF_STORAGE_CSC) {
111 return rowIdx.elements();
112 }
113 if (stype == AF_STORAGE_CSR) { return colIdx.elements(); }
114
115 // This is to ensure future storages are properly configured
116 return 0;
117}
118
119#undef ROW_LENGTH
120#undef COL_LENGTH

Callers 7

arithOpFunction · 0.80
arithOpFunction · 0.80
createSpMatDescrFunction · 0.80
af_sparse_get_nnzFunction · 0.80

Calls 1

elementsMethod · 0.45

Tested by

no test coverage detected