Date: 2001-03-13 15:15:58
Dave Steffen wrote:
> I rather like the way Roldan Pozo's TNT library handles sparse
> matrices. There are a couple of different sparse vectors, which
> different performance characteristics. (IIRC one is based on
> std::vector, one on std::list, and one on std::map.) The sparse
> matrices are then templated on the type of sparse vector to use
> internally. Thus, you can choose the sparse storage scheme
> on how you're going to use your sparse objects.
> This certainly doesn't allow for every possible way of handling
> sparse matrices, but it's not a bad start. ;-)
If I understand TNT correctly, it supports some sparse storage
schemes. But I think another goal to achieve is also some performance
enhancement using the right iterator concept. So if you require a
matrix library to deal with dense and sparse matrices supporting
expression templates too, things seem to get very complicated. I
don't know whether any existing library implements all these concepts
>> Isn't BLAS, like, centuries old or something (spoken in valley-boy
>> ingenue voice)? See also http://math.nist.gov/spblas/
> Yep, but it works, and is standardized.
Sometimes I have the impression, that we have nothing comparable in
(Or should we talk about std::valarray seriously?)
> Duplicating BLAS'
> functionality in C++ is what Roldan Pozo's TNT project was about
> (although progress on that project seems to have stopped).
> That sparse BLAS project is a C project that just screams C++ at
> me. The idea (IIRC) is that they support a jillion different sparse
> matrix storage schemes, which means that each computational routine
> has different versions for each scheme or combination of schemes.
> The number of actual routines (each with unique names) therefore
> grows combinatorically. They have some kind of fancy automatic code
> generator that (effectively) duplicates C++'s template facility, and
> actually pumps out all the different routines; I seem to recall that
> the whole shebang was at around 80K LOC and isn't done yet.
> Of course, we could just use templates and have the compiler do all
> that work. This seems pretty obvious to me; given that Roldan Pozo
> is invovled in the sparse BLAS project, and I know he knows C++, I'm
> at a loss to know why they didn't use C++ for the project to begin
> OTOH, maybe that's a big, red, flashing neon sign telling Boost to
> get busy? ;-) ;-)
I have got another problem with sparse matrices also, which I would
like to mention here: IMHO dense matrices and classical linear
equation solvers together form a pair, for example. Sparse matrices
are normally used in the context of iterative solvers, which are
quite subtle to handle AFAIK.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk