|
Boost : |
From: Dave Steffen (steffend_at_[hidden])
Date: 2001-03-12 20:57:38
David Abrahams writes:
> From: <walter_at_[hidden]>
[...]
> > > _ dense and sparse matrices
> >
> > Sparse matrices seem somewhat controversial to me. BLAS for
> > example handles only certain types of dense matrices like
> > general, symmetric, banded etc. BLAS does not support sparse
> > matrices.
>
> For the work I will be doing, sparse matrices are an absolute
> neccessity.
Me too. The difficulty there seems to be that there's more than one
way of implementing a sparse matrix, and which way you choose depends
on how you're going to use it. By which I mean that if you're going
to write into it once and then read sequentially a million times, you
want to implement your sparse matrix one way; if you're going to
continually access, change, and remove elements, you're going to
implement it in another. This is why I like TNT's approach, where
sparse matrices are implemented as sparse vectors of sparse vectors,
and sparse vectors are templated on the underlying storage mechanism.
> 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. 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 with.
OTOH, maybe that's a big, red, flashing neon sign telling Boost to
get busy? ;-) ;-)
--------------------------------------------------------------------------
Dave Steffen Wave after wave will flow with the tide
Dept. of Physics And bury the world as it does
Colorado State University Tide after tide will flow and recede
steffend_at_[hidden] Leaving life to go on as it was...
- Peart / RUSH
"The reason that our people suffer in this way....
is that our ancestors failed to rule wisely". -General Choi, Hong Hi
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk