aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Cholesky
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-07-18 11:02:22 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-07-18 11:02:22 +0200
commita325d1cb1e607c36d602b1cad9a57b05c60050fa (patch)
tree0c4576947946af90cb8587a4ccbf7030c5b8f772 /Eigen/src/Cholesky
parent2bdb3b1afdbc07d54fec43edff92138f82492941 (diff)
parentda62eb22e497d864ccaed93907818a384bad8e2a (diff)
merge with default branch
Diffstat (limited to 'Eigen/src/Cholesky')
-rw-r--r--Eigen/src/Cholesky/LDLT.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/Eigen/src/Cholesky/LDLT.h b/Eigen/src/Cholesky/LDLT.h
index 7415b826a..f621323a3 100644
--- a/Eigen/src/Cholesky/LDLT.h
+++ b/Eigen/src/Cholesky/LDLT.h
@@ -264,6 +264,7 @@ template<> struct ldlt_inplace<Lower>
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef typename MatrixType::Index Index;
+ typedef typename TranspositionType::StorageIndexType IndexType;
eigen_assert(mat.rows()==mat.cols());
const Index size = mat.rows();
@@ -283,7 +284,7 @@ template<> struct ldlt_inplace<Lower>
mat.diagonal().tail(size-k).cwiseAbs().maxCoeff(&index_of_biggest_in_corner);
index_of_biggest_in_corner += k;
- transpositions.coeffRef(k) = index_of_biggest_in_corner;
+ transpositions.coeffRef(k) = IndexType(index_of_biggest_in_corner);
if(k != index_of_biggest_in_corner)
{
// apply the transposition while taking care to consider only
@@ -292,7 +293,7 @@ template<> struct ldlt_inplace<Lower>
mat.row(k).head(k).swap(mat.row(index_of_biggest_in_corner).head(k));
mat.col(k).tail(s).swap(mat.col(index_of_biggest_in_corner).tail(s));
std::swap(mat.coeffRef(k,k),mat.coeffRef(index_of_biggest_in_corner,index_of_biggest_in_corner));
- for(int i=k+1;i<index_of_biggest_in_corner;++i)
+ for(Index i=k+1;i<index_of_biggest_in_corner;++i)
{
Scalar tmp = mat.coeffRef(i,k);
mat.coeffRef(i,k) = numext::conj(mat.coeffRef(index_of_biggest_in_corner,i));
@@ -460,6 +461,7 @@ template<typename MatrixType, int _UpLo>
template<typename Derived>
LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::rankUpdate(const MatrixBase<Derived>& w, const typename NumTraits<typename MatrixType::Scalar>::Real& sigma)
{
+ typedef typename TranspositionType::StorageIndexType IndexType;
const Index size = w.rows();
if (m_isInitialized)
{
@@ -471,7 +473,7 @@ LDLT<MatrixType,_UpLo>& LDLT<MatrixType,_UpLo>::rankUpdate(const MatrixBase<Deri
m_matrix.setZero();
m_transpositions.resize(size);
for (Index i = 0; i < size; i++)
- m_transpositions.coeffRef(i) = i;
+ m_transpositions.coeffRef(i) = IndexType(i);
m_temporary.resize(size);
m_sign = sigma>=0 ? internal::PositiveSemiDef : internal::NegativeSemiDef;
m_isInitialized = true;