|
Boost : |
Subject: Re: [boost] Interest in multi-dimensional array class templates.
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-06-23 10:09:51
On 06/23/11 08:08, Frank Mori Hess wrote:
> On Wednesday, June 22, 2011, Brian Smith wrote:
>>>
>>> There is also Boost.MultiArray, has the overlap with that library been
>>> addressed already?
>>
>> In terms of the way in which the two libraries create and manipulate
>> storage there's no overlap. Ultimately they serve the same purpose,
>> however, Boost.MultiArray doesn't provide statically allocated arrays
>
> I'm not sure that's true. I've never tried it, but multi_array_ref
> "provides the MultiArray interface over any contiguous block of elements" so
> it seems like you could create one of those which uses statically allocated
> storage.
>
>> and generally provides poorer performance.
>
> Is that assertion based on actual testing (with NDEBUG defined), or is there
> some by-design reason your performance would be better?
>
IIUC, Brian's templates provide something akin to:
template
< typename T
, std::size_t... Lengths
>
struct array
;
corresponding to multi_array's:
template
< typename T
, std::size_t NumDims
>
struct multi_array
;
where T serves the same purpose as multi_array's T and
sizeof...(Lengths) = multi_array's NumDims and the Lengths,
instead of being passed to the CTOR, as in multiarray and
being runtime values, are specified as compile-time constants.
Is that *about* right Brian?
-regards,
Larry
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk