Boost logo

Boost Users :

Subject: Re: [Boost-users] question about multi_array use
From: Alle Meije Wink (a.m.wink_at_[hidden])
Date: 2009-08-13 08:36:35


Dear OverMind

Hope I'm not making this thread too long, I've tried to search the
archives but did not get further than browsing.

After looking at different options, your idea of wrapping the different
dimensions/dimensionalities in a struct sounds like the best idea, and
closest to the type of data and problems I'm dealing with.

Would you have a few more clues (maybe code, maybe URLs) as to how to
shape this? I had a look at
http://en.wikipedia.org/wiki/Curiously_recurring_template_pattern but
that is a very broad description. As I understand it, the struct that
encapsulates the possible dimensionalities and the CRTP class refer to
the same solution? Or are they different things?

Thanks!
Alle Meije

> Date: Fri, 7 Aug 2009 18:09:11 -0600
> From: OvermindDL1 <overminddl1_at_[hidden]>
> Subject: Re: [Boost-users] question about multi_array use
>
> You could always just wrap up each of the possible dimensions in a
> struct that can handle the (de)serialization and everything too,
> perhaps use crtp to put identical functionality in a non-virtual base
> class.
>
>> On Fri, Aug 7, 2009 at 2:04 PM, Anton Daneyko<self_at_[hidden]> wrote:
>> Hello,
>>
>> I might be wrong, but it seems the answer is "no you can't do that", because
>> the dimensionality is a template parameter multi_array<int, 2> and
>> multi_array<int, 3> are different types. However I would like to hear some
>> else' opinion as well.
>>
>> Regards,
>> Anton Daneyko.
>>
>> On Fri, Aug 7, 2009 at 3:48 PM, Alle Meije Wink <a.m.wink_at_[hidden]> wrote:
>>> Hello,
>>>
>>> I would like to use the multi_array container to handle imaging data. The
>>> image data can be anything up to 8-dimensional (usually up to 4) and
>>> dimension information is found in records that accompany the binary data.
>>>
>>> Would it be possible to create an image class that takes the
>>> dimensionality and extents list as parameters, so that images of all
>>> dimensionalities can be treated as one class?
>>>
>>> For example, could the dimensionality be passed as a size_t argument?
>>>
>>> What I understand from the multi_array paper is that the extents list
>>> would only be required whan the array is initialised.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net