From 546b802b77817dd7f5cd3b6781ce1a1ac0f728b5 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Sun, 20 Jun 2010 20:16:45 +0200 Subject: [PATCH] Still fixing warnings. --- test/main.h | 5 +++-- test/product.h | 6 +++--- test/product_notemporary.cpp | 8 ++++---- test/qr_fullpivoting.cpp | 4 ++-- test/redux.cpp | 3 ++- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/test/main.h b/test/main.h index 0f63a2435..426dbcc1f 100644 --- a/test/main.h +++ b/test/main.h @@ -385,8 +385,9 @@ bool test_is_equal(const T& actual, const U& expected) * This is very useful to test rank-revealing algorithms. */ template -void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typename MatrixType::Index rows, int cols, MatrixType& m) +void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typename MatrixType::Index rows, typename MatrixType::Index cols, MatrixType& m) { + typedef typename ei_traits::Index Index; typedef typename ei_traits::Scalar Scalar; enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime }; @@ -412,7 +413,7 @@ void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typenam MatrixBType b = MatrixBType::Random(cols,cols); // set the diagonal such that only desired_rank non-zero entries reamain - const int diag_size = std::min(d.rows(),d.cols()); + const Index diag_size = std::min(d.rows(),d.cols()); if(diag_size != desired_rank) d.diagonal().segment(desired_rank, diag_size-desired_rank) = VectorType::Zero(diag_size-desired_rank); diff --git a/test/product.h b/test/product.h index d004a4ec4..5365a7dc6 100644 --- a/test/product.h +++ b/test/product.h @@ -71,9 +71,9 @@ template void product(const MatrixType& m) Scalar s1 = ei_random(); - int r = ei_random(0, rows-1), - c = ei_random(0, cols-1), - c2 = ei_random(0, cols-1); + Index r = ei_random(0, rows-1), + c = ei_random(0, cols-1), + c2 = ei_random(0, cols-1); // begin testing Product.h: only associativity for now // (we use Transpose.h but this doesn't count as a test for it) diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp index 84d73ff47..ef1dfdc48 100644 --- a/test/product_notemporary.cpp +++ b/test/product_notemporary.cpp @@ -60,10 +60,10 @@ template void product_notemporary(const MatrixType& m) s2 = ei_random(), s3 = ei_random(); - int c0 = ei_random(4,cols-8), - c1 = ei_random(8,cols-c0), - r0 = ei_random(4,cols-8), - r1 = ei_random(8,rows-r0); + Index c0 = ei_random(4,cols-8), + c1 = ei_random(8,cols-c0), + r0 = ei_random(4,cols-8), + r1 = ei_random(8,rows-r0); VERIFY_EVALUATION_COUNT( m3 = (m1 * m2.adjoint()), 1); VERIFY_EVALUATION_COUNT( m3.noalias() = m1 * m2.adjoint(), 0); diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index 6f7831c33..490da0d29 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -30,8 +30,8 @@ template void qr() { typedef typename MatrixType::Index Index; - Index rows = ei_random(20,200), cols = ei_random(20,200), cols2 = ei_random(20,200); - Index rank = ei_random(1, std::min(rows, cols)-1); + Index rows = ei_random(20,200), cols = ei_random(20,200), cols2 = ei_random(20,200); + Index rank = ei_random(1, std::min(rows, cols)-1); typedef typename MatrixType::Scalar Scalar; typedef Matrix MatrixQType; diff --git a/test/redux.cpp b/test/redux.cpp index 385174831..bcc435d0e 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -68,9 +68,10 @@ template void matrixRedux(const MatrixType& m) template void vectorRedux(const VectorType& w) { + typedef typename VectorType::Index Index; typedef typename VectorType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; - int size = w.size(); + Index size = w.size(); VectorType v = VectorType::Random(size); for(int i = 1; i < size; i++)