Fixed compiler warning on implicit integer conversion by separating index type for matrix and permutation matrix which may not be equal.

This commit is contained in:
Georg Drenkhahn 2014-09-20 15:00:36 +02:00
parent 75e269c77b
commit 3bd31e21b5

View File

@ -19,18 +19,19 @@ namespace Eigen {
namespace internal {
template <typename Scalar,int Rows, int Cols, typename Index>
template <typename Scalar,int Rows, int Cols, typename PermIndex>
void lmqrsolv(
Matrix<Scalar,Rows,Cols> &s,
const PermutationMatrix<Dynamic,Dynamic,Index> &iPerm,
const PermutationMatrix<Dynamic,Dynamic,PermIndex> &iPerm,
const Matrix<Scalar,Dynamic,1> &diag,
const Matrix<Scalar,Dynamic,1> &qtb,
Matrix<Scalar,Dynamic,1> &x,
Matrix<Scalar,Dynamic,1> &sdiag)
{
typedef typename Matrix<Scalar,Rows,Cols>::Index Index;
/* Local variables */
Index i, j, k, l;
Index i, j, k;
Scalar temp;
Index n = s.cols();
Matrix<Scalar,Dynamic,1> 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();