Adapted mean to work with complex numbers.

Added regression test.
This commit is contained in:
Hauke Heibel
2010-01-29 12:12:02 +01:00
parent 42b88983ff
commit 6dee5440e4
2 changed files with 14 additions and 1 deletions

View File

@@ -356,7 +356,7 @@ template<typename Derived>
EIGEN_STRONG_INLINE typename ei_traits<Derived>::Scalar
DenseBase<Derived>::mean() const
{
return this->redux(Eigen::ei_scalar_sum_op<Scalar>()) / this->size();
return this->redux(Eigen::ei_scalar_sum_op<Scalar>()) / Scalar(this->size());
}
/** \returns the product of all coefficients of *this