|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r57696 - in sandbox/statistics/detail/multi_array: boost/statistics/detail/multi_array/serialization libs/statistics/detail/multi_array/example
From: erwann.rogard_at_[hidden]
Date: 2009-11-15 20:07:33
Author: e_r
Date: 2009-11-15 20:07:31 EST (Sun, 15 Nov 2009)
New Revision: 57696
URL: http://svn.boost.org/trac/boost/changeset/57696
Log:
m
Text files modified:
sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/load.hpp | 2 +-
sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/save.hpp | 2 +-
sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/serialize.hpp | 4 ++--
sandbox/statistics/detail/multi_array/libs/statistics/detail/multi_array/example/serialize.cpp | 18 +++++++-----------
4 files changed, 11 insertions(+), 15 deletions(-)
Modified: sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/load.hpp
==============================================================================
--- sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/load.hpp (original)
+++ sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/load.hpp 2009-11-15 20:07:31 EST (Sun, 15 Nov 2009)
@@ -15,7 +15,7 @@
namespace boost{ namespace serialization{
- template<typename T,class Archive>
+ template<class Archive,class T>
inline void load(
Archive & ar,
boost::multi_array<T,2> & t,
Modified: sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/save.hpp
==============================================================================
--- sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/save.hpp (original)
+++ sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/save.hpp 2009-11-15 20:07:31 EST (Sun, 15 Nov 2009)
@@ -15,7 +15,7 @@
namespace boost{ namespace serialization{
- template<typename T,typename Archive>
+ template<typename Archive,typename T>
inline void save(
Archive & ar,
const boost::multi_array<T,2> & t,
Modified: sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/serialize.hpp
==============================================================================
--- sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/serialize.hpp (original)
+++ sandbox/statistics/detail/multi_array/boost/statistics/detail/multi_array/serialization/serialize.hpp 2009-11-15 20:07:31 EST (Sun, 15 Nov 2009)
@@ -14,10 +14,10 @@
namespace boost{ namespace serialization{
- template<typename T,class Archive>
+ template<class Archive,typename T>
inline void serialize(
Archive & ar,
- const boost::multi_array<T,2>& t,
+ boost::multi_array<T,2>& t,
const unsigned int file_version
)
{
Modified: sandbox/statistics/detail/multi_array/libs/statistics/detail/multi_array/example/serialize.cpp
==============================================================================
--- sandbox/statistics/detail/multi_array/libs/statistics/detail/multi_array/example/serialize.cpp (original)
+++ sandbox/statistics/detail/multi_array/libs/statistics/detail/multi_array/example/serialize.cpp 2009-11-15 20:07:31 EST (Sun, 15 Nov 2009)
@@ -10,11 +10,11 @@
#include <string>
#include <fstream>
#include <boost/multi_array.hpp>
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
#include <boost/statistics/detail/multi_array/serialization/serialize.hpp>
#include <boost/serialization/serialization.hpp>
-//#include <boost/serialization/vector.hpp>
+#include <boost/archive/text_oarchive.hpp>
+#include <boost/archive/text_iarchive.hpp>
+// #include <boost/serialization/vector.hpp>
#include <libs/statistics/detail/multi_array/example/serialize.h>
void example_multi_array_serialize(std::ostream& os)
@@ -30,6 +30,7 @@
typedef boost::archive::text_oarchive oa_;
typedef boost::archive::text_iarchive ia_;
typedef double val_;
+ typedef std::vector<val_> vec_;
typedef boost::multi_array<val_, 2> array_;
typedef std::vector<array_> vec_array_;
typedef boost::array<ma::multi_array_base::index,2> extents_;
@@ -42,6 +43,7 @@
oa_ oa(ofs);
extents_ extents = {{n0,n1}};
array_ a(extents);
+ // vec_ vec;
for(unsigned i = 0; i<n0; i++)
{
for(unsigned j = 0; j<n1; j++)
@@ -49,19 +51,13 @@
a[i][j] = i * n1 + j;
}
}
- boost::serialization::save(oa,a,v);
-
- // Neither of these compiles:
- boost::serialization::serialize_adl(oa,a,v);
- // oa << a;
+ oa << a;
}
{
ifs_ ifs(path.c_str());
ia_ ia(ifs);
array_ a;
- // Neither of these compiles:
- // boost::serialization::serialize(ia,a,v);
- // ia >> a;
+ ia >> a;
boost::serialization::load(ia,a,v);
for(unsigned i = 0; i<n0; i++)
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk