
19 Dec
2008
19 Dec
'08
1:29 p.m.
Neal Becker wrote:
I'm interested in 2nd order stats for complex numbers.
typedef std::complex<double> complex_t; typedef accumulator_set<complex_t, stats<tag::mean, tag::moment<2> > > acc_t;
2 issues:
1) Need template<typename flt_t> inline std::complex<flt_t> operator/ (std::complex<flt_t> const& a, unsigned long int b) { return std::complex<flt_t> (real (a)/b, imag (a)/b); }
2) What do I get for moment<2> in the case of complex (and does this match the usual mathematical definition?)
I believe what I want to is mean, and \sum |x- mean(x)|**2 Can I do this with accumlators framework?