Add an efficient rank2 update function (like the level2 blas xSYR2 routine).

Note that it is already used in Tridiagonalization.
This commit is contained in:
Gael Guennebaud
2009-07-11 21:14:59 +02:00
parent b47dea8b7a
commit a2087cd7a3
11 changed files with 187 additions and 51 deletions

View File

@@ -236,10 +236,8 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType&
+ (h*ei_conj(h)*Scalar(-0.5)*(matA.col(i).end(n-i-1).dot(hCoeffs.end(n-i-1)))) *
matA.col(i).end(n-i-1);
// symmetric rank-2 update
for (int j1=i+1; j1<n; ++j1)
matA.col(j1).end(n-j1) -= matA.col(i).end(n-j1) * ei_conj(hCoeffs.coeff(j1-1))
+ hCoeffs.end(n-j1) * ei_conj(matA.coeff(j1,i));
matA.corner(BottomRight, n-i-1, n-i-1).template selfadjointView<LowerTriangular>()
.rank2update(matA.col(i).end(n-i-1), hCoeffs.end(n-i-1), -1);
// note: at that point matA(i+1,i+1) is the (i+1)-th element of the final diagonal
// note: the sequence of the beta values leads to the subdiagonal entries