From e402d34407226d9c2c5dfc14ef5d6dbf53ee3c8e Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Sun, 20 Jun 2010 15:52:34 +0200 Subject: [PATCH] More Index realted warnings. --- Eigen/src/Core/PermutationMatrix.h | 2 +- test/stdvector_overload.cpp | 4 ++-- test/svd.cpp | 4 ++-- test/swap.cpp | 4 ++-- test/triangular.cpp | 4 ++-- unsupported/Eigen/src/NumericalDiff/NumericalDiff.h | 2 +- unsupported/test/NonLinearOptimization.cpp | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h index 8227c9bf9..42832265d 100644 --- a/Eigen/src/Core/PermutationMatrix.h +++ b/Eigen/src/Core/PermutationMatrix.h @@ -192,7 +192,7 @@ class PermutationMatrix : public EigenBase void check_stdvector_matrix(const MatrixType& m) { - int rows = m.rows(); - int cols = m.cols(); + typename MatrixType::Index rows = m.rows(); + typename MatrixType::Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); std::vector v(10, MatrixType(rows,cols)), w(20, y); v[5] = x; diff --git a/test/svd.cpp b/test/svd.cpp index 9f3072d3b..fbeba795b 100644 --- a/test/svd.cpp +++ b/test/svd.cpp @@ -31,8 +31,8 @@ template void svd(const MatrixType& m) /* this test covers the following files: SVD.h */ - int rows = m.rows(); - int cols = m.cols(); + typename MatrixType::Index rows = m.rows(); + typename MatrixType::Index cols = m.cols(); typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; diff --git a/test/swap.cpp b/test/swap.cpp index c11f0fec0..74543a662 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -43,8 +43,8 @@ template void swap(const MatrixType& m) typedef typename MatrixType::Scalar Scalar; ei_assert((!ei_is_same_type::ret)); - int rows = m.rows(); - int cols = m.cols(); + typename MatrixType::Index rows = m.rows(); + typename MatrixType::Index cols = m.cols(); // construct 3 matrix guaranteed to be distinct MatrixType m1 = MatrixType::Random(rows,cols); diff --git a/test/triangular.cpp b/test/triangular.cpp index 302984eb7..673a3d25f 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -34,8 +34,8 @@ template void triangular_square(const MatrixType& m) RealScalar largerEps = 10*test_precision(); - int rows = m.rows(); - int cols = m.cols(); + typename MatrixType::Index rows = m.rows(); + typename MatrixType::Index cols = m.cols(); MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), diff --git a/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h b/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h index a25c9cd6d..e840dd461 100644 --- a/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h +++ b/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h @@ -79,7 +79,7 @@ public: /* Local variables */ Scalar h; int nfev=0; - const int n = _x.size(); + const typename InputType::Index n = _x.size(); const Scalar eps = ei_sqrt((std::max(epsfcn,NumTraits::epsilon() ))); ValueType val1, val2; InputType x = _x; diff --git a/unsupported/test/NonLinearOptimization.cpp b/unsupported/test/NonLinearOptimization.cpp index cb70f2a74..851c534f6 100644 --- a/unsupported/test/NonLinearOptimization.cpp +++ b/unsupported/test/NonLinearOptimization.cpp @@ -447,7 +447,7 @@ struct lmstr_functor : Functor } return 0; } - int df(const VectorXd &x, VectorXd &jac_row, int rownb) + int df(const VectorXd &x, VectorXd &jac_row, VectorXd::Index rownb) { assert(x.size()==3); assert(jac_row.size()==x.size());