Index: vector.hpp =================================================================== RCS file: /cvsroot/boost/boost/boost/numeric/ublas/vector.hpp,v retrieving revision 1.74 diff -b -d -u -r1.74 vector.hpp --- vector.hpp 6 Dec 2006 09:34:01 -0000 1.74 +++ vector.hpp 6 Jan 2007 16:12:07 -0000 @@ -20,6 +20,8 @@ #include #include #include +#include +#include // Iterators based on ideas of Jeremy Siek @@ -505,6 +507,12 @@ return reverse_iterator (begin ()); } + // Serialization + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + ar & serialization::make_nvp("data",data_); + } + private: array_type data_; }; @@ -1674,6 +1682,21 @@ return reverse_iterator (begin ()); } + // Serialization + template + void serialize(Archive & ar, const unsigned int /* file_version */){ + // we need to copy to a collection_size_type to get a portable + // and efficient serializatio + serialization::collection_size_type s (size_) + ar & serialization::make_nvp("size",s); + + // copy the value back if loading + if (Archive::is_loading::value) + size_ = s; + // ISSUE: this writes the full array + ar & serialization::make_nvp("data",data_); + } + private: size_type size_; array_type data_;