0

如何重置使用参数创建的累加器?换句话说,我想清除添加到累加器中的所有值。这是使用参数创建的累加器的示例,

// https://www.boost.org/doc/libs/1_55_0/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_statistical_accumulators_library.extended_p_square
using namespace boost::accumulators;

boost::array<double> probs = {0.001,0.01,0.1,0.25,0.5,0.75,0.9,0.99,0.999};
    accumulator_set<double, stats<tag::extended_p_square> >
acc(tag::extended_p_square::probabilities = probs); // <--- this const parameter

还有另一个问题/答案与此类似,acc = {}但仅适用于未使用参数创建的累加器。 重置升压累加器 C++

4

1 回答 1

0

选项之一是在重置累加器时创建包装类捕获和重用累加器参数

于 2021-04-14T12:05:00.530 回答