[MultiArray][Variant][Serialization]
./test test: /home/goetz/local/src/boost-trunk/boost/multi_array/multi_array_ref.hpp:487: boost::multi_array_ref
& boost::multi_array_ref ::operator=(const ConstMultiArray&) [with ConstMultiArray = boost::multi_array , T = float, long unsigned int NumDims = 1ul, boost::multi_array_ref = boost::multi_array_ref ]: Assertion `std::equal(other.shape(),other.shape()+this->num_dimensions(),
I am trying to serialize a multi_array object but keep the dimensions
variable (I only want to support 1, 2 and 3 dimensions). So I attempted to
create a Variant of the three multi_array's and the corresponding serialize
methods as shown below, but I am getting a run-time error when for the
1-Dimensional case. Here is the minimal code example I came up with that
shows the problem. I am using the boost SVN trunk as of this posting (April
26, 2011).
Maybe I am implementing the load() method incorrectly for the multi_array.
Should there be a special case for when Dim == 1?
Running the program, I get the following error:
this->shape())' failed.
Aborted (core dumped)
/// Begin File: multiarray-variant-serialize.cpp
/**
* gcc compile command:
* g++ multiarray-variant-serialize.cpp -otest -lboost_serialization
*
* to run:
* ./test
**/
#include <fstream>
#include <string>
#include
participants (1)
-
Johann Goetz