Boost logo

Boost Users :

Subject: [Boost-users] Slicing multi_array
From: James Amundson (amundson_at_[hidden])
Date: 2009-11-04 17:05:43


Hi,

I want to write a function that operates on one-dimensional
multi_array's and use it to modify the columns of a two-dimensional
multi_array. I thought that this would be a straightforward application
of slicing, i.e., views with dimensional reduction. However, my first
attempt to do so does not compile. (Please see the attached source
code.) When I try to pass a view to my function, I get:

error: invalid initialization of non-const reference of type
boost::multi_array_ref<double, 1ul>& from a temporary of type
boost::detail::multi_array::multi_array_view<double, 1ul>

I have now read the section on views and subarrays in the multi_array
reference documentation several times, but I do not see how I can do
what I want.

Any suggestions?

Thanks,
Jim Amundson




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