Boost logo

Boost :

From: mschuerch_at_[hidden]
Date: 2000-12-04 05:54:35

I would very much like a multidimensional array-class in boost. I'm
one of the ones, which have to use VC. Blitz++ is therefore no

> I think this is part of a very important issue. Should we see an N
> dimensional array as a container of elements, or as a container of
> 1 dimensional arrays? It really is both, but which view simplifies
> what we want to do with it? How do we want to access it? I think I
> ended up privileging the former view, that of a multidimensional
> array as a container of elements, structured in N dimensions, and I
> just used class SubArray as a way to get at the elements. I do not
> treat the various dimensions differently. When I resize the Array, I
> resize it all, I pass all the N dimensions of the Array to the
> member function (naturally some of these can remain the same, and in
> any case, I preserve the existing elements where possible and
> desired). I do not see the first dimension as being different, and
> the result is that in my thinking:

> 1) size() returns the total number of elements in the N dimensional
> (sub)array, not the number of N-1 dimensional subarrays.
> 2) begin() returns an iterator that allows direct access to the
> element, not to the first N-1 dimensional array.
> 3) I wanted to maintain also a flat view of the underlying elements,
> so that I could apply algorithms and traverse the array
> following the order in which the elements are stored in memory.

I also think that a multidimensional array should be a flat container
with some mapping.

For the special case of N=2 this mapping mode should be compatible
with e.g. LinPack:
iflat = offset + i*istride + j*jstride

I think this is not possible with the second concept.

Some kind of expression templates would be the sugar of the library.


Boost list run by bdawes at, gregod at, cpdaniel at, john at