- introduce sum() returning the sum of the coeffs of a vector

- reimplement trace() as just diagonal().sum()
- apidoc fixes
This commit is contained in:
Benoit Jacob
2008-03-15 11:05:38 +00:00
parent fb3438e609
commit 29184ad27d
7 changed files with 121 additions and 91 deletions

View File

@@ -82,12 +82,12 @@ MatrixBase<Derived>::dot(const MatrixBase<OtherDerived>& other) const
ei_dot_unroller<SizeAtCompileTime-1,
SizeAtCompileTime <= EIGEN_UNROLLING_LIMIT ? SizeAtCompileTime : Dynamic,
Derived, MatrixBase<OtherDerived> >
::run(*static_cast<const Derived*>(this), other, res);
::run(derived(), other, res);
else
{
res = (*this).coeff(0) * ei_conj(other.coeff(0));
res = coeff(0) * ei_conj(other.coeff(0));
for(int i = 1; i < size(); i++)
res += (*this).coeff(i)* ei_conj(other.coeff(i));
res += coeff(i)* ei_conj(other.coeff(i));
}
return res;
}