supersparse matrix

Issue #27 new
Ben Jo created an issue

Hi, could you design a row-sparse matrix class, what I call "super-sparse", i.e it is a sparse matrix where only a few rows are non empty and also sparse (so it can be seen as a sparse vector of sparse vectors). Such that the product of a "super-sparse" matrix and a dense matrix is still a "super-sparse" matrix! and the product of a "super-sparse" matrix with a dense vector is a sparse vector?

Thanks for this nice library! Benoit

Comments (1)

  1. Klaus Iglberger

    Hi Benoit!

    Thanks a lot for the proposal. We understand the notion of "super-sparse" that you have in mind, but unfortunately we are not sure about the problem you are currently facing. In Blaze it is possible to assign the result of a dense matrix/sparse matrix multiplication to a sparse matrix:

    blaze::CompressedMatrix<double> A, C;
    blaze::DynamicMatrix<double> B;
    
    // ... Resizing and initialization
    
    C = A * B;
    

    Thus the "super-sparse" property of matrix A is preserved. However, in the current implementation (Blaze 2.5) we assume that the sparse matrix has entries in each row and that therefore the resulting matrix is a dense matrix. Thus in order to maximize performance for the given example we create a temporary dense matrix, which is then assigned to the sparse matrix. In case of a "super-sparse" matrix this of course creates an unfortunate and unnecessary overhead. Could this be part of the problem that you are facing?

    In order to help us to better understand your problem it would be great if you could provide us with a use case. We would be interested in the matrix sizes you are usually using and if possible a short code example that demonstrates the point.

    We will consider your idea for one of the next releases, but we cannot promise that we can consider it for the upcoming 2.6 release. Your additional input would definitely help us to speed this up.

    Best regards,

    Klaus!

  2. Log in to comment