Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2001-04-02 10:26:06


On Mon, 2 Apr 2001, Serge Barral wrote:
sbarra> Actually, the result of A[3 <= stride(2) < 7][all][0 <= stride(1) < 10]
sbarra> would be a 3 dimensional subarray.
sbarra> The current proposal suggests that subarrays will support indexing, but how
sbarra> about slicing? Is it really often necessary in practice?

I think it is important to keep subarray's as close to array's as
possible... it is conceptually simpler for the user that way.

sbarra> I guess some confusion comes from the name "subarray" being different from
sbarra> "array". As I understand it, the distinction is not based on mathematical
sbarra> considerations, but is a distinction in the types that makes the
sbarra> implementation more efficient (a subarray is only a "view" of a multi_array
sbarra> and thus avoids the creation of a temporary multi_array).

Right. The actual class we were going to use for the subarray type is
going to be named something like multi_array_view or
multi_array_reference.

sbarra> But if my assumption above is correct, I don't understand how the result of
sbarra> indirect slicing and the result of slicing with Range objects can be of the
sbarra> same type, since these are two different kind of views.

I don't either ;) They will need to be different types. I haven't figured
out how to express the different types yet (in terms of the interface
presented to the user).

Cheers,
Jeremy

----------------------------------------------------------------------
 Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
 Ph.D. Candidate email: jsiek_at_[hidden]
 Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk