3#include <boost/accumulators/accumulators.hpp>
4#include <boost/accumulators/statistics/count.hpp>
5#include <boost/accumulators/statistics/max.hpp>
6#include <boost/accumulators/statistics/mean.hpp>
7#include <boost/accumulators/statistics/min.hpp>
8#include <boost/accumulators/statistics/stats.hpp>
9#include <boost/accumulators/statistics/variance.hpp>
10#include <fmt/ostream.h>
55 return boost::accumulators::extract::count(
_acc);
65 boost::accumulators::accumulator_set<double, boost::accumulators::stats<
66 boost::accumulators::tag::min,
67 boost::accumulators::tag::max,
68 boost::accumulators::tag::mean,
69 boost::accumulators::tag::lazy_variance>>
75 if (accumulator.
empty()) {
78 out <<
"min:" << accumulator.
min()
79 <<
" max:" << accumulator.
max()
80 <<
" avg: " << accumulator.
mean()
81 <<
" var: " << accumulator.
variance()
82 <<
" cnt: " << accumulator.
count();
92struct fmt::formatter<
precice::utils::statistics::DistanceAccumulator> : ostream_formatter {
double min() const
Returns the minimum of all accumulated values.
double mean() const
Returns the mean of all accumulated values.
boost::accumulators::accumulator_set< double, boost::accumulators::stats< boost::accumulators::tag::min, boost::accumulators::tag::max, boost::accumulators::tag::mean, boost::accumulators::tag::lazy_variance > > _acc
void operator()(double value)
Accumulates value.
double max() const
Returns the maximum of all accumulated values.
double variance() const
Returns the sample variance based on all accumulated values.
bool empty() const
Returns count == 0.
std::size_t count() const
Returns how many values have been accumulated.
std::ostream & operator<<(std::ostream &out, const DistanceAccumulator &accumulator)
Main namespace of the precice library.