Gunter Winkler <guwi17 <at> gmx.de
> I'd like using the serialization this way (or using the funny "&"
> notation). I see a the big advantage, that it is a) easy to provide a
> working serialization for each uBlas container and b) easy to provide
> different format. One could even imagine to provide a "console_archive"
> for pretty printing matrices to std::out.
I agree, sounds like the right approach. And it could abstract the difference
in implementation for row vs. column major matrices which would be a pain for
(as an aside, if anyone decides to take this further I think we could have
serialization of classes as matlab structs using something like the name-value
Can I ask for a suggestion or two on implementation? In particular, I want to know if I am using the
boost::numeric::bindings in a smart way as I think this should be ublas independent.
See the attached file for a starting point of the templates.
1) Since this wouldn't just be ublas specific, I wonder what we should call the function that adds the 'name' to the structure and in what namespace it should live in?
Do people think this could work and that boost::serialization::make_nvp(const char* name, T& t) is the right signature/namespace for this?
3) Assuming that we used make_nvp instead of the method I suggested in anearlier email, the specilizations will be in the operator& and operator<< functions.
4) You can see how I setup a few of the specializations here. A few questions about the bindings:
a) Am I using the right metafunctions for the specializations? (matio seems to require contiguous row_major memory)
b) How do I get the begin() and end() pointers to the data when using matrices row_major and column_major? I figured out begin() for vectors but was confused for matrices.
c) Are there any tricks/utilities for converting the storage orderings from column to row major? I could do a transpose, but how can you do it in a data structure independent way?
d) On a similar note, are there utilities to help with non-contiguous structures getting into a chunk of contiguous memory? If so, then these could be specialized for other than linear_array