Boost logo

Boost :

Subject: [boost] accumulators + complex
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2008-12-19 08:13:11


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?)


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk