diff options
-rw-r--r-- | test/array.cpp | 4 | ||||
-rw-r--r-- | test/bandmatrix.cpp | 12 | ||||
-rw-r--r-- | test/block.cpp | 12 | ||||
-rw-r--r-- | test/householder.cpp | 4 | ||||
-rw-r--r-- | test/redux.cpp | 10 | ||||
-rw-r--r-- | test/schur_real.cpp | 4 |
6 files changed, 24 insertions, 22 deletions
diff --git a/test/array.cpp b/test/array.cpp index aea8d20b9..71bd1268a 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -87,8 +87,8 @@ template<typename ArrayType> void comparisons(const ArrayType& m) Index rows = m.rows(); Index cols = m.cols(); - int r = ei_random<int>(0, rows-1), - c = ei_random<int>(0, cols-1); + Index r = ei_random<Index>(0, rows-1), + c = ei_random<Index>(0, cols-1); ArrayType m1 = ArrayType::Random(rows, cols), m2 = ArrayType::Random(rows, cols), diff --git a/test/bandmatrix.cpp b/test/bandmatrix.cpp index 2745e527b..49faa870d 100644 --- a/test/bandmatrix.cpp +++ b/test/bandmatrix.cpp @@ -62,8 +62,8 @@ template<typename MatrixType> void bandmatrix(const MatrixType& _m) dm1.col(i).setConstant(static_cast<RealScalar>(i+1)); } Index d = std::min(rows,cols); - Index a = std::max(0,cols-d-supers); - Index b = std::max(0,rows-d-subs); + Index a = std::max<Index>(0,cols-d-supers); + Index b = std::max<Index>(0,rows-d-subs); if(a>0) dm1.block(0,d+supers,rows,a).setZero(); dm1.block(0,supers+1,cols-supers-1-a,cols-supers-1-a).template triangularView<Upper>().setZero(); dm1.block(subs+1,0,rows-subs-1-b,rows-subs-1-b).template triangularView<Lower>().setZero(); @@ -78,10 +78,10 @@ void test_bandmatrix() typedef BandMatrix<float>::Index Index; for(int i = 0; i < 10*g_repeat ; i++) { - Index rows = ei_random<int(1,10); - Index cols = ei_random<int>(1,10); - Index sups = ei_random<int>(0,cols-1); - Index subs = ei_random<int>(0,rows-1); + Index rows = ei_random<Index>(1,10); + Index cols = ei_random<Index>(1,10); + Index sups = ei_random<Index>(0,cols-1); + Index subs = ei_random<Index>(0,rows-1); CALL_SUBTEST(bandmatrix(BandMatrix<float>(rows,cols,sups,subs)) ); } } diff --git a/test/block.cpp b/test/block.cpp index fcfa5191b..c21ce29ca 100644 --- a/test/block.cpp +++ b/test/block.cpp @@ -50,10 +50,10 @@ template<typename MatrixType> void block(const MatrixType& m) Scalar s1 = ei_random<Scalar>(); - int r1 = ei_random<int>(0,rows-1); - int r2 = ei_random<int>(r1,rows-1); - int c1 = ei_random<int>(0,cols-1); - int c2 = ei_random<int>(c1,cols-1); + Index r1 = ei_random<Index>(0,rows-1); + Index r2 = ei_random<Index>(r1,rows-1); + Index c1 = ei_random<Index>(0,cols-1); + Index c2 = ei_random<Index>(c1,cols-1); //check row() and col() VERIFY_IS_EQUAL(m1.col(c1).transpose(), m1.transpose().row(c1)); @@ -95,12 +95,12 @@ template<typename MatrixType> void block(const MatrixType& m) VERIFY_IS_EQUAL(v1.template head<2>(), v1.head(2)); VERIFY_IS_EQUAL(v1.template head<2>(), v1.segment(0,2)); VERIFY_IS_EQUAL(v1.template head<2>(), v1.template segment<2>(0)); - int i = rows-2; + Index i = rows-2; VERIFY_IS_EQUAL(v1.template tail<2>(), v1.block(i,0,2,1)); VERIFY_IS_EQUAL(v1.template tail<2>(), v1.tail(2)); VERIFY_IS_EQUAL(v1.template tail<2>(), v1.segment(i,2)); VERIFY_IS_EQUAL(v1.template tail<2>(), v1.template segment<2>(i)); - i = ei_random(0,rows-2); + i = ei_random<Index>(0,rows-2); VERIFY_IS_EQUAL(v1.segment(i,2), v1.template segment<2>(i)); } diff --git a/test/householder.cpp b/test/householder.cpp index 94ea5c602..1f22c6c53 100644 --- a/test/householder.cpp +++ b/test/householder.cpp @@ -94,8 +94,8 @@ template<typename MatrixType> void householder(const MatrixType& m) // test householder sequence on the left with a shift - int shift = ei_random(0, std::max(rows-2,0)); - int brows = rows - shift; + Index shift = ei_random<Index>(0, std::max<Index>(rows-2,0)); + Index brows = rows - shift; m1.setRandom(rows, cols); HBlockMatrixType hbm = m1.block(shift,0,brows,cols); HouseholderQR<HBlockMatrixType> qr(hbm); diff --git a/test/redux.cpp b/test/redux.cpp index 2dfe8cb4b..385174831 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -54,11 +54,11 @@ template<typename MatrixType> void matrixRedux(const MatrixType& m) VERIFY_IS_APPROX(m1.real().minCoeff(), ei_real(minc)); VERIFY_IS_APPROX(m1.real().maxCoeff(), ei_real(maxc)); - // test sclice vectorization assuming assign is ok - int r0 = ei_random<int>(0,rows-1); - int c0 = ei_random<int>(0,cols-1); - int r1 = ei_random<int>(r0+1,rows)-r0; - int c1 = ei_random<int>(c0+1,cols)-c0; + // test slice vectorization assuming assign is ok + Index r0 = ei_random<Index>(0,rows-1); + Index c0 = ei_random<Index>(0,cols-1); + Index r1 = ei_random<Index>(r0+1,rows)-r0; + Index c1 = ei_random<Index>(c0+1,cols)-c0; VERIFY_IS_APPROX(m1.block(r0,c0,r1,c1).sum(), m1.block(r0,c0,r1,c1).eval().sum()); VERIFY_IS_APPROX(m1.block(r0,c0,r1,c1).mean(), m1.block(r0,c0,r1,c1).eval().mean()); VERIFY_IS_APPROX(m1.block(r0,c0,r1,c1).prod(), m1.block(r0,c0,r1,c1).eval().prod()); diff --git a/test/schur_real.cpp b/test/schur_real.cpp index 2eae52956..ab1dd1b85 100644 --- a/test/schur_real.cpp +++ b/test/schur_real.cpp @@ -28,7 +28,9 @@ template<typename MatrixType> void verifyIsQuasiTriangular(const MatrixType& T) { - const int size = T.cols(); + typedef typename MatrixType::Index Index; + + const Index size = T.cols(); typedef typename MatrixType::Scalar Scalar; // Check T is lower Hessenberg |