aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/determinant.cpp
diff options
context:
space:
mode:
authorGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-06-21 11:36:00 +0200
committerGravatar Hauke Heibel <hauke.heibel@gmail.com>2010-06-21 11:36:00 +0200
commitdc6ad5e25b786ec6874158b33a77babf14d66941 (patch)
treef3ce86b00aa70851d35e7ac04e0f1209f9cfa55c /test/determinant.cpp
parent5f65a89f49a6b9426b09d9b3ce7c31cf015c1879 (diff)
More Index related stuff.
Diffstat (limited to 'test/determinant.cpp')
-rw-r--r--test/determinant.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/determinant.cpp b/test/determinant.cpp
index 7aa9a870d..0e8f98988 100644
--- a/test/determinant.cpp
+++ b/test/determinant.cpp
@@ -31,7 +31,8 @@ template<typename MatrixType> void determinant(const MatrixType& m)
/* this test covers the following files:
Determinant.h
*/
- int size = m.rows();
+ typedef typename MatrixType::Index Index;
+ Index size = m.rows();
MatrixType m1(size, size), m2(size, size);
m1.setRandom();
@@ -41,10 +42,10 @@ template<typename MatrixType> void determinant(const MatrixType& m)
VERIFY_IS_APPROX(MatrixType::Identity(size, size).determinant(), Scalar(1));
VERIFY_IS_APPROX((m1*m2).eval().determinant(), m1.determinant() * m2.determinant());
if(size==1) return;
- int i = ei_random<int>(0, size-1);
- int j;
+ Index i = ei_random<Index>(0, size-1);
+ Index j;
do {
- j = ei_random<int>(0, size-1);
+ j = ei_random<Index>(0, size-1);
} while(j==i);
m2 = m1;
m2.row(i).swap(m2.row(j));