|
Boost : |
From: Ronald Garcia (garcia_at_[hidden])
Date: 2002-10-22 13:08:22
Hello Jon,
On Tue, 22 Oct 2002, Jon Pendergrass wrote:
> 'm new to Boost, so please excuse my lack of
> knowledge. I'm trying to use the multi_array class and
> have hit a small snag.
>
> I'd like to have a class with a 4-D array. Initially
> it won't contain any data. However, Microsoft Visual
> C++ v6.0 complains about not find a constructor.
>
> I want to do something like this:
>
> typedef boost::multi_array<std::complex<double>, 4> t_Array4D;
>
> class foobar
> {
> t_Array4D ar;
> }
>
> void foobar::SetValue()
> {
> // set extents code
>
> // set value
> this->ar[0][0][0][0] = 2.0;
> }
>
The problem with your snippet is that a multi_array does not have a
default constructor. You must specify the array's shape at construction
time.
Hope this helps,
Ron
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk