提高::蓄电池:这对于运营商sample_type? [英] boost::accumulator: which operators for sample_type?

查看:213
本文介绍了提高::蓄电池:这对于运营商sample_type?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用一个boost ::累加器定义我的自定义类的移动平均线:

I want to use a boost::accumulator for defining a moving average of my custom class:

boost::accumulators::accumulator_set<MySample, boost::accumulators::stats<boost::accumulators::tag::rolling_mean> >

我的问题是我的样本是用户定义的类(vector实现另一个库)。

My problem is that my sample is a user defined class (vector implementation of another library).

我见过的<一个href=\"http://stackoverflow.com/questions/4316716/is-it-possible-to-use-boost-accumulators-with-vectors\">in这个帖子这是可以定义的std ::向量蓄能器,但它并没有指定运营商必须重载,因为它与升压/累加器/数字/功能/ vector.hpp重载它们

I've seen in this post that's possible to define accumulators for std::vectors, but it does not specify which operator must be overloaded because it overloads them with boost/accumulators/numeric/functional/vector.hpp.

如果我想使用蓄能器与用户自定义的样品类,经营者,我必须超载又如何?

If I want to use accumulator with an user-defined sample class, which operator I must overload and how?

推荐答案

答案会根据您所使用的统计信息不同,不幸的是这一切都不是有据可查的。最好的答案我可以给是尝试编译它,看看错误信息,添加所需的操作人员,冲洗,重复,直到工作的事情。 : - /

The answer is going to differ depending on the stats you use, and sadly none of this is well documented. The best answer I can give is to try to compile it, look at the error message, add the needed operator, rinse, repeat until things work. :-/

这篇关于提高::蓄电池:这对于运营商sample_type?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆