Boost logo

Glas :

Re: [glas] multi-dimensional arrays?

From: plagne.laurent_at_[hidden]
Date: 2006-12-15 05:49:22

Hi Karl,

IMHO, the matrix< matrix<..> > can be more or less difficult to implement
depending on the constraints you accept. As an example, if you decide that the
library must remain open to third party codes and handle different kind of
matrix data storage : this is pretty easy to do with simple matrix type
(matrix<double>) because the return type of A(i,j) will be a simple ref to
double (or const ref). In the 2D case, matrix< matrix<double> > A, the accessor
operator A(i,j) will be naturally a ref to matrix<double>. And you loose the
compatibility with third party data elements...
One can avoid this problem but it is not a trivial issue.

Another point in nested matrix issue is that it can help (again IMHO) to
validate the very impressive work the GLAS team has done with vector space
concepts (HI Peter). For example, the 0 and 1 matrix counter-part are to be
efficiently treated.

Last point is maybe not a so general issue : In my case, I have to handle sparse
matrix with a complicated but highly structured sparsity pattern. This pattern
can be express with a reduced set of simple sparsity patterns : e.g A
=Dense<Sparse<Diagonal..> > > + Sparse<Tridiagonal<Dense<..> > >



> I think this is an important point. Toon and I have thought about this
> for a long time. We will certainly talk about this in detail. Providing
> the container matrix< matrix<T> > is not hard. I recall that algorithms
> are application/interpretation dependent, and we had a lively discussion
> on the list on this topic. So, I agree that 'some' support is needed,
> although it is not yet clear to me what 'some' here means.
> Best,