summaryrefslogtreecommitdiff
path: root/boost/accumulators/statistics/peaks_over_threshold.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/accumulators/statistics/peaks_over_threshold.hpp')
-rw-r--r--boost/accumulators/statistics/peaks_over_threshold.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/boost/accumulators/statistics/peaks_over_threshold.hpp b/boost/accumulators/statistics/peaks_over_threshold.hpp
index f04f743a0c..de73c658aa 100644
--- a/boost/accumulators/statistics/peaks_over_threshold.hpp
+++ b/boost/accumulators/statistics/peaks_over_threshold.hpp
@@ -181,6 +181,21 @@ namespace impl
return this->fit_parameters_;
}
+ // make this accumulator serializeable
+ // TODO: do we need to split to load/save and verify that threshold did not change?
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int file_version)
+ {
+ ar & Nu_;
+ ar & mu_;
+ ar & sigma2_;
+ ar & threshold_;
+ ar & get<0>(fit_parameters_);
+ ar & get<1>(fit_parameters_);
+ ar & get<2>(fit_parameters_);
+ ar & is_dirty_;
+ }
+
private:
std::size_t Nu_; // number of samples larger than threshold
mutable float_type mu_; // mean of Nu_ largest samples
@@ -291,6 +306,20 @@ namespace impl
return this->fit_parameters_;
}
+ // make this accumulator serializeable
+ // TODO: do we need to split to load/save and verify that threshold did not change?
+ template<class Archive>
+ void serialize(Archive & ar, const unsigned int file_version)
+ {
+ ar & mu_;
+ ar & sigma2_;
+ ar & threshold_probability_;
+ ar & get<0>(fit_parameters_);
+ ar & get<1>(fit_parameters_);
+ ar & get<2>(fit_parameters_);
+ ar & is_dirty_;
+ }
+
private:
mutable float_type mu_; // mean of samples above threshold u
mutable float_type sigma2_; // variance of samples above threshold u