From 3bd31e21b5aac1aaf1c0e217f472846450b2d5fb Mon Sep 17 00:00:00 2001 From: Georg Drenkhahn Date: Sat, 20 Sep 2014 15:00:36 +0200 Subject: [PATCH] Fixed compiler warning on implicit integer conversion by separating index type for matrix and permutation matrix which may not be equal. --- unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h b/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h index f5290dee4..db3a0ef2c 100644 --- a/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h +++ b/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h @@ -19,18 +19,19 @@ namespace Eigen { namespace internal { -template +template void lmqrsolv( Matrix &s, - const PermutationMatrix &iPerm, + const PermutationMatrix &iPerm, const Matrix &diag, const Matrix &qtb, Matrix &x, Matrix &sdiag) { + typedef typename Matrix::Index Index; /* Local variables */ - Index i, j, k, l; + Index i, j, k; Scalar temp; Index n = s.cols(); Matrix wa(n); @@ -52,7 +53,7 @@ void lmqrsolv( /* prepare the row of d to be eliminated, locating the */ /* diagonal element using p from the qr factorization. */ - l = iPerm.indices()(j); + const PermIndex l = iPerm.indices()(j); if (diag[l] == 0.) break; sdiag.tail(n-j).setZero();