mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-19 08:09:36 +08:00
Remove local Index typedef from unit-tests
This commit is contained in:
parent
63185be8b2
commit
12e1ebb68b
@ -70,7 +70,6 @@ template<typename MatrixType> 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<Scalar>::Real RealScalar;
|
||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
template<typename ArrayType> void array(const ArrayType& m)
|
||||
{
|
||||
typedef typename ArrayType::Index Index;
|
||||
typedef typename ArrayType::Scalar Scalar;
|
||||
typedef typename ArrayType::RealScalar RealScalar;
|
||||
typedef Array<Scalar, ArrayType::RowsAtCompileTime, 1> ColVectorType;
|
||||
@ -130,7 +129,6 @@ template<typename ArrayType> void array(const ArrayType& m)
|
||||
template<typename ArrayType> void comparisons(const ArrayType& m)
|
||||
{
|
||||
using std::abs;
|
||||
typedef typename ArrayType::Index Index;
|
||||
typedef typename ArrayType::Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
|
||||
@ -197,7 +195,7 @@ template<typename ArrayType> void comparisons(const ArrayType& m)
|
||||
RealScalar a = m1.abs().mean();
|
||||
VERIFY( (m1<-a || m1>a).count() == (m1.abs()>a).count());
|
||||
|
||||
typedef Array<typename ArrayType::Index, Dynamic, 1> ArrayOfIndices;
|
||||
typedef Array<Index, Dynamic, 1> 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<typename ArrayType> 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<Scalar>::Real RealScalar;
|
||||
|
||||
@ -322,7 +319,6 @@ template<typename ArrayType> void array_real(const ArrayType& m)
|
||||
|
||||
template<typename ArrayType> void array_complex(const ArrayType& m)
|
||||
{
|
||||
typedef typename ArrayType::Index Index;
|
||||
typedef typename ArrayType::Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
|
||||
@ -427,7 +423,6 @@ template<typename ArrayType> void array_complex(const ArrayType& m)
|
||||
|
||||
template<typename ArrayType> void min_max(const ArrayType& m)
|
||||
{
|
||||
typedef typename ArrayType::Index Index;
|
||||
typedef typename ArrayType::Scalar Scalar;
|
||||
|
||||
Index rows = m.rows();
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
template<typename MatrixType> void array_for_matrix(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> ColVectorType;
|
||||
typedef Matrix<Scalar, 1, MatrixType::ColsAtCompileTime> RowVectorType;
|
||||
@ -83,7 +82,6 @@ template<typename MatrixType> void array_for_matrix(const MatrixType& m)
|
||||
template<typename MatrixType> void comparisons(const MatrixType& m)
|
||||
{
|
||||
using std::abs;
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
|
||||
@ -140,7 +138,7 @@ template<typename MatrixType> 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<typename MatrixType::Index, Dynamic, 1> VectorOfIndices;
|
||||
typedef Matrix<Index, Dynamic, 1> 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<typename VectorType> void lpNorm(const VectorType& v)
|
||||
|
||||
template<typename MatrixType> 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<typename MatrixType> void cwise_min_max(const MatrixType& m)
|
||||
|
||||
template<typename MatrixTraits> void resize(const MatrixTraits& t)
|
||||
{
|
||||
typedef typename MatrixTraits::Index Index;
|
||||
typedef typename MatrixTraits::Scalar Scalar;
|
||||
typedef Matrix<Scalar,Dynamic,Dynamic> MatrixType;
|
||||
typedef Array<Scalar,Dynamic,Dynamic> Array2DType;
|
||||
|
@ -14,7 +14,6 @@ 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 Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
|
||||
typedef Matrix<Scalar, Dynamic, Dynamic> MatrixX;
|
||||
|
@ -15,7 +15,6 @@ 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;
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
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;
|
||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
|
||||
@ -124,22 +123,22 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
||||
|
||||
// check automatic transposition
|
||||
sm2.setZero();
|
||||
for(typename MatrixType::Index i=0;i<rows;++i)
|
||||
for(Index i=0;i<rows;++i)
|
||||
sm2.col(i) = sm1.row(i);
|
||||
VERIFY_IS_APPROX(sm2,sm1.transpose());
|
||||
|
||||
sm2.setZero();
|
||||
for(typename MatrixType::Index i=0;i<rows;++i)
|
||||
for(Index i=0;i<rows;++i)
|
||||
sm2.col(i).noalias() = sm1.row(i);
|
||||
VERIFY_IS_APPROX(sm2,sm1.transpose());
|
||||
|
||||
sm2.setZero();
|
||||
for(typename MatrixType::Index i=0;i<rows;++i)
|
||||
for(Index i=0;i<rows;++i)
|
||||
sm2.col(i).noalias() += sm1.row(i);
|
||||
VERIFY_IS_APPROX(sm2,sm1.transpose());
|
||||
|
||||
sm2.setZero();
|
||||
for(typename MatrixType::Index i=0;i<rows;++i)
|
||||
for(Index i=0;i<rows;++i)
|
||||
sm2.col(i).noalias() -= sm1.row(i);
|
||||
VERIFY_IS_APPROX(sm2,-sm1.transpose());
|
||||
|
||||
@ -160,7 +159,6 @@ 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;
|
||||
|
@ -39,7 +39,6 @@ is_same_block(const T1& a, const T2& b)
|
||||
|
||||
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;
|
||||
@ -227,7 +226,6 @@ template<typename MatrixType> void block(const MatrixType& m)
|
||||
template<typename MatrixType>
|
||||
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<typename MatrixType>
|
||||
void data_and_stride(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
|
@ -57,7 +57,6 @@ template<typename MatrixType,template <typename,int> class CholType> void test_c
|
||||
|
||||
template<typename MatrixType> 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<typename MatrixType> void cholesky_cplx(const MatrixType& m)
|
||||
|
||||
// test mixing real/scalar types
|
||||
|
||||
typedef typename MatrixType::Index Index;
|
||||
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
|
@ -17,7 +17,6 @@ template <typename Scalar, int Storage>
|
||||
void run_matrix_tests()
|
||||
{
|
||||
typedef Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, Storage> MatrixType;
|
||||
typedef typename MatrixType::Index Index;
|
||||
|
||||
MatrixType m, n;
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
template<typename MatrixType> void corners(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
|
@ -16,7 +16,6 @@ template<typename MatrixType> 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);
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
template<typename MatrixType> void diagonal(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
|
||||
Index rows = m.rows();
|
||||
|
@ -11,7 +11,6 @@
|
||||
using namespace std;
|
||||
template<typename MatrixType> void diagonalmatrices(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
|
||||
typedef Matrix<Scalar, Rows, 1> VectorType;
|
||||
|
@ -19,7 +19,6 @@
|
||||
template<typename MatrixType>
|
||||
void dontalign(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
|
||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::RowsAtCompileTime> SquareMatrixType;
|
||||
|
@ -13,7 +13,6 @@
|
||||
|
||||
template<typename MatrixType> void eigen2support(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
|
||||
Index rows = m.rows();
|
||||
|
@ -71,7 +71,6 @@ 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
|
||||
*/
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
template<typename MatrixType> void generalized_eigensolver_real(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
/* this test covers the following files:
|
||||
GeneralizedEigenSolver.h
|
||||
*/
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
template<typename MatrixType> void eigensolver(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
/* this test covers the following files:
|
||||
EigenSolver.h
|
||||
*/
|
||||
|
@ -68,7 +68,6 @@ template<typename MatrixType> void selfadjointeigensolver_essential_check(const
|
||||
|
||||
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)
|
||||
*/
|
||||
|
@ -33,7 +33,6 @@ template<typename BoxType> 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<Scalar>::Real RealScalar;
|
||||
typedef Matrix<Scalar, BoxType::AmbientDimAtCompileTime, 1> VectorType;
|
||||
@ -95,7 +94,6 @@ template<typename BoxType>
|
||||
void alignedboxCastTests(const BoxType& _box)
|
||||
{
|
||||
// casting
|
||||
typedef typename BoxType::Index Index;
|
||||
typedef typename BoxType::Scalar Scalar;
|
||||
typedef Matrix<Scalar, BoxType::AmbientDimAtCompileTime, 1> VectorType;
|
||||
|
||||
|
@ -19,7 +19,6 @@ template<typename HyperplaneType> 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;
|
||||
|
@ -19,7 +19,6 @@ template<typename LineType> 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<Scalar>::Real RealScalar;
|
||||
|
@ -12,7 +12,6 @@
|
||||
|
||||
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:
|
||||
|
@ -18,7 +18,6 @@
|
||||
|
||||
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 };
|
||||
@ -49,7 +48,6 @@ 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);
|
||||
|
@ -14,7 +14,6 @@
|
||||
template<typename MatrixType> void inverse(const MatrixType& m)
|
||||
{
|
||||
using std::abs;
|
||||
typedef typename MatrixType::Index Index;
|
||||
/* this test covers the following files:
|
||||
Inverse.h
|
||||
*/
|
||||
|
@ -14,7 +14,6 @@
|
||||
template<typename MatrixType, typename JacobiScalar>
|
||||
void jacobi(const MatrixType& m = MatrixType())
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
|
@ -36,7 +36,6 @@ void jacobisvd(const MatrixType& a = MatrixType(), bool pickrandom = true)
|
||||
template<typename MatrixType> void jacobisvd_verify_assert(const MatrixType& m)
|
||||
{
|
||||
svd_verify_assert<JacobiSVD<MatrixType> >(m);
|
||||
typedef typename MatrixType::Index Index;
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
|
@ -19,7 +19,6 @@ template<typename MatrixType> 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;
|
||||
|
||||
|
@ -18,7 +18,6 @@ typename MatrixType::RealScalar matrix_l1_norm(const MatrixType& m) {
|
||||
|
||||
template<typename MatrixType> 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<typename MatrixType> void lu_partial_piv()
|
||||
/* this test covers the following files:
|
||||
PartialPivLU.h
|
||||
*/
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
|
||||
Index size = internal::random<Index>(1,4);
|
||||
|
||||
|
@ -17,7 +17,6 @@
|
||||
|
||||
template<typename VectorType> 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<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;
|
||||
|
||||
Index rows = m.rows(), cols = m.cols(), size = rows*cols;
|
||||
@ -121,7 +119,6 @@ template<typename MatrixType> void map_class_matrix(const MatrixType& m)
|
||||
|
||||
template<typename VectorType> 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<typename Scalar>
|
||||
void map_not_aligned_on_scalar()
|
||||
{
|
||||
typedef Matrix<Scalar,Dynamic,Dynamic> MatrixType;
|
||||
typedef typename MatrixType::Index Index;
|
||||
Index size = 11;
|
||||
Scalar* array1 = internal::aligned_new<Scalar>((size+1)*(size+1)+1);
|
||||
Scalar* array2 = reinterpret_cast<Scalar*>(sizeof(Scalar)/2+std::size_t(array1));
|
||||
|
@ -69,7 +69,6 @@ struct mapstaticmethods_impl<PlainObjectType, true, false>
|
||||
{
|
||||
static void run(const PlainObjectType& m)
|
||||
{
|
||||
typedef typename PlainObjectType::Index Index;
|
||||
Index rows = m.rows(), cols = m.cols();
|
||||
|
||||
int i = internal::random<int>(2,5), j = internal::random<int>(2,5);
|
||||
@ -116,7 +115,6 @@ struct mapstaticmethods_impl<PlainObjectType, true, true>
|
||||
{
|
||||
static void run(const PlainObjectType& v)
|
||||
{
|
||||
typedef typename PlainObjectType::Index Index;
|
||||
Index size = v.size();
|
||||
|
||||
int i = internal::random<int>(2,5);
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
template<int Alignment,typename VectorType> 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<int Alignment,typename VectorType> void map_class_vector(const VectorTy
|
||||
|
||||
template<int Alignment,typename MatrixType> void map_class_matrix(const MatrixType& _m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
|
||||
Index rows = _m.rows(), cols = _m.cols();
|
||||
|
@ -14,7 +14,6 @@ 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;
|
||||
Index rows = m.rows();
|
||||
|
@ -24,7 +24,6 @@ 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;
|
||||
|
||||
Index rows = m.rows();
|
||||
@ -173,7 +172,7 @@ template<typename MatrixType> 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<Scalar, Eigen::Dynamic, Eigen::Dynamic, Flag > MatrixX;
|
||||
typedef Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic, TransposeFlag> MatrixXT;
|
||||
// Dynamic reference:
|
||||
|
@ -14,7 +14,6 @@
|
||||
using namespace std;
|
||||
template<typename MatrixType> 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 };
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
template<typename MatrixType> void product_extra(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef Matrix<Scalar, 1, Dynamic> RowVectorType;
|
||||
typedef Matrix<Scalar, Dynamic, 1> ColVectorType;
|
||||
|
@ -15,7 +15,6 @@ 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;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
template<typename MatrixType> void product_selfadjoint(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
|
||||
typedef Matrix<Scalar, 1, MatrixType::RowsAtCompileTime> RowVectorType;
|
||||
|
@ -16,7 +16,6 @@ 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 typename MatrixType::Index Index;
|
||||
|
||||
Index rows = size;
|
||||
Index cols = size;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
template<typename MatrixType> void syrk(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime, RowMajor> RMatrixType;
|
||||
typedef Matrix<Scalar, MatrixType::ColsAtCompileTime, Dynamic> Rhs1;
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
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;
|
||||
|
@ -12,8 +12,6 @@
|
||||
|
||||
template<typename MatrixType> void qr(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
|
||||
Index rows = m.rows();
|
||||
Index cols = m.cols();
|
||||
|
||||
|
@ -14,8 +14,6 @@
|
||||
|
||||
template <typename MatrixType>
|
||||
void cod() {
|
||||
typedef typename MatrixType::Index Index;
|
||||
|
||||
Index rows = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
|
||||
Index cols = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
|
||||
Index cols2 = internal::random<Index>(2, EIGEN_TEST_MAX_SIZE);
|
||||
@ -94,7 +92,6 @@ void cod_fixedsize() {
|
||||
template<typename MatrixType> void qr()
|
||||
{
|
||||
using std::sqrt;
|
||||
typedef typename MatrixType::Index Index;
|
||||
|
||||
Index rows = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE), cols = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE), cols2 = internal::random<Index>(2,EIGEN_TEST_MAX_SIZE);
|
||||
Index rank = internal::random<Index>(1, (std::min)(rows, cols)-1);
|
||||
@ -211,7 +208,6 @@ template<typename MatrixType> 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;
|
||||
|
||||
|
@ -13,8 +13,6 @@
|
||||
|
||||
template<typename MatrixType> 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);
|
||||
|
@ -18,8 +18,6 @@
|
||||
template<typename MatrixType>
|
||||
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);
|
||||
|
@ -18,7 +18,6 @@ template<typename MatrixType> 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();
|
||||
|
@ -16,7 +16,6 @@
|
||||
|
||||
template<typename MatrixType> 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<typename MatrixType> void matrixRedux(const MatrixType& m)
|
||||
template<typename VectorType> void vectorRedux(const VectorType& w)
|
||||
{
|
||||
using std::abs;
|
||||
typedef typename VectorType::Index Index;
|
||||
typedef typename VectorType::Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
Index size = w.size();
|
||||
|
@ -32,7 +32,6 @@
|
||||
|
||||
template<typename MatrixType> void ref_matrix(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename MatrixType::RealScalar RealScalar;
|
||||
typedef Matrix<Scalar,Dynamic,Dynamic,MatrixType::Options> DynMatrixType;
|
||||
@ -80,7 +79,6 @@ template<typename MatrixType> void ref_matrix(const MatrixType& m)
|
||||
|
||||
template<typename VectorType> void ref_vector(const VectorType& m)
|
||||
{
|
||||
typedef typename VectorType::Index Index;
|
||||
typedef typename VectorType::Scalar Scalar;
|
||||
typedef typename VectorType::RealScalar RealScalar;
|
||||
typedef Matrix<Scalar,Dynamic,1,VectorType::Options> DynMatrixType;
|
||||
|
@ -13,8 +13,6 @@
|
||||
|
||||
template<typename MatrixType> void verifyIsQuasiTriangular(const MatrixType& T)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
|
||||
const Index size = T.cols();
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
template<typename MatrixType> void selfadjoint(const MatrixType& m)
|
||||
{
|
||||
typedef typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
|
||||
Index rows = m.rows();
|
||||
|
@ -15,7 +15,7 @@ template<typename MatrixType> 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()
|
||||
|
@ -21,7 +21,6 @@ template<typename MatrixType> 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<Scalar>::Real RealScalar;
|
||||
|
||||
|
@ -15,8 +15,6 @@
|
||||
template<typename MatrixType>
|
||||
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);
|
||||
|
@ -28,8 +28,8 @@ EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(Quaterniond)
|
||||
template<typename MatrixType>
|
||||
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<MatrixType> v(10, MatrixType(rows,cols)), w(20, y);
|
||||
v[5] = x;
|
||||
|
@ -15,8 +15,6 @@
|
||||
template<typename MatrixType>
|
||||
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);
|
||||
|
@ -44,8 +44,8 @@ void set(Container & c, Position position, const Value & value)
|
||||
template<typename MatrixType>
|
||||
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<MatrixType> v(10, MatrixType(rows,cols)), w(20, y);
|
||||
typename std::list<MatrixType>::iterator itv = get(v, 5);
|
||||
|
@ -14,8 +14,8 @@
|
||||
template<typename MatrixType>
|
||||
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<MatrixType,Eigen::aligned_allocator<MatrixType> > v(10, MatrixType(rows,cols)), w(20, y);
|
||||
v[5] = x;
|
||||
|
@ -28,8 +28,8 @@ EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(Quaterniond)
|
||||
template<typename MatrixType>
|
||||
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<MatrixType> v(10, MatrixType(rows,cols)), w(20, y);
|
||||
v[5] = x;
|
||||
|
@ -23,7 +23,6 @@
|
||||
template<typename SvdType, typename MatrixType>
|
||||
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<typename MatrixType>
|
||||
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<typename SvdType,typename MatrixType>
|
||||
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();
|
||||
|
||||
|
@ -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<RealScalar>::max_exponent10/4;
|
||||
s = internal::random<RealScalar>(1,s);
|
||||
|
@ -28,8 +28,8 @@ template<typename MatrixType> void swap(const MatrixType& m)
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
|
||||
eigen_assert((!internal::is_same<MatrixType,OtherMatrixType>::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);
|
||||
|
@ -19,8 +19,8 @@ template<typename MatrixType> void triangular_square(const MatrixType& m)
|
||||
|
||||
RealScalar largerEps = 10*test_precision<RealScalar>();
|
||||
|
||||
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<typename MatrixType> void triangular_square(const MatrixType& m)
|
||||
|
||||
template<typename MatrixType> void triangular_rect(const MatrixType& m)
|
||||
{
|
||||
typedef const typename MatrixType::Index Index;
|
||||
typedef typename MatrixType::Scalar Scalar;
|
||||
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||
enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime };
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
template<typename MatrixType> 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<typename MatrixType::RealScalar, MatrixType::RowsAtCompileTime, MatrixType::ColsAtCompileTime> RealMatrixType;
|
||||
typedef Matrix<typename MatrixType::Scalar, MatrixType::ColsAtCompileTime, MatrixType::RowsAtCompileTime> TransposeMatrixType;
|
||||
|
@ -15,7 +15,6 @@
|
||||
|
||||
template<typename ArrayType> void vectorwiseop_array(const ArrayType& m)
|
||||
{
|
||||
typedef typename ArrayType::Index Index;
|
||||
typedef typename ArrayType::Scalar Scalar;
|
||||
typedef Array<Scalar, ArrayType::RowsAtCompileTime, 1> ColVectorType;
|
||||
typedef Array<Scalar, 1, ArrayType::ColsAtCompileTime> RowVectorType;
|
||||
@ -129,7 +128,6 @@ template<typename ArrayType> void vectorwiseop_array(const ArrayType& m)
|
||||
|
||||
template<typename MatrixType> void vectorwiseop_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;
|
||||
|
@ -12,7 +12,6 @@
|
||||
template<typename MatrixType> 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<typename MatrixType> void matrixVisitor(const MatrixType& p)
|
||||
template<typename VectorType> void vectorVisitor(const VectorType& w)
|
||||
{
|
||||
typedef typename VectorType::Scalar Scalar;
|
||||
typedef typename VectorType::Index Index;
|
||||
|
||||
Index size = w.size();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user