From 314aff875e2ca3741bb7a62623c0976571fd55ec Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 9 Mar 2009 10:41:37 +0000 Subject: [PATCH] fix warning in Tridiag --- Eigen/src/QR/Tridiagonalization.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Eigen/src/QR/Tridiagonalization.h b/Eigen/src/QR/Tridiagonalization.h index 54d705fd1..9996a02c8 100644 --- a/Eigen/src/QR/Tridiagonalization.h +++ b/Eigen/src/QR/Tridiagonalization.h @@ -73,8 +73,7 @@ template class Tridiagonalization {} Tridiagonalization(const MatrixType& matrix) - : m_matrix(matrix), - m_hCoeffs(matrix.cols()-1) + : m_matrix(matrix), m_hCoeffs(matrix.cols()-1) { _compute(m_matrix, m_hCoeffs); } @@ -122,13 +121,12 @@ template class Tridiagonalization static void decomposeInPlace(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag, bool extractQ = true); - private: - static void _compute(MatrixType& matA, CoeffVectorType& hCoeffs); + protected: + static void _decomposeInPlace3x3(MatrixType& mat, DiagonalType& diag, SubDiagonalType& subdiag, bool extractQ = true); - protected: MatrixType m_matrix; CoeffVectorType m_hCoeffs; }; @@ -192,7 +190,6 @@ void Tridiagonalization::_compute(MatrixType& matA, CoeffVectorType& { assert(matA.rows()==matA.cols()); int n = matA.rows(); -// std::cerr << matA << "\n\n"; for (int i = 0; i::_compute(MatrixType& matA, CoeffVectorType& // i.e., A = H' A H where H = I - h v v' and v = matA.col(i).end(n-i-1) matA.col(i).coeffRef(i+1) = 1; - Scalar* EIGEN_RESTRICT t = &hCoeffs.coeffRef(-1); // hCoeffs.end(n-i-1) = (matA.corner(BottomRight,n-i-1,n-i-1).template part() // * matA.col(i).end(n-i-1)).lazy(); @@ -229,7 +225,7 @@ void Tridiagonalization::_compute(MatrixType& matA, CoeffVectorType& (n-i-1,matA.corner(BottomRight,n-i-1,n-i-1).data(), matA.stride(), matA.col(i).end(n-i-1).data(), const_cast(hCoeffs.end(n-i-1).data())); hCoeffs.end(n-i-1) = hCoeffs.end(n-i-1)*h - + (h*ei_conj(h)*Scalar(-0.5)*matA.col(i).end(n-i-1).dot(hCoeffs.end(n-i-1))) * + + (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