Closed sglyon closed 8 years ago
We kinda do this when both inputs are sparse because we do spzeros(out_type, dim1, dim2)
and then hand off to our row_kron!
method.
This issue really is about specializing row_kron!
to only look at non-zero elements.
Ok so we've improved here, but we can do even better.
In the current implementation we have a specialized case for two sparse matrices. It is pretty good, but can be faster by accessing the fields of the SparseMatrixCSC
directly instead of using things like findnz
.
We can get inspiration from the implementation of kron
in the Base
:
Right now the Sparse matrix version of
row_kron
simply constructs a sparse matrix and hand off to the dense version of the function. This duplicates a lot of work, we could save some time by only dealing directly with the non-zero elements