From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-12-04 10:17:31
In message <002201c05e00$59633a20$460a10ac_at_[hidden]>, Kris Thielemans
>- multi-dimensional arrays needn't be 'regular' or 'rectangular'. For
>instance, a each index in a 2D array can give you a 1D array with different
Ragged arrays, ie like vector< vector<T> >, solve a different design
problem to the one solved by Giovanni's code. Whilst I think there is a
place for them, the constraint of regularity is important in the current
design. Perhaps you would consider a separate proposal?
>- I allow indices with non-zero offset
For any particular reason?
>- there is some extra code like operator+ etc and (binary) IO (but that's
>pretty trivial to add).
What do you do for the ragged cases with operator+, ie where you add two
arrays together and a position is filled in one but not the other? Given
the different possibilities, I'm inclined to think of these options as
expressed through separate algorithm functions rather than a single
>The 1st property was required by our application, and does complicate
>optimisation of various operations.
Giovanni's current proposal has a number of strengths, as I see it,
including efficiency and simplicity.
>To solve the issue of 2 types of iterators I have different members:
>// iterators for a 1D view on the nD array, so 'pointing' to a T
>inline full_iterator begin_all();
>inline full_iterator end_all();
>// iterators which 'point' to a N-1-dim Array.
>inline iterator begin();
>inline iterator end();
Yes, this seems good.
>- it should all have been derived from valarray (but that wasn't around yet
>when I started this project).
No, what you did first seems like the right thing ;->
Kevlin Henney phone: +44 117 942 2990
Curbralan Limited mobile: +44 7801 073 508
mailto:kevlin_at_[hidden] fax: +44 870 052 2289
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk