Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/arrayfire/arrayfire
/ makeSparse
Function
makeSparse
test/sparse_arith.cpp:34–38 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
32
33
template<typename T>
34
array makeSparse(array A, int factor) {
35
A = floor(A * 1000);
36
A = A * ((A % factor) == 0) / 1000;
37
return A;
38
}
39
40
template<>
41
array makeSparse<cfloat>(array A, int factor) {
Callers
nothing calls this directly
Calls
1
floor
Function · 0.85
Tested by
no test coverage detected