diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-04-19 11:21:39 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-04-19 11:21:39 +0200 |
commit | 9cd2d14005def8e7df0b0bf5fd6eb51f8a6591e9 (patch) | |
tree | ca4df13b58e923bdebd9d5f59aecda9d1e30ca58 /Eigen/src/Cholesky | |
parent | 4e2e615a7c2c719d2d708ab32840bad353322d8c (diff) | |
parent | 46755648ec341aa5e0283b47456108bb2897b1b3 (diff) |
merge with default branch
Diffstat (limited to 'Eigen/src/Cholesky')
-rw-r--r-- | Eigen/src/Cholesky/LDLT.h | 10 | ||||
-rw-r--r-- | Eigen/src/Cholesky/LLT.h | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Eigen/src/Cholesky/LDLT.h b/Eigen/src/Cholesky/LDLT.h index 5dede8081..9bd60d648 100644 --- a/Eigen/src/Cholesky/LDLT.h +++ b/Eigen/src/Cholesky/LDLT.h @@ -196,7 +196,7 @@ template<typename _MatrixType, int _UpLo> class LDLT LDLT& compute(const MatrixType& matrix); template <typename Derived> - LDLT& rankUpdate(const MatrixBase<Derived>& w,RealScalar alpha=1); + LDLT& rankUpdate(const MatrixBase<Derived>& w, const RealScalar& alpha=1); /** \returns the internal LDLT decomposition matrix * @@ -347,7 +347,7 @@ template<> struct ldlt_inplace<Lower> // Here only rank-1 updates are implemented, to reduce the // requirement for intermediate storage and improve accuracy template<typename MatrixType, typename WDerived> - static bool updateInPlace(MatrixType& mat, MatrixBase<WDerived>& w, typename MatrixType::RealScalar sigma=1) + static bool updateInPlace(MatrixType& mat, MatrixBase<WDerived>& w, const typename MatrixType::RealScalar& sigma=1) { using internal::isfinite; typedef typename MatrixType::Scalar Scalar; @@ -386,7 +386,7 @@ template<> struct ldlt_inplace<Lower> } template<typename MatrixType, typename TranspositionType, typename Workspace, typename WType> - static bool update(MatrixType& mat, const TranspositionType& transpositions, Workspace& tmp, const WType& w, typename MatrixType::RealScalar sigma=1) + static bool update(MatrixType& mat, const TranspositionType& transpositions, Workspace& tmp, const WType& w, const typename MatrixType::RealScalar& sigma=1) { // Apply the permutation to the input w tmp = transpositions * w; @@ -405,7 +405,7 @@ template<> struct ldlt_inplace<Upper> } template<typename MatrixType, typename TranspositionType, typename Workspace, typename WType> - static EIGEN_STRONG_INLINE bool update(MatrixType& mat, TranspositionType& transpositions, Workspace& tmp, WType& w, typename MatrixType::RealScalar sigma=1) + static EIGEN_STRONG_INLINE bool update(MatrixType& mat, TranspositionType& transpositions, Workspace& tmp, WType& w, const typename MatrixType::RealScalar& sigma=1) { Transpose<MatrixType> matt(mat); return ldlt_inplace<Lower>::update(matt, transpositions, tmp, w.conjugate(), sigma); @@ -457,7 +457,7 @@ LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::compute(const MatrixType& a) */ template<typename MatrixType, int _UpLo> template<typename Derived> -LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::rankUpdate(const MatrixBase<Derived>& w,typename NumTraits<typename MatrixType::Scalar>::Real sigma) +LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::rankUpdate(const MatrixBase<Derived>& w, const typename NumTraits<typename MatrixType::Scalar>::Real& sigma) { const Index size = w.rows(); if (m_isInitialized) diff --git a/Eigen/src/Cholesky/LLT.h b/Eigen/src/Cholesky/LLT.h index 478fad251..db22a2f85 100644 --- a/Eigen/src/Cholesky/LLT.h +++ b/Eigen/src/Cholesky/LLT.h @@ -200,7 +200,7 @@ static typename MatrixType::Index llt_rank_update_lower(MatrixType& mat, const V typedef Matrix<Scalar,Dynamic,1> TempVectorType; typedef typename TempVectorType::SegmentReturnType TempVecSegment; - int n = mat.cols(); + Index n = mat.cols(); eigen_assert(mat.rows()==n && vec.size()==n); TempVectorType temp; @@ -212,12 +212,12 @@ static typename MatrixType::Index llt_rank_update_lower(MatrixType& mat, const V // i.e., for sigma > 0 temp = sqrt(sigma) * vec; - for(int i=0; i<n; ++i) + for(Index i=0; i<n; ++i) { JacobiRotation<Scalar> g; g.makeGivens(mat(i,i), -temp(i), &mat(i,i)); - int rs = n-i-1; + Index rs = n-i-1; if(rs>0) { ColXprSegment x(mat.col(i).tail(rs)); @@ -230,7 +230,7 @@ static typename MatrixType::Index llt_rank_update_lower(MatrixType& mat, const V { temp = vec; RealScalar beta = 1; - for(int j=0; j<n; ++j) + for(Index j=0; j<n; ++j) { RealScalar Ljj = real(mat.coeff(j,j)); RealScalar dj = abs2(Ljj); |