compressed-sparse-fiber
CSF is a generalization of compressed sparse row (CSR) index. See smith2017knl
CSF index recursively compresses each dimension of a tensor into a set of prefix trees. Each path from a root to leaf forms one tensor non-zero index. CSF is implemented with two arrays of buffers and one arrays of integers.
Example usage
let rows = vec!;
let csf = from
The above could be represented by a structure like this:
CompressedSparseFiber {
fptr: [[0, 2, 3], [0, 1, 3, 4], [0, 2, 4, 5, 8]],
fids: [[1, 2], [1, 2, 2], [1, 1, 2, 2], [2, 3, 1, 3, 1, 1, 2, 3]],
vals: [1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0]
}
A CSF can also be built incrementally:
let rows = vec!;
let mut builder: = new;
for in rows
let csf = builder.build;
Retreiving in uncompressed form
for t in csf