From 12e1ebb68b93b218a3553af67fee8535d79e857e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 12 Jul 2018 17:16:40 +0200 Subject: Remove local Index typedef from unit-tests --- test/adjoint.cpp | 1 - test/array.cpp | 7 +------ test/array_for_matrix.cpp | 6 +----- test/array_replicate.cpp | 1 - test/array_reverse.cpp | 1 - test/basicstuff.cpp | 10 ++++------ test/block.cpp | 3 --- test/cholesky.cpp | 3 --- test/conservative_resize.cpp | 1 - test/corners.cpp | 1 - test/determinant.cpp | 1 - test/diagonal.cpp | 1 - test/diagonalmatrices.cpp | 1 - test/dontalign.cpp | 1 - test/eigen2support.cpp | 1 - test/eigensolver_complex.cpp | 1 - test/eigensolver_generalized_real.cpp | 1 - test/eigensolver_generic.cpp | 1 - test/eigensolver_selfadjoint.cpp | 1 - test/geo_alignedbox.cpp | 2 -- test/geo_hyperplane.cpp | 1 - test/geo_parametrizedline.cpp | 1 - test/householder.cpp | 1 - test/integer_types.cpp | 2 -- test/inverse.cpp | 1 - test/jacobi.cpp | 1 - test/jacobisvd.cpp | 1 - test/linearstructure.cpp | 1 - test/lu.cpp | 2 -- test/mapped_matrix.cpp | 4 ---- test/mapstaticmethods.cpp | 2 -- test/mapstride.cpp | 2 -- test/miscmatrices.cpp | 1 - test/nomalloc.cpp | 3 +-- test/permutationmatrices.cpp | 1 - test/product_extra.cpp | 1 - test/product_notemporary.cpp | 1 - test/product_selfadjoint.cpp | 1 - test/product_symm.cpp | 1 - test/product_syrk.cpp | 1 - test/product_trmv.cpp | 1 - test/qr.cpp | 2 -- test/qr_colpivoting.cpp | 4 ---- test/qr_fullpivoting.cpp | 2 -- test/qtvector.cpp | 2 -- test/real_qz.cpp | 1 - test/redux.cpp | 2 -- test/ref.cpp | 2 -- test/schur_real.cpp | 2 -- test/selfadjoint.cpp | 1 - test/sizeof.cpp | 2 +- test/stable_norm.cpp | 1 - test/stddeque.cpp | 2 -- test/stddeque_overload.cpp | 4 ++-- test/stdlist.cpp | 2 -- test/stdlist_overload.cpp | 4 ++-- test/stdvector.cpp | 4 ++-- test/stdvector_overload.cpp | 4 ++-- test/svd_common.h | 5 ----- test/svd_fill.h | 1 - test/swap.cpp | 4 ++-- test/triangular.cpp | 5 ++--- test/upperbidiagonalization.cpp | 4 ++-- test/vectorwiseop.cpp | 2 -- test/visitor.cpp | 2 -- 65 files changed, 22 insertions(+), 117 deletions(-) diff --git a/test/adjoint.cpp b/test/adjoint.cpp index bdea51c10..37032d220 100644 --- a/test/adjoint.cpp +++ b/test/adjoint.cpp @@ -70,7 +70,6 @@ template void adjoint(const MatrixType& m) Transpose.h Conjugate.h Dot.h */ using std::abs; - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef Matrix VectorType; diff --git a/test/array.cpp b/test/array.cpp index f7f3ba780..7e228ed54 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -11,7 +11,6 @@ template void array(const ArrayType& m) { - typedef typename ArrayType::Index Index; typedef typename ArrayType::Scalar Scalar; typedef typename ArrayType::RealScalar RealScalar; typedef Array ColVectorType; @@ -130,7 +129,6 @@ template void array(const ArrayType& m) template void comparisons(const ArrayType& m) { using std::abs; - typedef typename ArrayType::Index Index; typedef typename ArrayType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; @@ -197,7 +195,7 @@ template void comparisons(const ArrayType& m) RealScalar a = m1.abs().mean(); VERIFY( (m1<-a || m1>a).count() == (m1.abs()>a).count()); - typedef Array ArrayOfIndices; + typedef Array ArrayOfIndices; // TODO allows colwise/rowwise for array VERIFY_IS_APPROX(((m1.abs()+1)>RealScalar(0.1)).colwise().count(), ArrayOfIndices::Constant(cols,rows).transpose()); @@ -208,7 +206,6 @@ template void array_real(const ArrayType& m) { using std::abs; using std::sqrt; - typedef typename ArrayType::Index Index; typedef typename ArrayType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; @@ -322,7 +319,6 @@ template void array_real(const ArrayType& m) template void array_complex(const ArrayType& m) { - typedef typename ArrayType::Index Index; typedef typename ArrayType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; @@ -427,7 +423,6 @@ template void array_complex(const ArrayType& m) template void min_max(const ArrayType& m) { - typedef typename ArrayType::Index Index; typedef typename ArrayType::Scalar Scalar; Index rows = m.rows(); diff --git a/test/array_for_matrix.cpp b/test/array_for_matrix.cpp index b8721391f..3dc5dc487 100644 --- a/test/array_for_matrix.cpp +++ b/test/array_for_matrix.cpp @@ -11,7 +11,6 @@ template void array_for_matrix(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix ColVectorType; typedef Matrix RowVectorType; @@ -83,7 +82,6 @@ template void array_for_matrix(const MatrixType& m) template void comparisons(const MatrixType& m) { using std::abs; - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; @@ -140,7 +138,7 @@ template void comparisons(const MatrixType& m) RealScalar a = m1.cwiseAbs().mean(); VERIFY( ((m1.array()<-a).matrix() || (m1.array()>a).matrix()).count() == (m1.cwiseAbs().array()>a).count()); - typedef Matrix VectorOfIndices; + typedef Matrix VectorOfIndices; // TODO allows colwise/rowwise for array VERIFY_IS_APPROX(((m1.array().abs()+1)>RealScalar(0.1)).matrix().colwise().count(), VectorOfIndices::Constant(cols,rows).transpose()); @@ -172,7 +170,6 @@ template void lpNorm(const VectorType& v) template void cwise_min_max(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; Index rows = m.rows(); @@ -211,7 +208,6 @@ template void cwise_min_max(const MatrixType& m) template void resize(const MatrixTraits& t) { - typedef typename MatrixTraits::Index Index; typedef typename MatrixTraits::Scalar Scalar; typedef Matrix MatrixType; typedef Array Array2DType; diff --git a/test/array_replicate.cpp b/test/array_replicate.cpp index 779c8fc2f..0dad5bace 100644 --- a/test/array_replicate.cpp +++ b/test/array_replicate.cpp @@ -14,7 +14,6 @@ template void replicate(const MatrixType& m) /* this test covers the following files: Replicate.cpp */ - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix VectorType; typedef Matrix MatrixX; diff --git a/test/array_reverse.cpp b/test/array_reverse.cpp index c9d9f90c3..9d5b9a66d 100644 --- a/test/array_reverse.cpp +++ b/test/array_reverse.cpp @@ -15,7 +15,6 @@ using namespace std; template void reverse(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix VectorType; diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index c346ce6cb..0fbeb42eb 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -13,7 +13,6 @@ template void basicStuff(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix VectorType; typedef Matrix SquareMatrixType; @@ -124,22 +123,22 @@ template void basicStuff(const MatrixType& m) // check automatic transposition sm2.setZero(); - for(typename MatrixType::Index i=0;i void basicStuff(const MatrixType& m) template void basicStuffComplex(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef Matrix RealMatrixType; diff --git a/test/block.cpp b/test/block.cpp index 0c1d2b7b8..a45dd501d 100644 --- a/test/block.cpp +++ b/test/block.cpp @@ -39,7 +39,6 @@ is_same_block(const T1& a, const T2& b) template void block(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; typedef Matrix VectorType; @@ -227,7 +226,6 @@ template void block(const MatrixType& m) template void compare_using_data_and_stride(const MatrixType& m) { - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); Index size = m.size(); @@ -261,7 +259,6 @@ void compare_using_data_and_stride(const MatrixType& m) template void data_and_stride(const MatrixType& m) { - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); diff --git a/test/cholesky.cpp b/test/cholesky.cpp index b4b6bda7d..62c391de4 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -57,7 +57,6 @@ template class CholType> void test_c template void cholesky(const MatrixType& m) { - typedef typename MatrixType::Index Index; /* this test covers the following files: LLT.h LDLT.h */ @@ -289,8 +288,6 @@ template void cholesky_cplx(const MatrixType& m) // test mixing real/scalar types - typedef typename MatrixType::Index Index; - Index rows = m.rows(); Index cols = m.cols(); diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp index 498421b4c..21a1db4ac 100644 --- a/test/conservative_resize.cpp +++ b/test/conservative_resize.cpp @@ -17,7 +17,6 @@ template void run_matrix_tests() { typedef Matrix MatrixType; - typedef typename MatrixType::Index Index; MatrixType m, n; diff --git a/test/corners.cpp b/test/corners.cpp index 3c64c32a1..32edadb25 100644 --- a/test/corners.cpp +++ b/test/corners.cpp @@ -15,7 +15,6 @@ template void corners(const MatrixType& m) { - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); diff --git a/test/determinant.cpp b/test/determinant.cpp index 758f3afbb..b8c9babb3 100644 --- a/test/determinant.cpp +++ b/test/determinant.cpp @@ -16,7 +16,6 @@ template void determinant(const MatrixType& m) /* this test covers the following files: Determinant.h */ - typedef typename MatrixType::Index Index; Index size = m.rows(); MatrixType m1(size, size), m2(size, size); diff --git a/test/diagonal.cpp b/test/diagonal.cpp index 0b5ae8280..8ed9b4682 100644 --- a/test/diagonal.cpp +++ b/test/diagonal.cpp @@ -11,7 +11,6 @@ template void diagonal(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; Index rows = m.rows(); diff --git a/test/diagonalmatrices.cpp b/test/diagonalmatrices.cpp index a4ff10239..c55733df8 100644 --- a/test/diagonalmatrices.cpp +++ b/test/diagonalmatrices.cpp @@ -11,7 +11,6 @@ using namespace std; template void diagonalmatrices(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime }; typedef Matrix VectorType; diff --git a/test/dontalign.cpp b/test/dontalign.cpp index 4643cfed6..ac00112ed 100644 --- a/test/dontalign.cpp +++ b/test/dontalign.cpp @@ -19,7 +19,6 @@ template void dontalign(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix VectorType; typedef Matrix SquareMatrixType; diff --git a/test/eigen2support.cpp b/test/eigen2support.cpp index ad1d98091..ac6931a0e 100644 --- a/test/eigen2support.cpp +++ b/test/eigen2support.cpp @@ -13,7 +13,6 @@ template void eigen2support(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; Index rows = m.rows(); diff --git a/test/eigensolver_complex.cpp b/test/eigensolver_complex.cpp index 03d5774ef..8f279dc00 100644 --- a/test/eigensolver_complex.cpp +++ b/test/eigensolver_complex.cpp @@ -71,7 +71,6 @@ void verify_is_approx_upto_permutation(const VectorType& vec1, const VectorType& template void eigensolver(const MatrixType& m) { - typedef typename MatrixType::Index Index; /* this test covers the following files: ComplexEigenSolver.h, and indirectly ComplexSchur.h */ diff --git a/test/eigensolver_generalized_real.cpp b/test/eigensolver_generalized_real.cpp index 9c0838ba4..12a15ab81 100644 --- a/test/eigensolver_generalized_real.cpp +++ b/test/eigensolver_generalized_real.cpp @@ -15,7 +15,6 @@ template void generalized_eigensolver_real(const MatrixType& m) { - typedef typename MatrixType::Index Index; /* this test covers the following files: GeneralizedEigenSolver.h */ diff --git a/test/eigensolver_generic.cpp b/test/eigensolver_generic.cpp index d0e644d4b..07bf65e03 100644 --- a/test/eigensolver_generic.cpp +++ b/test/eigensolver_generic.cpp @@ -14,7 +14,6 @@ template void eigensolver(const MatrixType& m) { - typedef typename MatrixType::Index Index; /* this test covers the following files: EigenSolver.h */ diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp index 39ad4130e..0e39b5364 100644 --- a/test/eigensolver_selfadjoint.cpp +++ b/test/eigensolver_selfadjoint.cpp @@ -68,7 +68,6 @@ template void selfadjointeigensolver_essential_check(const template void selfadjointeigensolver(const MatrixType& m) { - typedef typename MatrixType::Index Index; /* this test covers the following files: EigenSolver.h, SelfAdjointEigenSolver.h (and indirectly: Tridiagonalization.h) */ diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp index 223ff5eea..87bf1140f 100644 --- a/test/geo_alignedbox.cpp +++ b/test/geo_alignedbox.cpp @@ -33,7 +33,6 @@ template void alignedbox(const BoxType& _box) /* this test covers the following files: AlignedBox.h */ - typedef typename BoxType::Index Index; typedef typename BoxType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef Matrix VectorType; @@ -95,7 +94,6 @@ template void alignedboxCastTests(const BoxType& _box) { // casting - typedef typename BoxType::Index Index; typedef typename BoxType::Scalar Scalar; typedef Matrix VectorType; diff --git a/test/geo_hyperplane.cpp b/test/geo_hyperplane.cpp index 27892850d..b3a48c585 100644 --- a/test/geo_hyperplane.cpp +++ b/test/geo_hyperplane.cpp @@ -19,7 +19,6 @@ template void hyperplane(const HyperplaneType& _plane) Hyperplane.h */ using std::abs; - typedef typename HyperplaneType::Index Index; const Index dim = _plane.dim(); enum { Options = HyperplaneType::Options }; typedef typename HyperplaneType::Scalar Scalar; diff --git a/test/geo_parametrizedline.cpp b/test/geo_parametrizedline.cpp index 29c1b105c..14cf4fd48 100644 --- a/test/geo_parametrizedline.cpp +++ b/test/geo_parametrizedline.cpp @@ -19,7 +19,6 @@ template void parametrizedline(const LineType& _line) ParametrizedLine.h */ using std::abs; - typedef typename LineType::Index Index; const Index dim = _line.dim(); typedef typename LineType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; diff --git a/test/householder.cpp b/test/householder.cpp index 78d44d48a..ccda46811 100644 --- a/test/householder.cpp +++ b/test/householder.cpp @@ -12,7 +12,6 @@ template void householder(const MatrixType& m) { - typedef typename MatrixType::Index Index; static bool even = true; even = !even; /* this test covers the following files: diff --git a/test/integer_types.cpp b/test/integer_types.cpp index 25126315a..36295598f 100644 --- a/test/integer_types.cpp +++ b/test/integer_types.cpp @@ -18,7 +18,6 @@ template 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 }; @@ -49,7 +48,6 @@ template void signed_integer_type_tests(const MatrixType& m template void integer_type_tests(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; VERIFY(NumTraits::IsInteger); diff --git a/test/inverse.cpp b/test/inverse.cpp index 97fe6ff92..be607cc8b 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -14,7 +14,6 @@ template void inverse(const MatrixType& m) { using std::abs; - typedef typename MatrixType::Index Index; /* this test covers the following files: Inverse.h */ diff --git a/test/jacobi.cpp b/test/jacobi.cpp index 7ccd4124b..319e4767a 100644 --- a/test/jacobi.cpp +++ b/test/jacobi.cpp @@ -14,7 +14,6 @@ template void jacobi(const MatrixType& m = MatrixType()) { - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); diff --git a/test/jacobisvd.cpp b/test/jacobisvd.cpp index 7f5f71562..72007bff5 100644 --- a/test/jacobisvd.cpp +++ b/test/jacobisvd.cpp @@ -36,7 +36,6 @@ void jacobisvd(const MatrixType& a = MatrixType(), bool pickrandom = true) template void jacobisvd_verify_assert(const MatrixType& m) { svd_verify_assert >(m); - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp index 17474af10..b6559b2a0 100644 --- a/test/linearstructure.cpp +++ b/test/linearstructure.cpp @@ -19,7 +19,6 @@ template void linearStructure(const MatrixType& m) /* this test covers the following files: CwiseUnaryOp.h, CwiseBinaryOp.h, SelfCwiseBinaryOp.h */ - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; diff --git a/test/lu.cpp b/test/lu.cpp index 9787f4d86..cad703dd0 100644 --- a/test/lu.cpp +++ b/test/lu.cpp @@ -18,7 +18,6 @@ typename MatrixType::RealScalar matrix_l1_norm(const MatrixType& m) { template void lu_non_invertible() { - typedef typename MatrixType::Index Index; typedef typename MatrixType::RealScalar RealScalar; /* this test covers the following files: LU.h @@ -181,7 +180,6 @@ template void lu_partial_piv() /* this test covers the following files: PartialPivLU.h */ - typedef typename MatrixType::Index Index; typedef typename NumTraits::Real RealScalar; Index size = internal::random(1,4); diff --git a/test/mapped_matrix.cpp b/test/mapped_matrix.cpp index 7b9e1fe52..a530fab41 100644 --- a/test/mapped_matrix.cpp +++ b/test/mapped_matrix.cpp @@ -17,7 +17,6 @@ template void map_class_vector(const VectorType& m) { - typedef typename VectorType::Index Index; typedef typename VectorType::Scalar Scalar; Index size = m.size(); @@ -51,7 +50,6 @@ template void map_class_vector(const VectorType& m) template void map_class_matrix(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; Index rows = m.rows(), cols = m.cols(), size = rows*cols; @@ -121,7 +119,6 @@ template void map_class_matrix(const MatrixType& m) template void map_static_methods(const VectorType& m) { - typedef typename VectorType::Index Index; typedef typename VectorType::Scalar Scalar; Index size = m.size(); @@ -163,7 +160,6 @@ template void map_not_aligned_on_scalar() { typedef Matrix MatrixType; - typedef typename MatrixType::Index Index; Index size = 11; Scalar* array1 = internal::aligned_new((size+1)*(size+1)+1); Scalar* array2 = reinterpret_cast(sizeof(Scalar)/2+std::size_t(array1)); diff --git a/test/mapstaticmethods.cpp b/test/mapstaticmethods.cpp index 06272d106..8156ca939 100644 --- a/test/mapstaticmethods.cpp +++ b/test/mapstaticmethods.cpp @@ -69,7 +69,6 @@ struct mapstaticmethods_impl { static void run(const PlainObjectType& m) { - typedef typename PlainObjectType::Index Index; Index rows = m.rows(), cols = m.cols(); int i = internal::random(2,5), j = internal::random(2,5); @@ -116,7 +115,6 @@ struct mapstaticmethods_impl { static void run(const PlainObjectType& v) { - typedef typename PlainObjectType::Index Index; Index size = v.size(); int i = internal::random(2,5); diff --git a/test/mapstride.cpp b/test/mapstride.cpp index de77dc5de..d785148cf 100644 --- a/test/mapstride.cpp +++ b/test/mapstride.cpp @@ -11,7 +11,6 @@ template void map_class_vector(const VectorType& m) { - typedef typename VectorType::Index Index; typedef typename VectorType::Scalar Scalar; Index size = m.size(); @@ -50,7 +49,6 @@ template void map_class_vector(const VectorTy template void map_class_matrix(const MatrixType& _m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; Index rows = _m.rows(), cols = _m.cols(); diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp index ef20dc749..f17291c40 100644 --- a/test/miscmatrices.cpp +++ b/test/miscmatrices.cpp @@ -14,7 +14,6 @@ template 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 VectorType; Index rows = m.rows(); diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index 50756c2fb..d1ca79d68 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -24,7 +24,6 @@ template 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; Index rows = m.rows(); @@ -173,7 +172,7 @@ template void test_reference(const MatrixType& m) { typedef typename MatrixType::Scalar Scalar; enum { Flag = MatrixType::IsRowMajor ? Eigen::RowMajor : Eigen::ColMajor}; enum { TransposeFlag = !MatrixType::IsRowMajor ? Eigen::RowMajor : Eigen::ColMajor}; - typename MatrixType::Index rows = m.rows(), cols=m.cols(); + Index rows = m.rows(), cols=m.cols(); typedef Eigen::Matrix MatrixX; typedef Eigen::Matrix MatrixXT; // Dynamic reference: diff --git a/test/permutationmatrices.cpp b/test/permutationmatrices.cpp index b2229cfe9..e885f0e04 100644 --- a/test/permutationmatrices.cpp +++ b/test/permutationmatrices.cpp @@ -14,7 +14,6 @@ using namespace std; template void permutationmatrices(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime, Options = MatrixType::Options }; diff --git a/test/product_extra.cpp b/test/product_extra.cpp index e2b855bff..de2709d8b 100644 --- a/test/product_extra.cpp +++ b/test/product_extra.cpp @@ -11,7 +11,6 @@ template void product_extra(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix RowVectorType; typedef Matrix ColVectorType; diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp index 062180f42..b90165b2f 100644 --- a/test/product_notemporary.cpp +++ b/test/product_notemporary.cpp @@ -15,7 +15,6 @@ template 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 RowVectorType; diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp index 3d768aa7e..88d68391b 100644 --- a/test/product_selfadjoint.cpp +++ b/test/product_selfadjoint.cpp @@ -11,7 +11,6 @@ template void product_selfadjoint(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix VectorType; typedef Matrix RowVectorType; diff --git a/test/product_symm.cpp b/test/product_symm.cpp index 8c44383f9..7d1042a4f 100644 --- a/test/product_symm.cpp +++ b/test/product_symm.cpp @@ -16,7 +16,6 @@ template void symm(int size = Size, in typedef Matrix Rhs2; enum { order = OtherSize==1 ? 0 : RowMajor }; typedef Matrix Rhs3; - typedef typename MatrixType::Index Index; Index rows = size; Index cols = size; diff --git a/test/product_syrk.cpp b/test/product_syrk.cpp index e10f0f2f2..3ebbe14ca 100644 --- a/test/product_syrk.cpp +++ b/test/product_syrk.cpp @@ -11,7 +11,6 @@ template void syrk(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef Matrix RMatrixType; typedef Matrix Rhs1; diff --git a/test/product_trmv.cpp b/test/product_trmv.cpp index 57a202afc..65d66e57b 100644 --- a/test/product_trmv.cpp +++ b/test/product_trmv.cpp @@ -11,7 +11,6 @@ template void trmv(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef Matrix VectorType; diff --git a/test/qr.cpp b/test/qr.cpp index 00ef99ef9..02e3ed74c 100644 --- a/test/qr.cpp +++ b/test/qr.cpp @@ -12,8 +12,6 @@ template void qr(const MatrixType& m) { - typedef typename MatrixType::Index Index; - Index rows = m.rows(); Index cols = m.cols(); diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp index 26ed27f5c..96c0badb7 100644 --- a/test/qr_colpivoting.cpp +++ b/test/qr_colpivoting.cpp @@ -14,8 +14,6 @@ template void cod() { - typedef typename MatrixType::Index Index; - Index rows = internal::random(2, EIGEN_TEST_MAX_SIZE); Index cols = internal::random(2, EIGEN_TEST_MAX_SIZE); Index cols2 = internal::random(2, EIGEN_TEST_MAX_SIZE); @@ -94,7 +92,6 @@ void cod_fixedsize() { template void qr() { using std::sqrt; - typedef typename MatrixType::Index Index; Index rows = internal::random(2,EIGEN_TEST_MAX_SIZE), cols = internal::random(2,EIGEN_TEST_MAX_SIZE), cols2 = internal::random(2,EIGEN_TEST_MAX_SIZE); Index rank = internal::random(1, (std::min)(rows, cols)-1); @@ -211,7 +208,6 @@ template void qr_kahan_matrix() { using std::sqrt; using std::abs; - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index 3d9accea6..c270edf1a 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -13,8 +13,6 @@ template void qr() { - typedef typename MatrixType::Index Index; - static const int Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime; Index max_size = EIGEN_TEST_MAX_SIZE; Index min_size = numext::maxi(1,EIGEN_TEST_MAX_SIZE/10); diff --git a/test/qtvector.cpp b/test/qtvector.cpp index 2be885e48..22df0d515 100644 --- a/test/qtvector.cpp +++ b/test/qtvector.cpp @@ -18,8 +18,6 @@ template void check_qtvector_matrix(const MatrixType& m) { - typedef typename MatrixType::Index Index; - Index rows = m.rows(); Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); diff --git a/test/real_qz.cpp b/test/real_qz.cpp index 99ac31235..3c1492e4b 100644 --- a/test/real_qz.cpp +++ b/test/real_qz.cpp @@ -18,7 +18,6 @@ template void real_qz(const MatrixType& m) RealQZ.h */ using std::abs; - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; Index dim = m.cols(); diff --git a/test/redux.cpp b/test/redux.cpp index 2bade3735..213f080aa 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -16,7 +16,6 @@ template void matrixRedux(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; @@ -81,7 +80,6 @@ template void matrixRedux(const MatrixType& m) template void vectorRedux(const VectorType& w) { using std::abs; - typedef typename VectorType::Index Index; typedef typename VectorType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; Index size = w.size(); diff --git a/test/ref.cpp b/test/ref.cpp index 9dd2c0449..704495aff 100644 --- a/test/ref.cpp +++ b/test/ref.cpp @@ -32,7 +32,6 @@ template void ref_matrix(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; typedef Matrix DynMatrixType; @@ -80,7 +79,6 @@ template void ref_matrix(const MatrixType& m) template void ref_vector(const VectorType& m) { - typedef typename VectorType::Index Index; typedef typename VectorType::Scalar Scalar; typedef typename VectorType::RealScalar RealScalar; typedef Matrix DynMatrixType; diff --git a/test/schur_real.cpp b/test/schur_real.cpp index 4aede87df..e5229e6e8 100644 --- a/test/schur_real.cpp +++ b/test/schur_real.cpp @@ -13,8 +13,6 @@ template void verifyIsQuasiTriangular(const MatrixType& T) { - typedef typename MatrixType::Index Index; - const Index size = T.cols(); typedef typename MatrixType::Scalar Scalar; diff --git a/test/selfadjoint.cpp b/test/selfadjoint.cpp index aaa4888bd..bb11cc351 100644 --- a/test/selfadjoint.cpp +++ b/test/selfadjoint.cpp @@ -15,7 +15,6 @@ template void selfadjoint(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; Index rows = m.rows(); diff --git a/test/sizeof.cpp b/test/sizeof.cpp index 03ad20453..e552bae7a 100644 --- a/test/sizeof.cpp +++ b/test/sizeof.cpp @@ -15,7 +15,7 @@ template void verifySizeOf(const MatrixType&) if (MatrixType::RowsAtCompileTime!=Dynamic && MatrixType::ColsAtCompileTime!=Dynamic) VERIFY_IS_EQUAL(std::ptrdiff_t(sizeof(MatrixType)),std::ptrdiff_t(sizeof(Scalar))*std::ptrdiff_t(MatrixType::SizeAtCompileTime)); else - VERIFY_IS_EQUAL(sizeof(MatrixType),sizeof(Scalar*) + 2 * sizeof(typename MatrixType::Index)); + VERIFY_IS_EQUAL(sizeof(MatrixType),sizeof(Scalar*) + 2 * sizeof(Index)); } void test_sizeof() diff --git a/test/stable_norm.cpp b/test/stable_norm.cpp index 0dcf072fe..255cae9b3 100644 --- a/test/stable_norm.cpp +++ b/test/stable_norm.cpp @@ -21,7 +21,6 @@ template void stable_norm(const MatrixType& m) */ using std::sqrt; using std::abs; - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; diff --git a/test/stddeque.cpp b/test/stddeque.cpp index bb4b476f3..b511c4e61 100644 --- a/test/stddeque.cpp +++ b/test/stddeque.cpp @@ -15,8 +15,6 @@ template void check_stddeque_matrix(const MatrixType& m) { - typedef typename MatrixType::Index Index; - Index rows = m.rows(); Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); diff --git a/test/stddeque_overload.cpp b/test/stddeque_overload.cpp index 4da618bbf..0541bc1bd 100644 --- a/test/stddeque_overload.cpp +++ b/test/stddeque_overload.cpp @@ -28,8 +28,8 @@ EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(Quaterniond) template void check_stddeque_matrix(const MatrixType& m) { - typename MatrixType::Index rows = m.rows(); - typename MatrixType::Index cols = m.cols(); + Index rows = m.rows(); + Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); std::deque v(10, MatrixType(rows,cols)), w(20, y); v[5] = x; diff --git a/test/stdlist.cpp b/test/stdlist.cpp index 17cce779a..23cbe9039 100644 --- a/test/stdlist.cpp +++ b/test/stdlist.cpp @@ -15,8 +15,6 @@ template void check_stdlist_matrix(const MatrixType& m) { - typedef typename MatrixType::Index Index; - Index rows = m.rows(); Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); diff --git a/test/stdlist_overload.cpp b/test/stdlist_overload.cpp index bb910bd43..386124ad4 100644 --- a/test/stdlist_overload.cpp +++ b/test/stdlist_overload.cpp @@ -44,8 +44,8 @@ void set(Container & c, Position position, const Value & value) template void check_stdlist_matrix(const MatrixType& m) { - typename MatrixType::Index rows = m.rows(); - typename MatrixType::Index cols = m.cols(); + Index rows = m.rows(); + Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); std::list v(10, MatrixType(rows,cols)), w(20, y); typename std::list::iterator itv = get(v, 5); diff --git a/test/stdvector.cpp b/test/stdvector.cpp index 50cb3341d..cf3646870 100644 --- a/test/stdvector.cpp +++ b/test/stdvector.cpp @@ -14,8 +14,8 @@ template void check_stdvector_matrix(const MatrixType& m) { - typename MatrixType::Index rows = m.rows(); - typename MatrixType::Index cols = m.cols(); + Index rows = m.rows(); + Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); std::vector > v(10, MatrixType(rows,cols)), w(20, y); v[5] = x; diff --git a/test/stdvector_overload.cpp b/test/stdvector_overload.cpp index 959665954..0c86ce8a4 100644 --- a/test/stdvector_overload.cpp +++ b/test/stdvector_overload.cpp @@ -28,8 +28,8 @@ EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Quaterniond) template void check_stdvector_matrix(const MatrixType& m) { - typename MatrixType::Index rows = m.rows(); - typename MatrixType::Index cols = m.cols(); + Index rows = m.rows(); + Index cols = m.cols(); MatrixType x = MatrixType::Random(rows,cols), y = MatrixType::Random(rows,cols); std::vector v(10, MatrixType(rows,cols)), w(20, y); v[5] = x; diff --git a/test/svd_common.h b/test/svd_common.h index 605d5dfef..cba066593 100644 --- a/test/svd_common.h +++ b/test/svd_common.h @@ -23,7 +23,6 @@ template void svd_check_full(const MatrixType& m, const SvdType& svd) { - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); @@ -101,7 +100,6 @@ void svd_least_square(const MatrixType& m, unsigned int computationOptions) { typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); @@ -168,7 +166,6 @@ template void svd_min_norm(const MatrixType& m, unsigned int computationOptions) { typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Index Index; Index cols = m.cols(); enum { @@ -261,7 +258,6 @@ void svd_test_all_computation_options(const MatrixType& m, bool full_only) CALL_SUBTEST(( svd_min_norm(m, ComputeThinU | ComputeThinV) )); // test reconstruction - typedef typename MatrixType::Index Index; Index diagSize = (std::min)(m.rows(), m.cols()); SvdType svd(m, ComputeThinU | ComputeThinV); VERIFY_IS_APPROX(m, svd.matrixU().leftCols(diagSize) * svd.singularValues().asDiagonal() * svd.matrixV().leftCols(diagSize).adjoint()); @@ -437,7 +433,6 @@ template void svd_verify_assert(const MatrixType& m) { typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Index Index; Index rows = m.rows(); Index cols = m.cols(); diff --git a/test/svd_fill.h b/test/svd_fill.h index 3877c0c7e..d68647e99 100644 --- a/test/svd_fill.h +++ b/test/svd_fill.h @@ -23,7 +23,6 @@ void svd_fill_random(MatrixType &m, int Option = 0) using std::pow; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; - typedef typename MatrixType::Index Index; Index diagSize = (std::min)(m.rows(), m.cols()); RealScalar s = std::numeric_limits::max_exponent10/4; s = internal::random(1,s); diff --git a/test/swap.cpp b/test/swap.cpp index f76e3624d..a294da719 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -28,8 +28,8 @@ template void swap(const MatrixType& m) typedef typename MatrixType::Scalar Scalar; eigen_assert((!internal::is_same::value)); - typename MatrixType::Index rows = m.rows(); - typename MatrixType::Index cols = m.cols(); + Index rows = m.rows(); + Index cols = m.cols(); // construct 3 matrix guaranteed to be distinct MatrixType m1 = MatrixType::Random(rows,cols); diff --git a/test/triangular.cpp b/test/triangular.cpp index b96856486..d50342ccc 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -19,8 +19,8 @@ template void triangular_square(const MatrixType& m) RealScalar largerEps = 10*test_precision(); - typename MatrixType::Index rows = m.rows(); - typename MatrixType::Index cols = m.cols(); + Index rows = m.rows(); + Index cols = m.cols(); MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols), @@ -134,7 +134,6 @@ template void triangular_square(const MatrixType& m) template void triangular_rect(const MatrixType& m) { - typedef const typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime }; diff --git a/test/upperbidiagonalization.cpp b/test/upperbidiagonalization.cpp index 847b34b55..27a747875 100644 --- a/test/upperbidiagonalization.cpp +++ b/test/upperbidiagonalization.cpp @@ -12,8 +12,8 @@ template void upperbidiag(const MatrixType& m) { - const typename MatrixType::Index rows = m.rows(); - const typename MatrixType::Index cols = m.cols(); + const Index rows = m.rows(); + const Index cols = m.cols(); typedef Matrix RealMatrixType; typedef Matrix TransposeMatrixType; diff --git a/test/vectorwiseop.cpp b/test/vectorwiseop.cpp index f3ab561ee..a099d17c8 100644 --- a/test/vectorwiseop.cpp +++ b/test/vectorwiseop.cpp @@ -15,7 +15,6 @@ template void vectorwiseop_array(const ArrayType& m) { - typedef typename ArrayType::Index Index; typedef typename ArrayType::Scalar Scalar; typedef Array ColVectorType; typedef Array RowVectorType; @@ -129,7 +128,6 @@ template void vectorwiseop_array(const ArrayType& m) template void vectorwiseop_matrix(const MatrixType& m) { - typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef Matrix ColVectorType; diff --git a/test/visitor.cpp b/test/visitor.cpp index 844170ec6..7f4efab97 100644 --- a/test/visitor.cpp +++ b/test/visitor.cpp @@ -12,7 +12,6 @@ template void matrixVisitor(const MatrixType& p) { typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::Index Index; Index rows = p.rows(); Index cols = p.cols(); @@ -65,7 +64,6 @@ template void matrixVisitor(const MatrixType& p) template void vectorVisitor(const VectorType& w) { typedef typename VectorType::Scalar Scalar; - typedef typename VectorType::Index Index; Index size = w.size(); -- cgit v1.2.3