3 ms·
I can't speak for APL, but J does have a standardized sparse-array format, and a verb for converting normal arrays to sparse and back. Most operations work on b
by gmfawcett 7y ago
I can't speak for APL, but J does have a standardized sparse-array format, and a verb for converting normal arrays to sparse and back. Most operations work on both kinds of arrays transparently, although (in my limited experience) many ops are quite a bit slower on sparse arrays. Perhaps the performance difference is less significant for huge arrays, but for me it was measurably slower when working with a 1000x1000 table.
Having said that, the sparse format gives you direct access to its internal index (coordinate) array, as well as the value array. So algorithms that can take advantage of these data structures might benefit significantly.