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 { namespace internal {
template <typename Scalar,int Rows, int Cols, typename Index> template <typename Scalar,int Rows, int Cols, typename PermIndex>
void lmqrsolv( void lmqrsolv(
Matrix<Scalar,Rows,Cols> &s, 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> &diag,
const Matrix<Scalar,Dynamic,1> &qtb, const Matrix<Scalar,Dynamic,1> &qtb,
Matrix<Scalar,Dynamic,1> &x, Matrix<Scalar,Dynamic,1> &x,
Matrix<Scalar,Dynamic,1> &sdiag) Matrix<Scalar,Dynamic,1> &sdiag)
{ {
typedef typename Matrix<Scalar,Rows,Cols>::Index Index;
/* Local variables */ /* Local variables */
Index i, j, k, l; Index i, j, k;
Scalar temp; Scalar temp;
Index n = s.cols(); Index n = s.cols();
Matrix<Scalar,Dynamic,1> wa(n); Matrix<Scalar,Dynamic,1> wa(n);
@ -52,7 +53,7 @@ void lmqrsolv(
/* prepare the row of d to be eliminated, locating the */ /* prepare the row of d to be eliminated, locating the */
/* diagonal element using p from the qr factorization. */ /* diagonal element using p from the qr factorization. */
l = iPerm.indices()(j); const PermIndex l = iPerm.indices()(j);
if (diag[l] == 0.) if (diag[l] == 0.)
break; break;
sdiag.tail(n-j).setZero(); sdiag.tail(n-j).setZero();