diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-06-06 13:10:00 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2008-06-06 13:10:00 +0000 |
commit | 869394ee8b0faa11f03412a77035fbf6c5c66f95 (patch) | |
tree | 4525a93fdc237bc07306178d2751fb3b9da2c9b5 /Eigen/src/QR | |
parent | 2126baf9dcdbfb27579522f42228316c4c309539 (diff) |
fix some compile errors with gcc 4.3, some warnings, some documentation
Diffstat (limited to 'Eigen/src/QR')
-rw-r--r-- | Eigen/src/QR/SelfAdjointEigenSolver.h | 9 | ||||
-rwxr-xr-x | Eigen/src/QR/Tridiagonalization.h | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/Eigen/src/QR/SelfAdjointEigenSolver.h b/Eigen/src/QR/SelfAdjointEigenSolver.h index 227d71528..fd73714dc 100644 --- a/Eigen/src/QR/SelfAdjointEigenSolver.h +++ b/Eigen/src/QR/SelfAdjointEigenSolver.h @@ -47,7 +47,7 @@ template<typename _MatrixType> class SelfAdjointEigenSolver typedef std::complex<RealScalar> Complex; typedef Matrix<RealScalar, MatrixType::ColsAtCompileTime, 1> RealVectorType; typedef Matrix<RealScalar, Dynamic, 1> RealVectorTypeX; - typedef Tridiagonalization<MatrixType> Tridiagonalization; + typedef Tridiagonalization<MatrixType> TridiagonalizationType; SelfAdjointEigenSolver(const MatrixType& matrix, bool computeEigenvectors = true) : m_eivec(matrix.rows(), matrix.cols()), @@ -124,8 +124,8 @@ void SelfAdjointEigenSolver<MatrixType>::compute(const MatrixType& matrix, bool // the latter avoids multiple memory allocation when the same SelfAdjointEigenSolver is used multiple times... // (same for diag and subdiag) RealVectorType& diag = m_eivalues; - typename Tridiagonalization::SubDiagonalType subdiag(n-1); - Tridiagonalization::decomposeInPlace(m_eivec, diag, subdiag, computeEigenvectors); + typename TridiagonalizationType::SubDiagonalType subdiag(n-1); + TridiagonalizationType::decomposeInPlace(m_eivec, diag, subdiag, computeEigenvectors); int end = n-1; int start = 0; @@ -191,10 +191,11 @@ template<typename Derived> struct ei_matrixNorm_selector<Derived, false> static inline typename NumTraits<typename ei_traits<Derived>::Scalar>::Real matrixNorm(const MatrixBase<Derived>& m) { + typename Derived::Eval m_eval(m); // FIXME if it is really guaranteed that the eigenvalues are already sorted, // then we don't need to compute a maxCoeff() here, comparing the 1st and last ones is enough. return ei_sqrt( - (m*m.adjoint()) + (m_eval*m_eval.adjoint()) .template marked<SelfAdjoint>() .eigenvalues() .maxCoeff() diff --git a/Eigen/src/QR/Tridiagonalization.h b/Eigen/src/QR/Tridiagonalization.h index d580c7e5c..b347b19a6 100755 --- a/Eigen/src/QR/Tridiagonalization.h +++ b/Eigen/src/QR/Tridiagonalization.h @@ -163,7 +163,7 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType& RealScalar beta = ei_sqrt(ei_abs2(v0)+v1norm2); if (ei_real(v0)>=0.) beta = -beta; - matA.col(i).end(n-(i+2)) *= (1./(v0-beta)); + matA.col(i).end(n-(i+2)) *= (Scalar(1)/(v0-beta)); matA.col(i).coeffRef(i+1) = beta; Scalar h = (beta - v0) / beta; // end of the householder transformation @@ -177,7 +177,7 @@ void Tridiagonalization<MatrixType>::_compute(MatrixType& matA, CoeffVectorType& * matA.col(i).end(n-i-1)); - hCoeffs.end(n-i-1) += (h * (-0.5) * matA.col(i).end(n-i-1).dot(hCoeffs.end(n-i-1))) + hCoeffs.end(n-i-1) += (h * Scalar(-0.5) * matA.col(i).end(n-i-1).dot(hCoeffs.end(n-i-1))) * matA.col(i).end(n-i-1); matA.corner(BottomRight,n-i-1,n-i-1).template part<Lower>() = |