Boost logo

Ublas :

Subject: Re: [ublas] Slow (seeming) sparse matrix multiplication? (James Davidson)
From: Paul C. Leopardi (paul.leopardi_at_[hidden])
Date: 2010-01-31 17:54:36


On Saturday 30 January 2010 23:30:13 Jörn Ungermann wrote:
> Hello James,
>
> we had the same problem. You might want to have a look at the
> "axpy_prod" and "sparse_prod" functions, which offer specialized
> implementations for sparse matrices. However, we found all sparse matrix
> products severely lacking and finally implemented the sparse matrix
> multiplications we needed ourselves (which are mostly several orders of
> magnitude faster than the best ublas routine). Sadly, we could not spend
> the effort to do a implementation general enough and worthy to be
> included into ublas.
>
> But if you need something along the lines of compressed_matrix *
> compressed_matrix -> matrix, send me an email and I can send you our
> code. We have not implemented all products with respect to combinations
> of transposedness/row-column-majority, but the missing ones could be
> easily added given the existing implementations. As the product of two
> sparse matrices is seldom sparse itself (and certainly not in our
> use-case) we have not thought about a compressed_matrix as target, which
> certainly requires a special order in which the resulting matrix is to
> filled.

Hi Jörn ,
GluCat ( http://glucat.sf.net ) also uses uBLAS compressed matrices. It has
special products for monomial matrices (one non-zero per row and column) and
uses ublas::sparse_prod otherwise. See glucat/matrix_imp.h. I'd also be
interested in seeing your code.
Best, Paul