aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--test/adjoint.cpp11
-rw-r--r--test/array.cpp15
-rw-r--r--test/array_for_matrix.cpp14
-rw-r--r--test/array_replicate.cpp6
-rw-r--r--test/array_reverse.cpp5
-rw-r--r--test/bandmatrix.cpp25
-rw-r--r--test/basicstuff.cpp10
-rw-r--r--test/block.cpp35
-rw-r--r--test/cholesky.cpp5
-rw-r--r--test/conservative_resize.cpp9
-rw-r--r--test/corners.cpp9
-rw-r--r--test/cwiseop.cpp5
-rw-r--r--test/diagonal.cpp6
-rw-r--r--test/diagonalmatrices.cpp5
-rw-r--r--test/eigen2support.cpp5
-rw-r--r--test/eigensolver_complex.cpp5
-rw-r--r--test/eigensolver_generic.cpp5
-rw-r--r--test/eigensolver_selfadjoint.cpp5
-rw-r--r--test/householder.cpp5
-rw-r--r--test/integer_types.cpp10
-rw-r--r--test/inverse.cpp5
-rw-r--r--test/jacobisvd.cpp5
-rw-r--r--test/linearstructure.cpp6
-rw-r--r--test/lu.cpp14
-rw-r--r--test/main.h2
-rw-r--r--test/map.cpp3
-rw-r--r--test/mapstride.cpp3
-rw-r--r--test/miscmatrices.cpp8
-rw-r--r--test/nomalloc.cpp10
-rw-r--r--test/nullary.cpp5
-rw-r--r--test/permutationmatrices.cpp5
-rw-r--r--test/product.h6
-rw-r--r--test/product_extra.cpp5
-rw-r--r--test/product_notemporary.cpp6
-rw-r--r--test/product_selfadjoint.cpp5
-rw-r--r--test/product_symm.cpp5
-rw-r--r--test/product_syrk.cpp5
-rw-r--r--test/product_trmm.cpp4
-rw-r--r--test/product_trmv.cpp5
-rw-r--r--test/qr.cpp6
-rw-r--r--test/qr_colpivoting.cpp6
-rw-r--r--test/qr_fullpivoting.cpp6
-rw-r--r--test/qtvector.cpp6
-rw-r--r--test/redux.cpp5
-rw-r--r--test/resize.cpp2
-rw-r--r--test/selfadjoint.cpp5
-rw-r--r--test/sparse_basic.cpp6
-rw-r--r--test/sparse_product.cpp5
-rw-r--r--test/stable_norm.cpp6
-rw-r--r--test/stdlist.cpp6
-rw-r--r--test/stdvector.cpp4
-rw-r--r--unsupported/Eigen/AlignedVector312
-rw-r--r--unsupported/Eigen/src/SparseExtra/UmfPackSupport.h5
-rw-r--r--unsupported/test/sparse_extra.cpp5
54 files changed, 223 insertions, 164 deletions
diff --git a/test/adjoint.cpp b/test/adjoint.cpp
index fc6c8897b..2cf9ef380 100644
--- a/test/adjoint.cpp
+++ b/test/adjoint.cpp
@@ -31,13 +31,14 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
/* this test covers the following files:
Transpose.h Conjugate.h Dot.h
*/
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
- int rows = m.rows();
- int cols = m.cols();
+
+ Index rows = m.rows();
+ Index cols = m.cols();
RealScalar largerEps = test_precision<RealScalar>();
if (ei_is_same_type<RealScalar,float>::ret)
@@ -79,8 +80,8 @@ template<typename MatrixType> void adjoint(const MatrixType& m)
VERIFY(ei_isApprox(v1.dot(square * v2), (square.adjoint() * v1).dot(v2), largerEps));
// like in testBasicStuff, test operator() to check const-qualification
- 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);
VERIFY_IS_APPROX(m1.conjugate()(r,c), ei_conj(m1(r,c)));
VERIFY_IS_APPROX(m1.adjoint()(c,r), ei_conj(m1(r,c)));
diff --git a/test/array.cpp b/test/array.cpp
index 7f44b7d5d..aea8d20b9 100644
--- a/test/array.cpp
+++ b/test/array.cpp
@@ -26,13 +26,14 @@
template<typename ArrayType> void array(const ArrayType& m)
{
+ typedef typename ArrayType::Index Index;
typedef typename ArrayType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Array<Scalar, ArrayType::RowsAtCompileTime, 1> ColVectorType;
typedef Array<Scalar, 1, ArrayType::ColsAtCompileTime> RowVectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
ArrayType m1 = ArrayType::Random(rows, cols),
m2 = ArrayType::Random(rows, cols),
@@ -78,12 +79,13 @@ template<typename ArrayType> void array(const ArrayType& m)
template<typename ArrayType> void comparisons(const ArrayType& m)
{
+ typedef typename ArrayType::Index Index;
typedef typename ArrayType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Array<Scalar, ArrayType::RowsAtCompileTime, 1> VectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
int r = ei_random<int>(0, rows-1),
c = ei_random<int>(0, cols-1);
@@ -137,11 +139,12 @@ template<typename ArrayType> void comparisons(const ArrayType& m)
template<typename ArrayType> void array_real(const ArrayType& m)
{
+ typedef typename ArrayType::Index Index;
typedef typename ArrayType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
ArrayType m1 = ArrayType::Random(rows, cols),
m2 = ArrayType::Random(rows, cols),
diff --git a/test/array_for_matrix.cpp b/test/array_for_matrix.cpp
index 5d0b9bbbd..86637aa86 100644
--- a/test/array_for_matrix.cpp
+++ b/test/array_for_matrix.cpp
@@ -26,13 +26,14 @@
template<typename MatrixType> void array_for_matrix(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> ColVectorType;
typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
@@ -75,15 +76,16 @@ template<typename MatrixType> void array_for_matrix(const MatrixType& m)
template<typename MatrixType> void comparisons(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
- int rows = m.rows();
- int cols = m.cols();
+ 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);
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
diff --git a/test/array_replicate.cpp b/test/array_replicate.cpp
index 8c4845d3c..0a4c04262 100644
--- a/test/array_replicate.cpp
+++ b/test/array_replicate.cpp
@@ -29,15 +29,15 @@ template<typename MatrixType> void replicate(const MatrixType& m)
/* this test covers the following files:
Replicate.cpp
*/
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
typedef Matrix<Scalar, Dynamic, 1> VectorX;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols);
diff --git a/test/array_reverse.cpp b/test/array_reverse.cpp
index 3933ff523..144a0b088 100644
--- a/test/array_reverse.cpp
+++ b/test/array_reverse.cpp
@@ -30,11 +30,12 @@ using namespace std;
template<typename MatrixType> void reverse(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
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<typename MatrixType> void bandmatrix(const MatrixType& _m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar,Dynamic,Dynamic> 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<typename MatrixType> void bandmatrix(const MatrixType& _m)
m.col(i).setConstant(static_cast<RealScalar>(i+1));
dm1.col(i).setConstant(static_cast<RealScalar>(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<Upper>().setZero();
dm1.block(subs+1,0,rows-subs-1-b,rows-subs-1-b).template triangularView<Lower>().setZero();
@@ -74,11 +75,13 @@ template<typename MatrixType> void bandmatrix(const MatrixType& _m)
void test_bandmatrix()
{
+ typedef BandMatrix<float>::Index Index;
+
for(int i = 0; i < 10*g_repeat ; i++) {
- int rows = ei_random<int>(1,10);
- int cols = ei_random<int>(1,10);
- int sups = ei_random<int>(0,cols-1);
- int subs = ei_random<int>(0,rows-1);
+ 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);
CALL_SUBTEST(bandmatrix(BandMatrix<float>(rows,cols,sups,subs)) );
}
}
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index ddddb5985..e1afc0ecc 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -28,11 +28,12 @@
template<typename MatrixType> void basicStuff(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
@@ -124,12 +125,13 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
template<typename MatrixType> void basicStuffComplex(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<RealScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime> RealMatrixType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
Scalar s1 = ei_random<Scalar>(),
s2 = ei_random<Scalar>();
diff --git a/test/block.cpp b/test/block.cpp
index a6bf47058..fcfa5191b 100644
--- a/test/block.cpp
+++ b/test/block.cpp
@@ -27,6 +27,7 @@
template<typename MatrixType> void block(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
@@ -34,8 +35,8 @@ template<typename MatrixType> void block(const MatrixType& m)
typedef Matrix<Scalar, Dynamic, Dynamic> DynamicMatrixType;
typedef Matrix<Scalar, Dynamic, 1> DynamicVectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
@@ -158,13 +159,14 @@ template<typename MatrixType> void block(const MatrixType& m)
template<typename MatrixType>
void compare_using_data_and_stride(const MatrixType& m)
{
- int rows = m.rows();
- int cols = m.cols();
- int size = m.size();
- int innerStride = m.innerStride();
- int outerStride = m.outerStride();
- int rowStride = m.rowStride();
- int colStride = m.colStride();
+ typedef MatrixType::Index Index;
+ Index rows = m.rows();
+ Index cols = m.cols();
+ Index size = m.size();
+ Index innerStride = m.innerStride();
+ Index outerStride = m.outerStride();
+ Index rowStride = m.rowStride();
+ Index colStride = m.colStride();
const typename MatrixType::Scalar* data = m.data();
for(int j=0;j<cols;++j)
@@ -191,13 +193,14 @@ void compare_using_data_and_stride(const MatrixType& m)
template<typename MatrixType>
void data_and_stride(const MatrixType& m)
{
- int rows = m.rows();
- int cols = m.cols();
-
- 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);
+ typedef typename MatrixType::Index Index;
+ Index rows = m.rows();
+ Index cols = m.cols();
+
+ 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);
MatrixType m1 = MatrixType::Random(rows, cols);
compare_using_data_and_stride(m1.block(r1, c1, r2-r1+1, c2-c1+1));
diff --git a/test/cholesky.cpp b/test/cholesky.cpp
index 54ff94f32..a178b82b6 100644
--- a/test/cholesky.cpp
+++ b/test/cholesky.cpp
@@ -47,11 +47,12 @@ static int nb_temporaries;
template<typename MatrixType> void cholesky(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
/* this test covers the following files:
LLT.h LDLT.h
*/
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp
index 825f23b37..f0aff37b9 100644
--- a/test/conservative_resize.cpp
+++ b/test/conservative_resize.cpp
@@ -32,6 +32,7 @@ template <typename Scalar, int Storage>
void run_matrix_tests()
{
typedef Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Storage> MatrixType;
+ typedef MatrixType::Index Index;
MatrixType m, n;
@@ -51,8 +52,8 @@ void run_matrix_tests()
// random shrinking ...
for (int i=0; i<25; ++i)
{
- const int rows = ei_random<int>(1,50);
- const int cols = ei_random<int>(1,50);
+ const Index rows = ei_random<Index>(1,50);
+ const Index cols = ei_random<Index>(1,50);
m = n = MatrixType::Random(50,50);
m.conservativeResize(rows,cols);
VERIFY_IS_APPROX(m, n.block(0,0,rows,cols));
@@ -61,8 +62,8 @@ void run_matrix_tests()
// random growing with zeroing ...
for (int i=0; i<25; ++i)
{
- const int rows = ei_random<int>(50,75);
- const int cols = ei_random<int>(50,75);
+ const Index rows = ei_random<Index>(50,75);
+ const Index cols = ei_random<Index>(50,75);
m = n = MatrixType::Random(50,50);
m.conservativeResizeLike(MatrixType::Zero(rows,cols));
VERIFY_IS_APPROX(m.block(0,0,n.rows(),n.cols()), n);
diff --git a/test/corners.cpp b/test/corners.cpp
index 3baea1b96..70d12fded 100644
--- a/test/corners.cpp
+++ b/test/corners.cpp
@@ -30,11 +30,12 @@
template<typename MatrixType> void corners(const MatrixType& m)
{
- int rows = m.rows();
- int cols = m.cols();
+ typedef typename MatrixType::Index Index;
+ Index rows = m.rows();
+ Index cols = m.cols();
- int r = ei_random<int>(1,rows);
- int c = ei_random<int>(1,cols);
+ Index r = ei_random<Index>(1,rows);
+ Index c = ei_random<Index>(1,cols);
MatrixType matrix = MatrixType::Random(rows,cols);
const MatrixType const_matrix = MatrixType::Random(rows,cols);
diff --git a/test/cwiseop.cpp b/test/cwiseop.cpp
index 8193c6e54..ee7c8d2c4 100644
--- a/test/cwiseop.cpp
+++ b/test/cwiseop.cpp
@@ -37,12 +37,13 @@ template<typename Scalar> struct AddIfNull {
template<typename MatrixType> void cwiseops(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
diff --git a/test/diagonal.cpp b/test/diagonal.cpp
index 288d58c6e..50b341dfe 100644
--- a/test/diagonal.cpp
+++ b/test/diagonal.cpp
@@ -26,12 +26,14 @@
template<typename MatrixType> void diagonal(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
- int rows = m.rows();
- int cols = m.cols();
+
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols);
diff --git a/test/diagonalmatrices.cpp b/test/diagonalmatrices.cpp
index c24c66d03..2bc75ba1c 100644
--- a/test/diagonalmatrices.cpp
+++ b/test/diagonalmatrices.cpp
@@ -26,6 +26,7 @@
using namespace std;
template<typename MatrixType> void diagonalmatrices(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
@@ -35,8 +36,8 @@ template<typename MatrixType> void diagonalmatrices(const MatrixType& m)
typedef DiagonalMatrix<Scalar, Rows> LeftDiagonalMatrix;
typedef DiagonalMatrix<Scalar, Cols> RightDiagonalMatrix;
typedef Matrix<Scalar, Rows==Dynamic?Dynamic:2*Rows, Cols==Dynamic?Dynamic:2*Cols> BigMatrix;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols);
diff --git a/test/eigen2support.cpp b/test/eigen2support.cpp
index a18e7ed8a..274014c1c 100644
--- a/test/eigen2support.cpp
+++ b/test/eigen2support.cpp
@@ -28,10 +28,11 @@
template<typename MatrixType> void eigen2support(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
diff --git a/test/eigensolver_complex.cpp b/test/eigensolver_complex.cpp
index 1c1dd98f3..abb1f1110 100644
--- a/test/eigensolver_complex.cpp
+++ b/test/eigensolver_complex.cpp
@@ -47,11 +47,12 @@ void verify_is_approx_upto_permutation(const VectorType& vec1, const VectorType&
template<typename MatrixType> void eigensolver(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
/* this test covers the following files:
ComplexEigenSolver.h, and indirectly ComplexSchur.h
*/
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
diff --git a/test/eigensolver_generic.cpp b/test/eigensolver_generic.cpp
index 92741a35c..b261b7be7 100644
--- a/test/eigensolver_generic.cpp
+++ b/test/eigensolver_generic.cpp
@@ -33,11 +33,12 @@
template<typename MatrixType> void eigensolver(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
/* this test covers the following files:
EigenSolver.h
*/
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp
index e8da32d22..2d7ac67ca 100644
--- a/test/eigensolver_selfadjoint.cpp
+++ b/test/eigensolver_selfadjoint.cpp
@@ -33,11 +33,12 @@
template<typename MatrixType> void selfadjointeigensolver(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
/* this test covers the following files:
EigenSolver.h, SelfAdjointEigenSolver.h (and indirectly: Tridiagonalization.h)
*/
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
diff --git a/test/householder.cpp b/test/householder.cpp
index 310eb8c33..94ea5c602 100644
--- a/test/householder.cpp
+++ b/test/householder.cpp
@@ -27,13 +27,14 @@
template<typename MatrixType> void householder(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
static bool even = true;
even = !even;
/* this test covers the following files:
Householder.h
*/
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
diff --git a/test/integer_types.cpp b/test/integer_types.cpp
index d2feb8a65..abed4a6ac 100644
--- a/test/integer_types.cpp
+++ b/test/integer_types.cpp
@@ -33,13 +33,14 @@
template<typename MatrixType> void signed_integer_type_tests(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
enum { is_signed = (Scalar(-1) > Scalar(0)) ? 0 : 1 };
VERIFY(is_signed == 1);
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1(rows, cols),
m2 = MatrixType::Random(rows, cols),
@@ -63,6 +64,7 @@ template<typename MatrixType> void signed_integer_type_tests(const MatrixType& m
template<typename MatrixType> void integer_type_tests(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
VERIFY(NumTraits<Scalar>::IsInteger);
@@ -71,8 +73,8 @@ template<typename MatrixType> void integer_type_tests(const MatrixType& m)
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
diff --git a/test/inverse.cpp b/test/inverse.cpp
index 108ce7bcb..f050980ff 100644
--- a/test/inverse.cpp
+++ b/test/inverse.cpp
@@ -28,11 +28,12 @@
template<typename MatrixType> void inverse(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
/* this test covers the following files:
Inverse.h
*/
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
diff --git a/test/jacobisvd.cpp b/test/jacobisvd.cpp
index bc9d93754..401682e64 100644
--- a/test/jacobisvd.cpp
+++ b/test/jacobisvd.cpp
@@ -29,8 +29,9 @@
template<typename MatrixType, unsigned int Options> void svd(const MatrixType& m = MatrixType(), bool pickrandom = true)
{
- int rows = m.rows();
- int cols = m.cols();
+ typedef typename MatrixType::Index Index;
+ Index rows = m.rows();
+ Index cols = m.cols();
enum {
RowsAtCompileTime = MatrixType::RowsAtCompileTime,
diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp
index 53001652c..1d86af337 100644
--- a/test/linearstructure.cpp
+++ b/test/linearstructure.cpp
@@ -29,11 +29,11 @@ template<typename MatrixType> void linearStructure(const MatrixType& m)
/* this test covers the following files:
Sum.h Difference.h Opposite.h ScalarMultiple.h
*/
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
diff --git a/test/lu.cpp b/test/lu.cpp
index 9aa793e00..8cb3cbbee 100644
--- a/test/lu.cpp
+++ b/test/lu.cpp
@@ -28,15 +28,16 @@ using namespace std;
template<typename MatrixType> void lu_non_invertible()
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
/* this test covers the following files:
LU.h
*/
- int rows, cols, cols2;
+ Index rows, cols, cols2;
if(MatrixType::RowsAtCompileTime==Dynamic)
{
- rows = ei_random<int>(2,200);
+ rows = ei_random<Index>(2,200);
}
else
{
@@ -44,7 +45,7 @@ template<typename MatrixType> void lu_non_invertible()
}
if(MatrixType::ColsAtCompileTime==Dynamic)
{
- cols = ei_random<int>(2,200);
+ cols = ei_random<Index>(2,200);
cols2 = ei_random<int>(2,200);
}
else
@@ -63,7 +64,7 @@ template<typename MatrixType> void lu_non_invertible()
typedef Matrix<typename MatrixType::Scalar, RowsAtCompileTime, RowsAtCompileTime>
RMatrixType;
- int rank = ei_random<int>(1, std::min(rows, cols)-1);
+ Index rank = ei_random<Index>(1, std::min(rows, cols)-1);
// The image of the zero matrix should consist of a single (zero) column vector
VERIFY((MatrixType::Zero(rows,cols).fullPivLu().image(MatrixType::Zero(rows,cols)).cols() == 1));
@@ -145,10 +146,11 @@ template<typename MatrixType> void lu_partial_piv()
/* this test covers the following files:
PartialPivLU.h
*/
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
- int rows = ei_random<int>(1,4);
- int cols = rows;
+ Index rows = ei_random<Index>(1,4);
+ Index cols = rows;
MatrixType m1(cols, rows);
m1.setRandom();
diff --git a/test/main.h b/test/main.h
index 184a35b15..0f63a2435 100644
--- a/test/main.h
+++ b/test/main.h
@@ -385,7 +385,7 @@ bool test_is_equal(const T& actual, const U& expected)
* This is very useful to test rank-revealing algorithms.
*/
template<typename MatrixType>
-void createRandomPIMatrixOfRank(int desired_rank, int rows, int cols, MatrixType& m)
+void createRandomPIMatrixOfRank(typename MatrixType::Index desired_rank, typename MatrixType::Index rows, int cols, MatrixType& m)
{
typedef typename ei_traits<MatrixType>::Scalar Scalar;
enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
diff --git a/test/map.cpp b/test/map.cpp
index 0204e9e7d..695d62982 100644
--- a/test/map.cpp
+++ b/test/map.cpp
@@ -53,9 +53,10 @@ template<typename VectorType> void map_class_vector(const VectorType& m)
template<typename MatrixType> void map_class_matrix(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
- int rows = m.rows(), cols = m.cols(), size = rows*cols;
+ Index rows = m.rows(), cols = m.cols(), size = rows*cols;
// test Map.h
Scalar* array1 = ei_aligned_new<Scalar>(size);
diff --git a/test/mapstride.cpp b/test/mapstride.cpp
index 7a1605681..ff6e71a66 100644
--- a/test/mapstride.cpp
+++ b/test/mapstride.cpp
@@ -61,9 +61,10 @@ template<typename VectorType> void map_class_vector(const VectorType& m)
template<typename MatrixType> void map_class_matrix(const MatrixType& _m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
- int rows = _m.rows(), cols = _m.cols();
+ Index rows = _m.rows(), cols = _m.cols();
MatrixType m = MatrixType::Random(rows,cols);
diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp
index 0adccf5ce..b14bca61c 100644
--- a/test/miscmatrices.cpp
+++ b/test/miscmatrices.cpp
@@ -29,14 +29,14 @@ template<typename MatrixType> void miscMatrices(const MatrixType& m)
/* this test covers the following files:
DiagonalMatrix.h Ones.h
*/
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
- int r = ei_random<int>(0, rows-1), r2 = ei_random<int>(0, rows-1), c = ei_random<int>(0, cols-1);
+ Index r = ei_random<Index>(0, rows-1), r2 = ei_random<Index>(0, rows-1), c = ei_random<Index>(0, cols-1);
VERIFY_IS_APPROX(MatrixType::Ones(rows,cols)(r,c), static_cast<Scalar>(1));
MatrixType m1 = MatrixType::Ones(rows,cols);
VERIFY_IS_APPROX(m1(r,c), static_cast<Scalar>(1));
diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp
index 9eb8d1310..f37dcd1b2 100644
--- a/test/nomalloc.cpp
+++ b/test/nomalloc.cpp
@@ -43,12 +43,12 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
{
/* this test check no dynamic memory allocation are issued with fixed-size matrices
*/
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
@@ -64,8 +64,8 @@ template<typename MatrixType> void nomalloc(const MatrixType& m)
Scalar s1 = ei_random<Scalar>();
- 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);
VERIFY_IS_APPROX((m1+m2)*s1, s1*m1+s1*m2);
VERIFY_IS_APPROX((m1+m2)(r,c), (m1(r,c))+(m2(r,c)));
diff --git a/test/nullary.cpp b/test/nullary.cpp
index 6e91ddd52..d46349991 100644
--- a/test/nullary.cpp
+++ b/test/nullary.cpp
@@ -97,8 +97,9 @@ void testVectorType(const VectorType& base)
template<typename MatrixType>
void testMatrixType(const MatrixType& m)
{
- const int rows = m.rows();
- const int cols = m.cols();
+ typedef typename MatrixType::Index Index;
+ const Index rows = m.rows();
+ const Index cols = m.cols();
MatrixType A;
A.setIdentity(rows, cols);
diff --git a/test/permutationmatrices.cpp b/test/permutationmatrices.cpp
index 89142d910..d3cdfeca0 100644
--- a/test/permutationmatrices.cpp
+++ b/test/permutationmatrices.cpp
@@ -43,6 +43,7 @@ void randomPermutationVector(PermutationVectorType& v, int size)
using namespace std;
template<typename MatrixType> void permutationmatrices(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime,
@@ -52,8 +53,8 @@ template<typename MatrixType> void permutationmatrices(const MatrixType& m)
typedef PermutationMatrix<Cols> RightPermutationType;
typedef Matrix<int, Cols, 1> RightPermutationVectorType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m_original = MatrixType::Random(rows,cols);
LeftPermutationVectorType lv;
diff --git a/test/product.h b/test/product.h
index 71dc4bde2..d004a4ec4 100644
--- a/test/product.h
+++ b/test/product.h
@@ -37,7 +37,7 @@ template<typename MatrixType> void product(const MatrixType& m)
/* this test covers the following files:
Identity.h Product.h
*/
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::NonInteger NonInteger;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> RowVectorType;
@@ -47,8 +47,8 @@ template<typename MatrixType> void product(const MatrixType& m)
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime,
MatrixType::Flags&RowMajorBit> OtherMajorMatrixType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
// this test relies a lot on Random.h, and there's not much more that we can do
// to test it, hence I consider that we will have tested Random.h
diff --git a/test/product_extra.cpp b/test/product_extra.cpp
index 3644593f0..e53d675c3 100644
--- a/test/product_extra.cpp
+++ b/test/product_extra.cpp
@@ -26,6 +26,7 @@
template<typename MatrixType> void product_extra(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::NonInteger NonInteger;
typedef Matrix<Scalar, 1, Dynamic> RowVectorType;
@@ -33,8 +34,8 @@ template<typename MatrixType> void product_extra(const MatrixType& m)
typedef Matrix<Scalar, Dynamic, Dynamic,
MatrixType::Flags&RowMajorBit> OtherMajorMatrixType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp
index ca1140353..84d73ff47 100644
--- a/test/product_notemporary.cpp
+++ b/test/product_notemporary.cpp
@@ -39,15 +39,15 @@ template<typename MatrixType> void product_notemporary(const MatrixType& m)
{
/* This test checks the number of temporaries created
* during the evaluation of a complex expression */
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
typedef Matrix<Scalar, 1, Dynamic> RowVectorType;
typedef Matrix<Scalar, Dynamic, 1> ColVectorType;
typedef Matrix<Scalar, Dynamic, Dynamic, RowMajor> RowMajorMatrixType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp
index 2027fc8e5..10a661ef8 100644
--- a/test/product_selfadjoint.cpp
+++ b/test/product_selfadjoint.cpp
@@ -26,6 +26,7 @@
template<typename MatrixType> void product_selfadjoint(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
@@ -33,8 +34,8 @@ template<typename MatrixType> void product_selfadjoint(const MatrixType& m)
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, Dynamic, RowMajor> RhsMatrixType;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols),
diff --git a/test/product_symm.cpp b/test/product_symm.cpp
index 08e0a6070..92a3f4594 100644
--- a/test/product_symm.cpp
+++ b/test/product_symm.cpp
@@ -50,9 +50,10 @@ template<typename Scalar, int Size, int OtherSize> void symm(int size = Size, in
typedef Matrix<Scalar, OtherSize, Size> Rhs2;
enum { order = OtherSize==1 ? 0 : RowMajor };
typedef Matrix<Scalar, Size, OtherSize,order> Rhs3;
+ typedef MatrixType::Index Index;
- int rows = size;
- int cols = size;
+ Index rows = size;
+ Index cols = size;
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols), m3;
diff --git a/test/product_syrk.cpp b/test/product_syrk.cpp
index ec93056a9..18cdda152 100644
--- a/test/product_syrk.cpp
+++ b/test/product_syrk.cpp
@@ -26,14 +26,15 @@
template<typename MatrixType> void syrk(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic> Rhs1;
typedef Matrix<Scalar, Dynamic, MatrixType::RowsAtCompileTime> Rhs2;
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic,RowMajor> Rhs3;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m2 = MatrixType::Random(rows, cols);
diff --git a/test/product_trmm.cpp b/test/product_trmm.cpp
index a689deba6..382618492 100644
--- a/test/product_trmm.cpp
+++ b/test/product_trmm.cpp
@@ -31,8 +31,8 @@ template<typename Scalar> void trmm(int size,int /*othersize*/)
typedef Matrix<Scalar,Dynamic,Dynamic,ColMajor> MatrixColMaj;
typedef Matrix<Scalar,Dynamic,Dynamic,RowMajor> MatrixRowMaj;
- int rows = size;
- int cols = ei_random<int>(1,size);
+ DenseIndex rows = size;
+ DenseIndex cols = ei_random<DenseIndex>(1,size);
MatrixColMaj triV(rows,cols), triH(cols,rows), upTri(cols,rows), loTri(rows,cols),
unitUpTri(cols,rows), unitLoTri(rows,cols);
diff --git a/test/product_trmv.cpp b/test/product_trmv.cpp
index 2f5743187..19210b047 100644
--- a/test/product_trmv.cpp
+++ b/test/product_trmv.cpp
@@ -26,14 +26,15 @@
template<typename MatrixType> void trmv(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
RealScalar largerEps = 10*test_precision<RealScalar>();
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m3(rows, cols);
diff --git a/test/qr.cpp b/test/qr.cpp
index eae336e49..2218bdc13 100644
--- a/test/qr.cpp
+++ b/test/qr.cpp
@@ -27,8 +27,10 @@
template<typename MatrixType> void qr(const MatrixType& m)
{
- int rows = m.rows();
- int cols = m.cols();
+ typedef typename MatrixType::Index Index;
+
+ Index rows = m.rows();
+ Index cols = m.cols();
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> MatrixQType;
diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp
index 7064bc229..94b8efbef 100644
--- a/test/qr_colpivoting.cpp
+++ b/test/qr_colpivoting.cpp
@@ -28,8 +28,10 @@
template<typename MatrixType> void qr()
{
- int rows = ei_random<int>(2,200), cols = ei_random<int>(2,200), cols2 = ei_random<int>(2,200);
- int rank = ei_random<int>(1, std::min(rows, cols)-1);
+ typedef typename MatrixType::Index Index;
+
+ Index rows = ei_random<Index>(2,200), cols = ei_random<Index>(2,200), cols2 = ei_random<Index>(2,200);
+ Index rank = ei_random<Index>(1, std::min(rows, cols)-1);
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp
index 33350ce0e..6f7831c33 100644
--- a/test/qr_fullpivoting.cpp
+++ b/test/qr_fullpivoting.cpp
@@ -28,8 +28,10 @@
template<typename MatrixType> void qr()
{
- int rows = ei_random<int>(20,200), cols = ei_random<int>(20,200), cols2 = ei_random<int>(20,200);
- int rank = ei_random<int>(1, std::min(rows, cols)-1);
+ typedef typename MatrixType::Index Index;
+
+ Index rows = ei_random<int>(20,200), cols = ei_random<int>(20,200), cols2 = ei_random<int>(20,200);
+ Index rank = ei_random<int>(1, std::min(rows, cols)-1);
typedef typename MatrixType::Scalar Scalar;
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> MatrixQType;
diff --git a/test/qtvector.cpp b/test/qtvector.cpp
index bc780b45b..b9bb9d076 100644
--- a/test/qtvector.cpp
+++ b/test/qtvector.cpp
@@ -33,8 +33,10 @@
template<typename MatrixType>
void check_qtvector_matrix(const MatrixType& m)
{
- int rows = m.rows();
- int cols = m.cols();
+ typedef typename MatrixType::Index Index;
+
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
QVector<MatrixType> v(10, MatrixType(rows,cols)), w(20, y);
for(int i = 0; i < 20; i++)
diff --git a/test/redux.cpp b/test/redux.cpp
index 104cd4cdd..2dfe8cb4b 100644
--- a/test/redux.cpp
+++ b/test/redux.cpp
@@ -26,11 +26,12 @@
template<typename MatrixType> void matrixRedux(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename MatrixType::RealScalar RealScalar;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols);
diff --git a/test/resize.cpp b/test/resize.cpp
index dfe3bda17..48818ac46 100644
--- a/test/resize.cpp
+++ b/test/resize.cpp
@@ -24,7 +24,7 @@
#include "main.h"
-template<int rows, int cols>
+template<DenseIndex rows, DenseIndex cols>
void resizeLikeTest()
{
MatrixXf A(rows, cols);
diff --git a/test/selfadjoint.cpp b/test/selfadjoint.cpp
index 1ea5a3a3c..9e3ccb4a7 100644
--- a/test/selfadjoint.cpp
+++ b/test/selfadjoint.cpp
@@ -29,11 +29,12 @@
template<typename MatrixType> void selfadjoint(const MatrixType& m)
{
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType m1 = MatrixType::Random(rows, cols),
m3(rows, cols);
diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp
index 3d2210930..3ebd59294 100644
--- a/test/sparse_basic.cpp
+++ b/test/sparse_basic.cpp
@@ -26,8 +26,10 @@
template<typename SparseMatrixType> void sparse_basic(const SparseMatrixType& ref)
{
- const int rows = ref.rows();
- const int cols = ref.cols();
+ typedef typename SparseMatrixType::Index Index;
+
+ const Index rows = ref.rows();
+ const Index cols = ref.cols();
typedef typename SparseMatrixType::Scalar Scalar;
enum { Flags = SparseMatrixType::Flags };
diff --git a/test/sparse_product.cpp b/test/sparse_product.cpp
index 04e089784..c07735e43 100644
--- a/test/sparse_product.cpp
+++ b/test/sparse_product.cpp
@@ -26,8 +26,9 @@
template<typename SparseMatrixType> void sparse_product(const SparseMatrixType& ref)
{
- const int rows = ref.rows();
- const int cols = ref.cols();
+ typedef typename SparseMatrixType::Index Index;
+ const Index rows = ref.rows();
+ const Index cols = ref.cols();
typedef typename SparseMatrixType::Scalar Scalar;
enum { Flags = SparseMatrixType::Flags };
diff --git a/test/stable_norm.cpp b/test/stable_norm.cpp
index 77b062303..74675e930 100644
--- a/test/stable_norm.cpp
+++ b/test/stable_norm.cpp
@@ -34,7 +34,7 @@ template<typename MatrixType> void stable_norm(const MatrixType& m)
/* this test covers the following files:
StableNorm.h
*/
-
+ typedef typename MatrixType::Index Index;
typedef typename MatrixType::Scalar Scalar;
typedef typename NumTraits<Scalar>::Real RealScalar;
@@ -52,8 +52,8 @@ template<typename MatrixType> void stable_norm(const MatrixType& m)
}
- int rows = m.rows();
- int cols = m.cols();
+ Index rows = m.rows();
+ Index cols = m.cols();
Scalar big = ei_random<Scalar>() * (std::numeric_limits<RealScalar>::max() * RealScalar(1e-4));
Scalar small = static_cast<RealScalar>(1)/big;
diff --git a/test/stdlist.cpp b/test/stdlist.cpp
index 7a54d464f..a410b3eb2 100644
--- a/test/stdlist.cpp
+++ b/test/stdlist.cpp
@@ -30,8 +30,10 @@
template<typename MatrixType>
void check_stdlist_matrix(const MatrixType& m)
{
- int rows = m.rows();
- int cols = m.cols();
+ typedef typename MatrixType::Index Index;
+
+ Index rows = m.rows();
+ Index cols = m.cols();
MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols);
std::list<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType(rows,cols)), w(20, y);
v.front() = x;
diff --git a/test/stdvector.cpp b/test/stdvector.cpp
index bdca826f4..b44dadf42 100644
--- a/test/stdvector.cpp
+++ b/test/stdvector.cpp
@@ -29,8 +29,8 @@
template<typename MatrixType>
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<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType(rows,cols)), w(20, y);
v[5] = x;
diff --git a/unsupported/Eigen/AlignedVector3 b/unsupported/Eigen/AlignedVector3
index 6e9772cf5..7efe4ac21 100644
--- a/unsupported/Eigen/AlignedVector3
+++ b/unsupported/Eigen/AlignedVector3
@@ -68,19 +68,19 @@ template<typename _Scalar> class AlignedVector3
EIGEN_DENSE_PUBLIC_INTERFACE(AlignedVector3)
using Base::operator*;
- inline int rows() const { return 3; }
- inline int cols() const { return 1; }
+ inline Index rows() const { return 3; }
+ inline Index cols() const { return 1; }
- inline const Scalar& coeff(int row, int col) const
+ inline const Scalar& coeff(Index row, Index col) const
{ return m_coeffs.coeff(row, col); }
- inline Scalar& coeffRef(int row, int col)
+ inline Scalar& coeffRef(Index row, Index col)
{ return m_coeffs.coeffRef(row, col); }
- inline const Scalar& coeff(int index) const
+ inline const Scalar& coeff(Index index) const
{ return m_coeffs.coeff(index); }
- inline Scalar& coeffRef(int index)
+ inline Scalar& coeffRef(Index index)
{ return m_coeffs.coeffRef(index);}
diff --git a/unsupported/Eigen/src/SparseExtra/UmfPackSupport.h b/unsupported/Eigen/src/SparseExtra/UmfPackSupport.h
index 950624758..9c0dfcc08 100644
--- a/unsupported/Eigen/src/SparseExtra/UmfPackSupport.h
+++ b/unsupported/Eigen/src/SparseExtra/UmfPackSupport.h
@@ -200,8 +200,9 @@ class SparseLU<MatrixType,UmfPack> : public SparseLU<MatrixType>
template<typename MatrixType>
void SparseLU<MatrixType,UmfPack>::compute(const MatrixType& a)
{
- const int rows = a.rows();
- const int cols = a.cols();
+ typedef typename MatrixType::Index Index;
+ const Index rows = a.rows();
+ const Index cols = a.cols();
ei_assert((MatrixType::Flags&RowMajorBit)==0 && "Row major matrices are not supported yet");
m_matrixRef = &a;
diff --git a/unsupported/test/sparse_extra.cpp b/unsupported/test/sparse_extra.cpp
index fa6dc50f5..6cf1f50c4 100644
--- a/unsupported/test/sparse_extra.cpp
+++ b/unsupported/test/sparse_extra.cpp
@@ -61,8 +61,9 @@ bool test_random_setter(DynamicSparseMatrix<T>& sm, const DenseType& ref, const
template<typename SparseMatrixType> void sparse_extra(const SparseMatrixType& ref)
{
- const int rows = ref.rows();
- const int cols = ref.cols();
+ typedef typename SparseMatrixType::Index Index;
+ const Index rows = ref.rows();
+ const Index cols = ref.cols();
typedef typename SparseMatrixType::Scalar Scalar;
enum { Flags = SparseMatrixType::Flags };