From f1679c7185471289afaf702a45e336849d20a81a Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Sun, 20 Jun 2010 17:37:56 +0200 Subject: Utilize Index in all unit tests. --- test/bandmatrix.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'test/bandmatrix.cpp') diff --git a/test/bandmatrix.cpp b/test/bandmatrix.cpp index dc54812b9..2745e527b 100644 --- a/test/bandmatrix.cpp +++ b/test/bandmatrix.cpp @@ -26,14 +26,15 @@ template void bandmatrix(const MatrixType& _m) { + typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef Matrix DenseMatrixType; - int rows = _m.rows(); - int cols = _m.cols(); - int supers = _m.supers(); - int subs = _m.subs(); + Index rows = _m.rows(); + Index cols = _m.cols(); + Index supers = _m.supers(); + Index subs = _m.subs(); MatrixType m(rows,cols,supers,subs); @@ -60,9 +61,9 @@ template void bandmatrix(const MatrixType& _m) m.col(i).setConstant(static_cast(i+1)); dm1.col(i).setConstant(static_cast(i+1)); } - int d = std::min(rows,cols); - int a = std::max(0,cols-d-supers); - int b = std::max(0,rows-d-subs); + Index d = std::min(rows,cols); + Index a = std::max(0,cols-d-supers); + Index b = std::max(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().setZero(); dm1.block(subs+1,0,rows-subs-1-b,rows-subs-1-b).template triangularView().setZero(); @@ -74,11 +75,13 @@ template void bandmatrix(const MatrixType& _m) void test_bandmatrix() { + typedef BandMatrix::Index Index; + for(int i = 0; i < 10*g_repeat ; i++) { - int rows = ei_random(1,10); - int cols = ei_random(1,10); - int sups = ei_random(0,cols-1); - int subs = ei_random(0,rows-1); + Index rows = ei_random(1,10); + Index sups = ei_random(0,cols-1); + Index subs = ei_random(0,rows-1); CALL_SUBTEST(bandmatrix(BandMatrix(rows,cols,sups,subs)) ); } } -- cgit v1.2.3