diff options
author | Gael Guennebaud <g.gael@free.fr> | 2009-07-11 21:14:59 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2009-07-11 21:14:59 +0200 |
commit | a2087cd7a3674c3d3ef74a474e417a3ea1f1e82b (patch) | |
tree | 601492688aa27c6e69ddf93b51892bfc676a2121 /Eigen/src/QR | |
parent | b47dea8b7aeab10cf584f2d3275192d90d8df2ed (diff) |
Add an efficient rank2 update function (like the level2 blas xSYR2 routine).
Note that it is already used in Tridiagonalization.
Diffstat (limited to 'Eigen/src/QR')
-rw-r--r-- | Eigen/src/QR/Tridiagonalization.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Eigen/src/QR/Tridiagonalization.h b/Eigen/src/QR/Tridiagonalization.h index bd8ff4fe3..4808b69ce 100644 --- a/Eigen/src/QR/Tridiagonalization.h +++ b/Eigen/src/QR/Tridiagonalization.h @@ -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 |