summaryrefslogtreecommitdiff
path: root/boost/accumulators/statistics/density.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/accumulators/statistics/density.hpp')
-rw-r--r--boost/accumulators/statistics/density.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/boost/accumulators/statistics/density.hpp b/boost/accumulators/statistics/density.hpp
index 88ca17df79..32b48060fc 100644
--- a/boost/accumulators/statistics/density.hpp
+++ b/boost/accumulators/statistics/density.hpp
@@ -25,6 +25,8 @@
#include <boost/accumulators/statistics/count.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/min.hpp>
+#include <boost/serialization/vector.hpp>
+#include <boost/serialization/utility.hpp>
namespace boost { namespace accumulators
{
@@ -184,6 +186,20 @@ namespace impl
return make_iterator_range(this->histogram);
}
+ // make this accumulator serializeable
+ // TODO split to save/load and check on parameters provided in ctor
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int file_version)
+ {
+ ar & cache_size;
+ ar & cache;
+ ar & num_bins;
+ ar & samples_in_bin;
+ ar & bin_positions;
+ ar & histogram;
+ ar & is_dirty;
+ }
+
private:
std::size_t cache_size; // number of cached samples
array_type cache; // cache to store the first cache_size samples