|
Boost : |
From: Larry Evans (jcampbell3_at_[hidden])
Date: 2001-04-01 16:20:46
Jeremy Siek wrote:
> On Sun, 1 Apr 2001, Toon Knapen wrote:
> toon> Isn't that confusing. And mathematically there's a hugh difference
> toon> between operations where the result has the same dimension or
> toon> a lower dimension. Why would we make they be identical then
> toon> in C++ syntax ?
>
> Well, its not identical syntax, but similar:
>
> assume A is 3 dimensional
>
> A[3 <= stride(1) < 7][2][0 <= stride(1) < 10]
> gives you a 2 dimensional array
>
> A[3 <= stride(2) < 7][all][0 <= stride(1) < 10]
> gives you a 3 dimensional array
>
> At least to me, the above syntax is quite clear.
> Now, according to Blitz terminology, the 1st thing is a slice
> and the 2nd thing is a subarray. However, in the docs for
> operator[] I'd rather just say that the thing returned is
> a subarray.
So, just to be sure I understand, the following expression:
A[3 <= stride(2) < 7][all][0 <= stride(1) < 10]
[all][all][all]
would be a 3 dimensional array. This means that you could
have an infinite number of [sliceExpr] operators strung together,
where sliceExpr is either all or something like [3<=stride(1)<7].
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk