This builds on the commits from #12, demonstrating support for sparse arrays.
In this initial draft, I resort to a copy-paste of multitau.py to make some sparse-specific changes in multitau_sparse.py. Using current (and also possible future) numpy protocols, it ought to be possible to support both numpy.ndarray and sparse.COO arrays in the same codepath.
The memory usage is of the sparse implementation about 1/3 of the dense implementation for a 2048x2048 image with 1% density.
In exchange for that memory efficiency, the sparse version runs roughly half as fast. We may see greater speed gains for choices of lags and levels that require more multiplication.
This builds on the commits from #12, demonstrating support for sparse arrays.
In this initial draft, I resort to a copy-paste of
multitau.py
to make some sparse-specific changes inmultitau_sparse.py
. Using current (and also possible future) numpy protocols, it ought to be possible to support bothnumpy.ndarray
andsparse.COO
arrays in the same codepath.The memory usage is of the sparse implementation about 1/3 of the dense implementation for a 2048x2048 image with 1% density.
In exchange for that memory efficiency, the sparse version runs roughly half as fast. We may see greater speed gains for choices of lags and levels that require more multiplication.