Boost logo

Ublas :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2007-01-02 15:26:30


This will still be inefficient since it does not support the array
serialization optimization in Boost 1.35 (the CVS head). To be
optimal just replace the for loop in storage.hpp by

ar & serialization::make_array(data_, size_);

Matthias

On Jan 2, 2007, at 9:12 PM, Gunter Winkler wrote:

> Hello,
>
> attached are patches that add support of the boost serialization tools
> to (un)bounded array, dense vector and dense matrix types. Please have
> a look at the provided example program. Writing into and restoring
> from
> an archive is now easy:
>
> CONTAINER const & const_x(x);
> std::ofstream ofs(fname, std::ios::trunc);
> boost::archive::text_oarchive oa(ofs);
>
> oa & const_x; // this works only with const types
>
> and
>
> CONTAINER y;
> std::ifstream ifs(fname, std::ios::in);
> boost::archive::text_iarchive ia(ifs);
>
> ia & y;
>
> The patch adds serialization to the types:
> bounded_array, unbounded_array, c_array (storage.hpp)
> vector, c_vector (vector.hpp)
> matrix, vector_of_vector, c_matrix (matrix.hpp)
>
> HTH
> Gunter
> <matrix_serialization.diff>
> <storage_serialization.diff>
> <vector_serialization.diff>
> <ex_serial.cpp>
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas