diff --git a/CMakeLists.txt b/CMakeLists.txt index ed9e6d183..bf609be66 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,12 +3,12 @@ project(Eigen) cmake_minimum_required(VERSION 2.6.2) # automatically parse the version number -file(READ "${CMAKE_SOURCE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header LIMIT 5000 OFFSET 1000) -string(REGEX MATCH "define *EIGEN_WORLD_VERSION ([0-9]*)" _eigen2_world_version_match "${_eigen2_version_header}") +file(READ "${CMAKE_SOURCE_DIR}/Eigen/src/Core/util/Macros.h" _eigen2_version_header) +string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}") set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}") -string(REGEX MATCH "define *EIGEN_MAJOR_VERSION ([0-9]*)" _eigen2_major_version_match "${_eigen2_version_header}") +string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen2_major_version_match "${_eigen2_version_header}") set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}") -string(REGEX MATCH "define *EIGEN_MINOR_VERSION ([0-9]*)" _eigen2_minor_version_match "${_eigen2_version_header}") +string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen2_minor_version_match "${_eigen2_version_header}") set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}") set(EIGEN_VERSION_NUMBER ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION}) diff --git a/Eigen/LU b/Eigen/LU index c63463359..9c21b4407 100644 --- a/Eigen/LU +++ b/Eigen/LU @@ -18,8 +18,8 @@ namespace Eigen { * \endcode */ -#include "src/LU/LU.h" -#include "src/LU/PartialLU.h" +#include "src/LU/FullPivLU.h" +#include "src/LU/PartialPivLU.h" #include "src/LU/Determinant.h" #include "src/LU/Inverse.h" diff --git a/Eigen/QR b/Eigen/QR index f38e96c5e..eaa99793e 100644 --- a/Eigen/QR +++ b/Eigen/QR @@ -34,8 +34,8 @@ namespace Eigen { */ #include "src/QR/HouseholderQR.h" -#include "src/QR/FullPivotingHouseholderQR.h" -#include "src/QR/ColPivotingHouseholderQR.h" +#include "src/QR/FullPivHouseholderQR.h" +#include "src/QR/ColPivHouseholderQR.h" // declare all classes for a given matrix type #define EIGEN_QR_MODULE_INSTANTIATE_TYPE(MATRIXTYPE,PREFIX) \ diff --git a/Eigen/src/Cholesky/LDLT.h b/Eigen/src/Cholesky/LDLT.h index c8d92f3c0..f95e10935 100644 --- a/Eigen/src/Cholesky/LDLT.h +++ b/Eigen/src/Cholesky/LDLT.h @@ -88,7 +88,7 @@ template class LDLT /** \returns a vector of integers, whose size is the number of rows of the matrix being decomposed, * representing the P permutation i.e. the permutation of the rows. For its precise meaning, - * see the examples given in the documentation of class LU. + * see the examples given in the documentation of class FullPivLU. */ inline const IntColVectorType& permutationP() const { diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index a2b57f8ea..729349b6f 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -699,8 +699,9 @@ template class MatrixBase /////////// LU module /////////// - const LU lu() const; - const PartialLU partialLu() const; + const FullPivLU fullPivLu() const; + const PartialPivLU partialPivLu() const; + const PartialPivLU lu() const; const ei_inverse_impl inverse() const; template void computeInverseAndDetWithCheck( @@ -725,8 +726,8 @@ template class MatrixBase /////////// QR module /////////// const HouseholderQR householderQr() const; - const ColPivotingHouseholderQR colPivotingHouseholderQr() const; - const FullPivotingHouseholderQR fullPivotingHouseholderQr() const; + const ColPivHouseholderQR colPivHouseholderQr() const; + const FullPivHouseholderQR fullPivHouseholderQr() const; EigenvaluesReturnType eigenvalues() const; RealScalar operatorNorm() const; diff --git a/Eigen/src/Core/ReturnByValue.h b/Eigen/src/Core/ReturnByValue.h index 55652db48..87b057f86 100644 --- a/Eigen/src/Core/ReturnByValue.h +++ b/Eigen/src/Core/ReturnByValue.h @@ -34,7 +34,14 @@ struct ei_traits > : public ei_traits::ReturnMatrixType> { enum { - Flags = ei_traits::ReturnMatrixType>::Flags | EvalBeforeNestingBit + // FIXME had to remove the DirectAccessBit for usage like + // matrix.inverse().block(...) + // because the Block ctor with direct access + // wants to call coeffRef() to get an address, and that fails (infinite recursion) as ReturnByValue + // doesnt implement coeffRef(). The better fix is probably rather to make Block work directly + // on the nested type, right? + Flags = (ei_traits::ReturnMatrixType>::Flags + | EvalBeforeNestingBit) & ~DirectAccessBit }; }; diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index 01adca96d..86539a64e 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -114,12 +114,12 @@ template class VectorwiseOp; template class Replicate; template class Reverse; -template class LU; -template class PartialLU; +template class FullPivLU; +template class PartialPivLU; template struct ei_inverse_impl; template class HouseholderQR; -template class ColPivotingHouseholderQR; -template class FullPivotingHouseholderQR; +template class ColPivHouseholderQR; +template class FullPivHouseholderQR; template class SVD; template class JacobiSVD; template class LLT; diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 706b30174..66b9d52f4 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -30,7 +30,7 @@ #define EIGEN_WORLD_VERSION 2 #define EIGEN_MAJOR_VERSION 90 -#define EIGEN_MINOR_VERSION 0 +#define EIGEN_MINOR_VERSION 1 #define EIGEN_VERSION_AT_LEAST(x,y,z) (EIGEN_WORLD_VERSION>x || (EIGEN_WORLD_VERSION>=x && \ (EIGEN_MAJOR_VERSION>y || (EIGEN_MAJOR_VERSION>=y && \ diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index d03fd52fd..70204f72b 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -876,6 +876,24 @@ Transform::fromPositionOrientationScale(const MatrixBase +struct ei_projective_transform_inverse +{ + static inline void run(const TransformType&, TransformType&) + {} +}; + +template +struct ei_projective_transform_inverse +{ + static inline void run(const TransformType& m, TransformType& res) + { + res.matrix() = m.matrix().inverse(); + } +}; + + /** \nonstableyet * * \returns the inverse transformation according to some given knowledge @@ -902,7 +920,7 @@ Transform::inverse(TransformTraits hint) const Transform res; if (hint == Projective) { - res.matrix() = m_matrix.inverse(); + ei_projective_transform_inverse::run(*this, res); } else { diff --git a/Eigen/src/LU/Determinant.h b/Eigen/src/LU/Determinant.h index b587065ed..8870d9f20 100644 --- a/Eigen/src/LU/Determinant.h +++ b/Eigen/src/LU/Determinant.h @@ -53,7 +53,7 @@ template::Scalar run(const Derived& m) { - return m.partialLu().determinant(); + return m.partialPivLu().determinant(); } }; diff --git a/Eigen/src/LU/LU.h b/Eigen/src/LU/FullPivLU.h similarity index 95% rename from Eigen/src/LU/LU.h rename to Eigen/src/LU/FullPivLU.h index 4792aaf07..8743dac92 100644 --- a/Eigen/src/LU/LU.h +++ b/Eigen/src/LU/FullPivLU.h @@ -31,7 +31,7 @@ template struct ei_lu_image_impl; /** \ingroup LU_Module * - * \class LU + * \class FullPivLU * * \brief LU decomposition of a matrix with complete pivoting, and related features * @@ -54,12 +54,12 @@ template struct ei_lu_image_impl; * permutationP(), permutationQ(). * * As an exemple, here is how the original matrix can be retrieved: - * \include class_LU.cpp - * Output: \verbinclude class_LU.out + * \include class_FullPivLU.cpp + * Output: \verbinclude class_FullPivLU.out * - * \sa MatrixBase::lu(), MatrixBase::determinant(), MatrixBase::inverse() + * \sa MatrixBase::fullPivLu(), MatrixBase::determinant(), MatrixBase::inverse() */ -template class LU +template class FullPivLU { public: @@ -81,14 +81,14 @@ template class LU * The default constructor is useful in cases in which the user intends to * perform decompositions via LU::compute(const MatrixType&). */ - LU(); + FullPivLU(); /** Constructor. * * \param matrix the matrix of which to compute the LU decomposition. * It is required to be nonzero. */ - LU(const MatrixType& matrix); + FullPivLU(const MatrixType& matrix); /** Computes the LU decomposition of the given matrix. * @@ -97,11 +97,11 @@ template class LU * * \returns a reference to *this */ - LU& compute(const MatrixType& matrix); + FullPivLU& compute(const MatrixType& matrix); /** \returns the LU decomposition matrix: the upper-triangular part is U, the * unit-lower-triangular part is L (at least for square matrices; in the non-square - * case, special care is needed, see the documentation of class LU). + * case, special care is needed, see the documentation of class FullPivLU). * * \sa matrixL(), matrixU() */ @@ -131,7 +131,7 @@ template class LU /** \returns a vector of integers, whose size is the number of rows of the matrix being decomposed, * representing the P permutation i.e. the permutation of the rows. For its precise meaning, - * see the examples given in the documentation of class LU. + * see the examples given in the documentation of class FullPivLU. * * \sa permutationQ() */ @@ -143,7 +143,7 @@ template class LU /** \returns a vector of integers, whose size is the number of columns of the matrix being * decomposed, representing the Q permutation i.e. the permutation of the columns. - * For its precise meaning, see the examples given in the documentation of class LU. + * For its precise meaning, see the examples given in the documentation of class FullPivLU. * * \sa permutationP() */ @@ -162,8 +162,8 @@ template class LU * For that, it uses the threshold value that you can control by calling * setThreshold(const RealScalar&). * - * Example: \include LU_kernel.cpp - * Output: \verbinclude LU_kernel.out + * Example: \include FullPivLU_kernel.cpp + * Output: \verbinclude FullPivLU_kernel.out * * \sa image() */ @@ -187,8 +187,8 @@ template class LU * For that, it uses the threshold value that you can control by calling * setThreshold(const RealScalar&). * - * Example: \include LU_image.cpp - * Output: \verbinclude LU_image.out + * Example: \include FullPivLU_image.cpp + * Output: \verbinclude FullPivLU_image.out * * \sa kernel() */ @@ -214,8 +214,8 @@ template class LU * \note_about_arbitrary_choice_of_solution * \note_about_using_kernel_to_study_multiple_solutions * - * Example: \include LU_solve.cpp - * Output: \verbinclude LU_solve.out + * Example: \include FullPivLU_solve.cpp + * Output: \verbinclude FullPivLU_solve.out * * \sa TriangularView::solve(), kernel(), inverse() */ @@ -260,7 +260,7 @@ template class LU * * If you want to come back to the default behavior, call setThreshold(Default_t) */ - LU& setThreshold(const RealScalar& threshold) + FullPivLU& setThreshold(const RealScalar& threshold) { m_usePrescribedThreshold = true; m_prescribedThreshold = threshold; @@ -274,7 +274,7 @@ template class LU * * See the documentation of setThreshold(const RealScalar&). */ - LU& setThreshold(Default_t) + FullPivLU& setThreshold(Default_t) { m_usePrescribedThreshold = false; } @@ -383,20 +383,20 @@ template class LU }; template -LU::LU() +FullPivLU::FullPivLU() : m_isInitialized(false), m_usePrescribedThreshold(false) { } template -LU::LU(const MatrixType& matrix) +FullPivLU::FullPivLU(const MatrixType& matrix) : m_isInitialized(false), m_usePrescribedThreshold(false) { compute(matrix); } template -LU& LU::compute(const MatrixType& matrix) +FullPivLU& FullPivLU::compute(const MatrixType& matrix) { m_isInitialized = true; m_lu = matrix; @@ -483,7 +483,7 @@ LU& LU::compute(const MatrixType& matrix) } template -typename ei_traits::Scalar LU::determinant() const +typename ei_traits::Scalar FullPivLU::determinant() const { ei_assert(m_isInitialized && "LU is not initialized."); ei_assert(m_lu.rows() == m_lu.cols() && "You can't take the determinant of a non-square matrix!"); @@ -511,7 +511,7 @@ struct ei_traits > template struct ei_lu_kernel_impl : public ReturnByValue > { - typedef LU LUType; + typedef FullPivLU LUType; typedef typename MatrixType::Scalar Scalar; typedef typename MatrixType::RealScalar RealScalar; const LUType& m_lu; @@ -615,7 +615,7 @@ struct ei_traits > template struct ei_lu_image_impl : public ReturnByValue > { - typedef LU LUType; + typedef FullPivLU LUType; typedef typename MatrixType::RealScalar RealScalar; const LUType& m_lu; int m_rank, m_cols; @@ -670,7 +670,7 @@ template struct ei_lu_solve_impl : public ReturnByValue > { typedef typename ei_cleantype::type RhsNested; - typedef LU LUType; + typedef FullPivLU LUType; const LUType& m_lu; const typename Rhs::Nested m_rhs; @@ -739,15 +739,15 @@ struct ei_lu_solve_impl : public ReturnByValue /** \lu_module * - * \return the LU decomposition of \c *this. + * \return the full-pivoting LU decomposition of \c *this. * - * \sa class LU + * \sa class FullPivLU */ template -inline const LU::PlainMatrixType> -MatrixBase::lu() const +inline const FullPivLU::PlainMatrixType> +MatrixBase::fullPivLu() const { - return LU(eval()); + return FullPivLU(eval()); } #endif // EIGEN_LU_H diff --git a/Eigen/src/LU/Inverse.h b/Eigen/src/LU/Inverse.h index a168d58cd..306b5f60a 100644 --- a/Eigen/src/LU/Inverse.h +++ b/Eigen/src/LU/Inverse.h @@ -34,7 +34,7 @@ struct ei_compute_inverse { static inline void run(const MatrixType& matrix, ResultType& result) { - result = matrix.partialLu().inverse(); + result = matrix.partialPivLu().inverse(); } }; @@ -232,22 +232,31 @@ struct ei_compute_inverse typename MatrixType::PlainMatrixType matrix(_matrix); // let's extract from the 2 first colums a 2x2 block whose determinant is as big as possible. - int good_row0=0, good_row1=1; - RealScalar good_absdet(-1); - // this double for loop shouldn't be too costly: only 6 iterations - for(int row0=0; row0<4; ++row0) { - for(int row1=row0+1; row1<4; ++row1) - { - RealScalar absdet = ei_abs(matrix.coeff(row0,0)*matrix.coeff(row1,1) - - matrix.coeff(row0,1)*matrix.coeff(row1,0)); - if(absdet > good_absdet) - { - good_absdet = absdet; - good_row0 = row0; - good_row1 = row1; - } - } - } + int good_row0, good_row1, good_i; + Matrix absdet; + + // any 2x2 block with determinant above this threshold will be considered good enough + RealScalar d = (matrix.col(0).squaredNorm()+matrix.col(1).squaredNorm()) * RealScalar(1e-2); + #define ei_inv_size4_helper_macro(i,row0,row1) \ + absdet[i] = ei_abs(matrix.coeff(row0,0)*matrix.coeff(row1,1) \ + - matrix.coeff(row0,1)*matrix.coeff(row1,0)); \ + if(absdet[i] > d) { good_row0=row0; good_row1=row1; goto good; } + ei_inv_size4_helper_macro(0,0,1) + ei_inv_size4_helper_macro(1,0,2) + ei_inv_size4_helper_macro(2,0,3) + ei_inv_size4_helper_macro(3,1,2) + ei_inv_size4_helper_macro(4,1,3) + ei_inv_size4_helper_macro(5,2,3) + + // no 2x2 block has determinant bigger than the threshold. So just take the one that + // has the biggest determinant + absdet.maxCoeff(&good_i); + good_row0 = good_i <= 2 ? 0 : good_i <= 4 ? 1 : 2; + good_row1 = good_i <= 2 ? good_i+1 : good_i <= 4 ? good_i-1 : 3; + + // now good_row0 and good_row1 are correctly set + good: + // do row permutations to move this 2x2 block to the top matrix.row(0).swap(matrix.row(good_row0)); matrix.row(1).swap(matrix.row(good_row1)); @@ -318,12 +327,12 @@ struct ei_inverse_impl : public ReturnByValue > * \returns the matrix inverse of this matrix. * * For small fixed sizes up to 4x4, this method uses ad-hoc methods (cofactors up to 3x3, Euler's trick for 4x4). - * In the general case, this method uses class PartialLU. + * In the general case, this method uses class PartialPivLU. * * \note This matrix must be invertible, otherwise the result is undefined. If you need an * invertibility check, do the following: * \li for fixed sizes up to 4x4, use computeInverseAndDetWithCheck(). - * \li for the general case, use class LU. + * \li for the general case, use class FullPivLU. * * Example: \include MatrixBase_inverse.cpp * Output: \verbinclude MatrixBase_inverse.out diff --git a/Eigen/src/LU/PartialLU.h b/Eigen/src/LU/PartialPivLU.h similarity index 88% rename from Eigen/src/LU/PartialLU.h rename to Eigen/src/LU/PartialPivLU.h index e8d21e5ad..647ada38f 100644 --- a/Eigen/src/LU/PartialLU.h +++ b/Eigen/src/LU/PartialPivLU.h @@ -30,7 +30,7 @@ template struct ei_partiallu_solve_impl; /** \ingroup LU_Module * - * \class PartialLU + * \class PartialPivLU * * \brief LU decomposition of a matrix with partial pivoting, and related features * @@ -46,10 +46,10 @@ template struct ei_partiallu_solve_impl; * matrix is invertible: it is your task to check that you only use this decomposition on invertible matrices. * * The guaranteed safe alternative, working for all matrices, is the full pivoting LU decomposition, provided - * by class LU. + * by class FullPivLU. * * This is \b not a rank-revealing LU decomposition. Many features are intentionally absent from this class, - * such as rank computation. If you need these features, use class LU. + * such as rank computation. If you need these features, use class FullPivLU. * * This LU decomposition is suitable to invert invertible matrices. It is what MatrixBase::inverse() uses * in the general case. @@ -57,9 +57,9 @@ template struct ei_partiallu_solve_impl; * * The data of the LU decomposition can be directly accessed through the methods matrixLU(), permutationP(). * - * \sa MatrixBase::partialLu(), MatrixBase::determinant(), MatrixBase::inverse(), MatrixBase::computeInverse(), class LU + * \sa MatrixBase::partialPivLu(), MatrixBase::determinant(), MatrixBase::inverse(), MatrixBase::computeInverse(), class FullPivLU */ -template class PartialLU +template class PartialPivLU { public: @@ -79,40 +79,40 @@ template class PartialLU * \brief Default Constructor. * * The default constructor is useful in cases in which the user intends to - * perform decompositions via PartialLU::compute(const MatrixType&). + * perform decompositions via PartialPivLU::compute(const MatrixType&). */ - PartialLU(); + PartialPivLU(); /** Constructor. * * \param matrix the matrix of which to compute the LU decomposition. * * \warning The matrix should have full rank (e.g. if it's square, it should be invertible). - * If you need to deal with non-full rank, use class LU instead. + * If you need to deal with non-full rank, use class FullPivLU instead. */ - PartialLU(const MatrixType& matrix); + PartialPivLU(const MatrixType& matrix); - PartialLU& compute(const MatrixType& matrix); + PartialPivLU& compute(const MatrixType& matrix); /** \returns the LU decomposition matrix: the upper-triangular part is U, the * unit-lower-triangular part is L (at least for square matrices; in the non-square - * case, special care is needed, see the documentation of class LU). + * case, special care is needed, see the documentation of class FullPivLU). * * \sa matrixL(), matrixU() */ inline const MatrixType& matrixLU() const { - ei_assert(m_isInitialized && "PartialLU is not initialized."); + ei_assert(m_isInitialized && "PartialPivLU is not initialized."); return m_lu; } /** \returns a vector of integers, whose size is the number of rows of the matrix being decomposed, * representing the P permutation i.e. the permutation of the rows. For its precise meaning, - * see the examples given in the documentation of class LU. + * see the examples given in the documentation of class FullPivLU. */ inline const IntColVectorType& permutationP() const { - ei_assert(m_isInitialized && "PartialLU is not initialized."); + ei_assert(m_isInitialized && "PartialPivLU is not initialized."); return m_p; } @@ -125,10 +125,10 @@ template class PartialLU * * \returns the solution. * - * Example: \include PartialLU_solve.cpp - * Output: \verbinclude PartialLU_solve.out + * Example: \include PartialPivLU_solve.cpp + * Output: \verbinclude PartialPivLU_solve.out * - * Since this PartialLU class assumes anyway that the matrix A is invertible, the solution + * Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution * theoretically exists and is unique regardless of b. * * \note_about_checking_solutions @@ -146,7 +146,7 @@ template class PartialLU /** \returns the inverse of the matrix of which *this is the LU decomposition. * * \warning The matrix being decomposed here is assumed to be invertible. If you need to check for - * invertibility, use class LU instead. + * invertibility, use class FullPivLU instead. * * \sa MatrixBase::inverse(), LU::inverse() */ @@ -180,7 +180,7 @@ template class PartialLU }; template -PartialLU::PartialLU() +PartialPivLU::PartialPivLU() : m_lu(), m_p(), m_det_p(0), @@ -189,7 +189,7 @@ PartialLU::PartialLU() } template -PartialLU::PartialLU(const MatrixType& matrix) +PartialPivLU::PartialPivLU(const MatrixType& matrix) : m_lu(), m_p(), m_det_p(0), @@ -378,12 +378,12 @@ void ei_partial_lu_inplace(MatrixType& lu, IntVector& row_transpositions, int& n } template -PartialLU& PartialLU::compute(const MatrixType& matrix) +PartialPivLU& PartialPivLU::compute(const MatrixType& matrix) { m_lu = matrix; m_p.resize(matrix.rows()); - ei_assert(matrix.rows() == matrix.cols() && "PartialLU is only for square (and moreover invertible) matrices"); + ei_assert(matrix.rows() == matrix.cols() && "PartialPivLU is only for square (and moreover invertible) matrices"); const int size = matrix.rows(); IntColVectorType rows_transpositions(size); @@ -401,9 +401,9 @@ PartialLU& PartialLU::compute(const MatrixType& matrix) } template -typename ei_traits::Scalar PartialLU::determinant() const +typename ei_traits::Scalar PartialPivLU::determinant() const { - ei_assert(m_isInitialized && "PartialLU is not initialized."); + ei_assert(m_isInitialized && "PartialPivLU is not initialized."); return Scalar(m_det_p) * m_lu.diagonal().prod(); } @@ -424,7 +424,7 @@ template struct ei_partiallu_solve_impl : public ReturnByValue > { typedef typename ei_cleantype::type RhsNested; - typedef PartialLU LUType; + typedef PartialPivLU LUType; const LUType& m_lu; const typename Rhs::Nested m_rhs; @@ -464,15 +464,30 @@ struct ei_partiallu_solve_impl : public ReturnByValue -inline const PartialLU::PlainMatrixType> -MatrixBase::partialLu() const +inline const PartialPivLU::PlainMatrixType> +MatrixBase::partialPivLu() const { - return PartialLU(eval()); + return PartialPivLU(eval()); +} + +/** \lu_module + * + * Synonym of partialPivLu(). + * + * \return the partial-pivoting LU decomposition of \c *this. + * + * \sa class PartialPivLU + */ +template +inline const PartialPivLU::PlainMatrixType> +MatrixBase::lu() const +{ + return PartialPivLU(eval()); } #endif // EIGEN_PARTIALLU_H diff --git a/Eigen/src/QR/ColPivotingHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h similarity index 85% rename from Eigen/src/QR/ColPivotingHouseholderQR.h rename to Eigen/src/QR/ColPivHouseholderQR.h index b141da0aa..05287ff3c 100644 --- a/Eigen/src/QR/ColPivotingHouseholderQR.h +++ b/Eigen/src/QR/ColPivHouseholderQR.h @@ -29,7 +29,7 @@ /** \ingroup QR_Module * \nonstableyet * - * \class ColPivotingHouseholderQR + * \class ColPivHouseholderQR * * \brief Householder rank-revealing QR decomposition of a matrix with column-pivoting * @@ -38,11 +38,11 @@ * This class performs a rank-revealing QR decomposition using Householder transformations. * * This decomposition performs column pivoting in order to be rank-revealing and improve - * numerical stability. It is slower than HouseholderQR, and faster than FullPivotingHouseholderQR. + * numerical stability. It is slower than HouseholderQR, and faster than FullPivHouseholderQR. * - * \sa MatrixBase::colPivotingHouseholderQr() + * \sa MatrixBase::colPivHouseholderQr() */ -template class ColPivotingHouseholderQR +template class ColPivHouseholderQR { public: @@ -68,11 +68,11 @@ template class ColPivotingHouseholderQR * \brief Default Constructor. * * The default constructor is useful in cases in which the user intends to - * perform decompositions via ColPivotingHouseholderQR::compute(const MatrixType&). + * perform decompositions via ColPivHouseholderQR::compute(const MatrixType&). */ - ColPivotingHouseholderQR() : m_qr(), m_hCoeffs(), m_isInitialized(false) {} + ColPivHouseholderQR() : m_qr(), m_hCoeffs(), m_isInitialized(false) {} - ColPivotingHouseholderQR(const MatrixType& matrix) + ColPivHouseholderQR(const MatrixType& matrix) : m_qr(matrix.rows(), matrix.cols()), m_hCoeffs(std::min(matrix.rows(),matrix.cols())), m_isInitialized(false) @@ -94,8 +94,8 @@ template class ColPivotingHouseholderQR * \note The case where b is a matrix is not yet implemented. Also, this * code is space inefficient. * - * Example: \include ColPivotingHouseholderQR_solve.cpp - * Output: \verbinclude ColPivotingHouseholderQR_solve.out + * Example: \include ColPivHouseholderQR_solve.cpp + * Output: \verbinclude ColPivHouseholderQR_solve.out */ template bool solve(const MatrixBase& b, ResultType *result) const; @@ -106,15 +106,15 @@ template class ColPivotingHouseholderQR */ const MatrixType& matrixQR() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return m_qr; } - ColPivotingHouseholderQR& compute(const MatrixType& matrix); + ColPivHouseholderQR& compute(const MatrixType& matrix); const IntRowVectorType& colsPermutation() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return m_cols_permutation; } @@ -154,7 +154,7 @@ template class ColPivotingHouseholderQR */ inline int rank() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return m_rank; } @@ -165,7 +165,7 @@ template class ColPivotingHouseholderQR */ inline int dimensionOfKernel() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return m_qr.cols() - m_rank; } @@ -177,7 +177,7 @@ template class ColPivotingHouseholderQR */ inline bool isInjective() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return m_rank == m_qr.cols(); } @@ -189,7 +189,7 @@ template class ColPivotingHouseholderQR */ inline bool isSurjective() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return m_rank == m_qr.rows(); } @@ -200,7 +200,7 @@ template class ColPivotingHouseholderQR */ inline bool isInvertible() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return isInjective() && isSurjective(); } @@ -215,7 +215,7 @@ template class ColPivotingHouseholderQR */ inline void computeInverse(MatrixType *result) const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); ei_assert(m_qr.rows() == m_qr.cols() && "You can't take the inverse of a non-square matrix!"); solve(MatrixType::Identity(m_qr.rows(), m_qr.cols()), result); } @@ -247,23 +247,23 @@ template class ColPivotingHouseholderQR #ifndef EIGEN_HIDE_HEAVY_CODE template -typename MatrixType::RealScalar ColPivotingHouseholderQR::absDeterminant() const +typename MatrixType::RealScalar ColPivHouseholderQR::absDeterminant() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); ei_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); return ei_abs(m_qr.diagonal().prod()); } template -typename MatrixType::RealScalar ColPivotingHouseholderQR::logAbsDeterminant() const +typename MatrixType::RealScalar ColPivHouseholderQR::logAbsDeterminant() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); ei_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); return m_qr.diagonal().cwise().abs().cwise().log().sum(); } template -ColPivotingHouseholderQR& ColPivotingHouseholderQR::compute(const MatrixType& matrix) +ColPivHouseholderQR& ColPivHouseholderQR::compute(const MatrixType& matrix) { int rows = matrix.rows(); int cols = matrix.cols(); @@ -333,12 +333,12 @@ ColPivotingHouseholderQR& ColPivotingHouseholderQR::comp template template -bool ColPivotingHouseholderQR::solve( +bool ColPivHouseholderQR::solve( const MatrixBase& b, ResultType *result ) const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); result->resize(m_qr.cols(), b.cols()); if(m_rank==0) { @@ -378,9 +378,9 @@ bool ColPivotingHouseholderQR::solve( /** \returns the matrix Q as a sequence of householder transformations */ template -typename ColPivotingHouseholderQR::HouseholderSequenceType ColPivotingHouseholderQR::matrixQ() const +typename ColPivHouseholderQR::HouseholderSequenceType ColPivHouseholderQR::matrixQ() const { - ei_assert(m_isInitialized && "ColPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); return HouseholderSequenceType(m_qr, m_hCoeffs.conjugate()); } @@ -388,13 +388,13 @@ typename ColPivotingHouseholderQR::HouseholderSequenceType ColPivoti /** \return the column-pivoting Householder QR decomposition of \c *this. * - * \sa class ColPivotingHouseholderQR + * \sa class ColPivHouseholderQR */ template -const ColPivotingHouseholderQR::PlainMatrixType> -MatrixBase::colPivotingHouseholderQr() const +const ColPivHouseholderQR::PlainMatrixType> +MatrixBase::colPivHouseholderQr() const { - return ColPivotingHouseholderQR(eval()); + return ColPivHouseholderQR(eval()); } diff --git a/Eigen/src/QR/FullPivotingHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h similarity index 85% rename from Eigen/src/QR/FullPivotingHouseholderQR.h rename to Eigen/src/QR/FullPivHouseholderQR.h index 9fee77803..07ec343a5 100644 --- a/Eigen/src/QR/FullPivotingHouseholderQR.h +++ b/Eigen/src/QR/FullPivHouseholderQR.h @@ -29,7 +29,7 @@ /** \ingroup QR_Module * \nonstableyet * - * \class FullPivotingHouseholderQR + * \class FullPivHouseholderQR * * \brief Householder rank-revealing QR decomposition of a matrix with full pivoting * @@ -38,11 +38,11 @@ * This class performs a rank-revealing QR decomposition using Householder transformations. * * This decomposition performs a very prudent full pivoting in order to be rank-revealing and achieve optimal - * numerical stability. The trade-off is that it is slower than HouseholderQR and ColPivotingHouseholderQR. + * numerical stability. The trade-off is that it is slower than HouseholderQR and ColPivHouseholderQR. * - * \sa MatrixBase::fullPivotingHouseholderQr() + * \sa MatrixBase::fullPivHouseholderQr() */ -template class FullPivotingHouseholderQR +template class FullPivHouseholderQR { public: @@ -65,11 +65,11 @@ template class FullPivotingHouseholderQR /** \brief Default Constructor. * * The default constructor is useful in cases in which the user intends to - * perform decompositions via FullPivotingHouseholderQR::compute(const MatrixType&). + * perform decompositions via FullPivHouseholderQR::compute(const MatrixType&). */ - FullPivotingHouseholderQR() : m_isInitialized(false) {} + FullPivHouseholderQR() : m_isInitialized(false) {} - FullPivotingHouseholderQR(const MatrixType& matrix) + FullPivHouseholderQR(const MatrixType& matrix) : m_isInitialized(false) { compute(matrix); @@ -89,8 +89,8 @@ template class FullPivotingHouseholderQR * \note The case where b is a matrix is not yet implemented. Also, this * code is space inefficient. * - * Example: \include FullPivotingHouseholderQR_solve.cpp - * Output: \verbinclude FullPivotingHouseholderQR_solve.out + * Example: \include FullPivHouseholderQR_solve.cpp + * Output: \verbinclude FullPivHouseholderQR_solve.out */ template bool solve(const MatrixBase& b, ResultType *result) const; @@ -101,21 +101,21 @@ template class FullPivotingHouseholderQR */ const MatrixType& matrixQR() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return m_qr; } - FullPivotingHouseholderQR& compute(const MatrixType& matrix); + FullPivHouseholderQR& compute(const MatrixType& matrix); const IntRowVectorType& colsPermutation() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return m_cols_permutation; } const IntColVectorType& rowsTranspositions() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return m_rows_transpositions; } @@ -155,7 +155,7 @@ template class FullPivotingHouseholderQR */ inline int rank() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return m_rank; } @@ -166,7 +166,7 @@ template class FullPivotingHouseholderQR */ inline int dimensionOfKernel() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return m_qr.cols() - m_rank; } @@ -178,7 +178,7 @@ template class FullPivotingHouseholderQR */ inline bool isInjective() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return m_rank == m_qr.cols(); } @@ -190,7 +190,7 @@ template class FullPivotingHouseholderQR */ inline bool isSurjective() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return m_rank == m_qr.rows(); } @@ -201,7 +201,7 @@ template class FullPivotingHouseholderQR */ inline bool isInvertible() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return isInjective() && isSurjective(); } @@ -216,7 +216,7 @@ template class FullPivotingHouseholderQR */ inline void computeInverse(MatrixType *result) const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); ei_assert(m_qr.rows() == m_qr.cols() && "You can't take the inverse of a non-square matrix!"); solve(MatrixType::Identity(m_qr.rows(), m_qr.cols()), result); } @@ -249,23 +249,23 @@ template class FullPivotingHouseholderQR #ifndef EIGEN_HIDE_HEAVY_CODE template -typename MatrixType::RealScalar FullPivotingHouseholderQR::absDeterminant() const +typename MatrixType::RealScalar FullPivHouseholderQR::absDeterminant() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); ei_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); return ei_abs(m_qr.diagonal().prod()); } template -typename MatrixType::RealScalar FullPivotingHouseholderQR::logAbsDeterminant() const +typename MatrixType::RealScalar FullPivHouseholderQR::logAbsDeterminant() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); ei_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); return m_qr.diagonal().cwise().abs().cwise().log().sum(); } template -FullPivotingHouseholderQR& FullPivotingHouseholderQR::compute(const MatrixType& matrix) +FullPivHouseholderQR& FullPivHouseholderQR::compute(const MatrixType& matrix) { int rows = matrix.rows(); int cols = matrix.cols(); @@ -342,12 +342,12 @@ FullPivotingHouseholderQR& FullPivotingHouseholderQR::co template template -bool FullPivotingHouseholderQR::solve( +bool FullPivHouseholderQR::solve( const MatrixBase& b, ResultType *result ) const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); result->resize(m_qr.cols(), b.cols()); if(m_rank==0) { @@ -393,9 +393,9 @@ bool FullPivotingHouseholderQR::solve( /** \returns the matrix Q */ template -typename FullPivotingHouseholderQR::MatrixQType FullPivotingHouseholderQR::matrixQ() const +typename FullPivHouseholderQR::MatrixQType FullPivHouseholderQR::matrixQ() const { - ei_assert(m_isInitialized && "FullPivotingHouseholderQR is not initialized."); + ei_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); // compute the product H'_0 H'_1 ... H'_n-1, // where H_k is the k-th Householder transformation I - h_k v_k v_k' // and v_k is the k-th Householder vector [1,m_qr(k+1,k), m_qr(k+2,k), ...] @@ -417,13 +417,13 @@ typename FullPivotingHouseholderQR::MatrixQType FullPivotingHousehol /** \return the full-pivoting Householder QR decomposition of \c *this. * - * \sa class FullPivotingHouseholderQR + * \sa class FullPivHouseholderQR */ template -const FullPivotingHouseholderQR::PlainMatrixType> -MatrixBase::fullPivotingHouseholderQr() const +const FullPivHouseholderQR::PlainMatrixType> +MatrixBase::fullPivHouseholderQr() const { - return FullPivotingHouseholderQR(eval()); + return FullPivHouseholderQR(eval()); } #endif // EIGEN_FULLPIVOTINGHOUSEHOLDERQR_H diff --git a/Eigen/src/QR/HouseholderQR.h b/Eigen/src/QR/HouseholderQR.h index 01cd2adb5..a32aa4eaf 100644 --- a/Eigen/src/QR/HouseholderQR.h +++ b/Eigen/src/QR/HouseholderQR.h @@ -39,10 +39,10 @@ * stored in a compact way compatible with LAPACK. * * Note that no pivoting is performed. This is \b not a rank-revealing decomposition. - * If you want that feature, use FullPivotingHouseholderQR or ColPivotingHouseholderQR instead. + * If you want that feature, use FullPivHouseholderQR or ColPivHouseholderQR instead. * * This Householder QR decomposition is faster, but less numerically stable and less feature-full than - * FullPivotingHouseholderQR or ColPivotingHouseholderQR. + * FullPivHouseholderQR or ColPivHouseholderQR. * * \sa MatrixBase::householderQr() */ diff --git a/Eigen/src/SVD/JacobiSVD.h b/Eigen/src/SVD/JacobiSVD.h index 6a0597893..927ef6591 100644 --- a/Eigen/src/SVD/JacobiSVD.h +++ b/Eigen/src/SVD/JacobiSVD.h @@ -233,7 +233,7 @@ struct ei_svd_precondition_if_more_rows_than_cols int diagSize = cols; if(rows > cols) { - FullPivotingHouseholderQR qr(matrix); + FullPivHouseholderQR qr(matrix); work_matrix = qr.matrixQR().block(0,0,diagSize,diagSize).template triangularView(); if(ComputeU) svd.m_matrixU = qr.matrixQ(); if(ComputeV) @@ -278,7 +278,7 @@ struct ei_svd_precondition_if_more_cols_than_rows typedef Matrix TransposeTypeWithSameStorageOrder; - FullPivotingHouseholderQR qr(matrix.adjoint()); + FullPivHouseholderQR qr(matrix.adjoint()); work_matrix = qr.matrixQR().block(0,0,diagSize,diagSize).template triangularView().adjoint(); if(ComputeV) svd.m_matrixV = qr.matrixQ(); if(ComputeU) diff --git a/Eigen/src/Sparse/SparseLU.h b/Eigen/src/Sparse/SparseLU.h index e7191b7ab..3f8d0f8db 100644 --- a/Eigen/src/Sparse/SparseLU.h +++ b/Eigen/src/Sparse/SparseLU.h @@ -39,7 +39,7 @@ enum { * * \param MatrixType the type of the matrix of which we are computing the LU factorization * - * \sa class LU, class SparseLLT + * \sa class FullPivLU, class SparseLLT */ template class SparseLU diff --git a/bench/btl/libs/eigen2/eigen2_interface.hh b/bench/btl/libs/eigen2/eigen2_interface.hh index 1a5f89834..f93ccad58 100644 --- a/bench/btl/libs/eigen2/eigen2_interface.hh +++ b/bench/btl/libs/eigen2/eigen2_interface.hh @@ -218,7 +218,7 @@ public : } static inline void partial_lu_decomp(const gene_matrix & X, gene_matrix & C, int N){ - C = X.partialLu().matrixLU(); + C = X.partialPivLu().matrixLU(); } static inline void tridiagonalization(const gene_matrix & X, gene_matrix & C, int N){ diff --git a/bench/sparse_lu.cpp b/bench/sparse_lu.cpp index bb73d481d..5c7500182 100644 --- a/bench/sparse_lu.cpp +++ b/bench/sparse_lu.cpp @@ -98,7 +98,7 @@ int main(int argc, char *argv[]) BenchTimer timer; timer.start(); - LU lu(m1); + FullPivLU lu(m1); timer.stop(); std::cout << "Eigen/dense:\t" << timer.value() << endl; diff --git a/cmake/EigenTesting.cmake b/cmake/EigenTesting.cmake index 22aea3d0d..bb272a8cc 100644 --- a/cmake/EigenTesting.cmake +++ b/cmake/EigenTesting.cmake @@ -70,6 +70,10 @@ macro(ei_add_test_internal testname testname_with_suffix) # for the debug target, add full debug options if(CMAKE_COMPILER_IS_GNUCXX) + # disable debug symbols: i get 2 GB of them! + # the user can still use the debug targets as needed. + # for MSVC, the equivalent (release mode) does the same. + ei_add_target_property(${targetname} COMPILE_FLAGS "-g0") # O0 is in principle redundant here, but doesn't hurt ei_add_target_property(${debug_targetname} COMPILE_FLAGS "-O0 -g3") elseif(MSVC) @@ -139,7 +143,7 @@ endmacro(ei_add_test_internal) # B. Multi-part behavior # # If the source file matches the regexp -# CALL_SUBTEST[0-9]+|EIGEN_TEST_PART_[0-9]+ +# CALL_SUBTEST(-9]+|EIGEN_TEST_PART_[0-9]+ # then it is interpreted as a multi-part test. The behavior then depends on the # CMake option EIGEN_SPLIT_LARGE_TESTS, which is ON by default. # @@ -162,33 +166,31 @@ endmacro(ei_add_test_internal) macro(ei_add_test testname) file(READ "${testname}.cpp" test_source) set(parts 0) - string(REGEX MATCHALL "CALL_SUBTEST[0-9]+|EIGEN_TEST_PART_[0-9]+" occurences "${test_source}") - foreach(occurence ${occurences}) - string(REGEX MATCH "([0-9]+)" _number_in_occurence "${occurence}") - set(number ${CMAKE_MATCH_1}) - if(${number} GREATER ${parts}) - set(parts ${number}) - endif(${number} GREATER ${parts}) - endforeach(occurence) - if(EIGEN_SPLIT_LARGE_TESTS AND (parts GREATER 0)) + string(REGEX MATCHALL "CALL_SUBTEST_[0-9]+|EIGEN_TEST_PART_[0-9]+" + occurences "${test_source}") + string(REGEX REPLACE "CALL_SUBTEST_|EIGEN_TEST_PART_" "" suffixes "${occurences}") + list(REMOVE_DUPLICATES suffixes) + if(EIGEN_SPLIT_LARGE_TESTS AND suffixes) add_custom_target(test_${testname}) if(NOT MSVC_IDE) add_custom_target(debug_${testname}) endif(NOT MSVC_IDE) - foreach(part RANGE 1 ${parts}) - ei_add_test_internal(${testname} ${testname}_${part} "${ARGV1} -DEIGEN_TEST_PART_${part}" "${ARGV2}") - add_dependencies(test_${testname} test_${testname}_${part}) + foreach(suffix ${suffixes}) + ei_add_test_internal(${testname} ${testname}_${suffix} + "${ARGV1} -DEIGEN_TEST_PART_${suffix}=1" "${ARGV2}") + add_dependencies(test_${testname} test_${testname}_${suffix}) if(NOT MSVC_IDE) - add_dependencies(debug_${testname} debug_${testname}_${part}) + add_dependencies(debug_${testname} debug_${testname}_${suffix}) endif(NOT MSVC_IDE) - endforeach(part) - else(EIGEN_SPLIT_LARGE_TESTS AND (parts GREATER 0)) + endforeach(suffix) + else(EIGEN_SPLIT_LARGE_TESTS AND suffixes) set(symbols_to_enable_all_parts "") - foreach(part RANGE 1 ${parts}) - set(symbols_to_enable_all_parts "${symbols_to_enable_all_parts} -DEIGEN_TEST_PART_${part}") - endforeach(part) + foreach(suffix ${suffixes}) + set(symbols_to_enable_all_parts + "${symbols_to_enable_all_parts} -DEIGEN_TEST_PART_${suffix}=1") + endforeach(suffix) ei_add_test_internal(${testname} ${testname} "${ARGV1} ${symbols_to_enable_all_parts}" "${ARGV2}") - endif(EIGEN_SPLIT_LARGE_TESTS AND (parts GREATER 0)) + endif(EIGEN_SPLIT_LARGE_TESTS AND suffixes) endmacro(ei_add_test) # print a summary of the different options diff --git a/doc/C05_TutorialLinearAlgebra.dox b/doc/C05_TutorialLinearAlgebra.dox index fbf809d58..c50e9c6bc 100644 --- a/doc/C05_TutorialLinearAlgebra.dox +++ b/doc/C05_TutorialLinearAlgebra.dox @@ -55,8 +55,8 @@ matrix with a vector or another matrix: \f$ A^{-1} \mathbf{v} \f$ or \f$ A^{-1} This is a general-purpose algorithm which performs well in most cases (provided the matrix \f$ A \f$ is invertible), so if you are unsure about which algorithm to pick, choose this. The method proceeds in two steps. First, the %LU decomposition with partial pivoting is computed using the -MatrixBase::partialLu() function. This yields an object of the class PartialLU. Then, the -PartialLU::solve() method is called to compute a solution. +MatrixBase::partialPivLu() function. This yields an object of the class PartialPivLU. Then, the +PartialPivLU::solve() method is called to compute a solution. As an example, suppose we want to solve the following system of linear equations: @@ -69,9 +69,9 @@ As an example, suppose we want to solve the following system of linear equations The following program solves this system:
-\include Tutorial_PartialLU_solve.cpp +\include Tutorial_PartialPivLU_solve.cpp -output: \include Tutorial_PartialLU_solve.out +output: \include Tutorial_PartialPivLU_solve.out
There are many situations in which we want to solve the same system of equations with different @@ -91,7 +91,7 @@ problem, and whether you want to solve it at all, after you solved the first pro case, it's best to save the %LU decomposition and reuse it to solve the second problem. This is worth the effort because computing the %LU decomposition is much more expensive than using it to solve the equation. Here is some code to illustrate the procedure. It uses the constructor -PartialLU::PartialLU(const MatrixType&) to compute the %LU decomposition. +PartialPivLU::PartialPivLU(const MatrixType&) to compute the %LU decomposition.
\include Tutorial_solve_reuse_decomposition.cpp @@ -102,7 +102,7 @@ output: \include Tutorial_solve_reuse_decomposition.out \b Warning: All this code presumes that the matrix \f$ A \f$ is invertible, so that the system \f$ A \mathbf{x} = \mathbf{b} \f$ has a unique solution. If the matrix \f$ A \f$ is not invertible, then the system \f$ A \mathbf{x} = \mathbf{b} \f$ has either zero or infinitely many solutions. In -both cases, PartialLU::solve() will give nonsense results. For example, suppose that we want to +both cases, PartialPivLU::solve() will give nonsense results. For example, suppose that we want to solve the same system as above, but with the 10 in the last equation replaced by 9. Then the system of equations is inconsistent: adding the first and the third equation gives \f$ 8x + 10y + 12z = 7 \f$, which implies \f$ 4x + 5y + 6z = 3\frac12 \f$, in contradiction with the second equation. If we try @@ -114,10 +114,10 @@ to solve this inconsistent system with Eigen, we find: output: \include Tutorial_solve_singular.out
-The %LU decomposition with \b full pivoting (class LU) and the singular value decomposition (class +The %LU decomposition with \b full pivoting (class FullPivLU) and the singular value decomposition (class SVD) may be helpful in this case, as explained in the section \ref TutorialAdvSolvers_Misc below. -\sa LU_Module, MatrixBase::partialLu(), PartialLU::solve(), class PartialLU. +\sa LU_Module, MatrixBase::partialPivLu(), PartialPivLU::solve(), class PartialPivLU. \subsection TutorialAdvSolvers_Cholesky Cholesky decomposition @@ -228,7 +228,7 @@ Note that the function inverse() is defined in the \ref LU_Module. Finally, Eigen also offer solvers based on a singular value decomposition (%SVD) or the %LU decomposition with full pivoting. These have the same API as the solvers based on the %LU -decomposition with partial pivoting (PartialLU). +decomposition with partial pivoting (PartialPivLU). The solver based on the %SVD uses the class SVD. It can handle singular matrices. Here is an example of its use: @@ -245,7 +245,7 @@ svdOfA.solve(b, &x); \endcode %LU decomposition with full pivoting has better numerical stability than %LU decomposition with -partial pivoting. It is defined in the class LU. The solver can also handle singular matrices. +partial pivoting. It is defined in the class FullPivLU. The solver can also handle singular matrices. \code #include @@ -254,13 +254,13 @@ MatrixXf A = MatrixXf::Random(20,20); VectorXf b = VectorXf::Random(20); VectorXf x; A.lu().solve(b, &x); -LU luOfA(A); +FullPivLU luOfA(A); luOfA.solve(b, &x); \endcode See the section \ref TutorialAdvLU below. -\sa class SVD, SVD::solve(), SVD_Module, class LU, LU::solve(), LU_Module. +\sa class SVD, SVD::solve(), SVD_Module, class FullPivLU, LU::solve(), LU_Module. @@ -281,7 +281,7 @@ Alternatively, you can construct a named LU decomposition, which allows you to r \code #include MatrixXf A = MatrixXf::Random(20,20); -Eigen::LU lu(A); +Eigen::FullPivLU lu(A); cout << "The rank of A is" << lu.rank() << endl; if(lu.isInvertible()) { cout << "A is invertible, its inverse is:" << endl << lu.inverse() << endl; @@ -292,7 +292,7 @@ else { } \endcode -\sa LU_Module, LU::solve(), class LU +\sa LU_Module, LU::solve(), class FullPivLU top\section TutorialAdvCholesky Cholesky todo diff --git a/doc/examples/Tutorial_PartialLU_solve.cpp b/doc/examples/Tutorial_PartialLU_solve.cpp index 4cbd8c10d..98f9d6dac 100644 --- a/doc/examples/Tutorial_PartialLU_solve.cpp +++ b/doc/examples/Tutorial_PartialLU_solve.cpp @@ -12,6 +12,6 @@ int main(int, char *[]) b << 3, 3, 4; cout << "Here is the matrix A:" << endl << A << endl; cout << "Here is the vector b:" << endl << b << endl; - Vector3f x = A.partialLu().solve(b); + Vector3f x = A.lu().solve(b); cout << "The solution is:" << endl << x << endl; } diff --git a/doc/snippets/LU_image.cpp b/doc/snippets/FullPivLU_image.cpp similarity index 100% rename from doc/snippets/LU_image.cpp rename to doc/snippets/FullPivLU_image.cpp diff --git a/doc/snippets/LU_kernel.cpp b/doc/snippets/FullPivLU_kernel.cpp similarity index 100% rename from doc/snippets/LU_kernel.cpp rename to doc/snippets/FullPivLU_kernel.cpp diff --git a/doc/snippets/LU_solve.cpp b/doc/snippets/FullPivLU_solve.cpp similarity index 100% rename from doc/snippets/LU_solve.cpp rename to doc/snippets/FullPivLU_solve.cpp diff --git a/doc/snippets/PartialLU_solve.cpp b/doc/snippets/PartialLU_solve.cpp index 69e788dc4..fa3570ab8 100644 --- a/doc/snippets/PartialLU_solve.cpp +++ b/doc/snippets/PartialLU_solve.cpp @@ -2,6 +2,6 @@ MatrixXd A = MatrixXd::Random(3,3); MatrixXd B = MatrixXd::Random(3,2); cout << "Here is the invertible matrix A:" << endl << A << endl; cout << "Here is the matrix B:" << endl << B << endl; -MatrixXd X = A.partialLu().solve(B); +MatrixXd X = A.lu().solve(B); cout << "Here is the (unique) solution X to the equation AX=B:" << endl << X << endl; cout << "Relative error: " << (A*X-B).norm() / B.norm() << endl; diff --git a/doc/snippets/Tutorial_solve_multiple_rhs.cpp b/doc/snippets/Tutorial_solve_multiple_rhs.cpp index 1ffcc61f0..72dab9075 100644 --- a/doc/snippets/Tutorial_solve_multiple_rhs.cpp +++ b/doc/snippets/Tutorial_solve_multiple_rhs.cpp @@ -3,7 +3,7 @@ A << 1,2,3, 4,5,6, 7,8,10; Matrix B; B << 3,1, 3,1, 4,1; Matrix X; -X = A.partialLu().solve(B); +X = A.lu().solve(B); cout << "The solution with right-hand side (3,3,4) is:" << endl; cout << X.col(0) << endl; cout << "The solution with right-hand side (1,1,1) is:" << endl; diff --git a/doc/snippets/Tutorial_solve_reuse_decomposition.cpp b/doc/snippets/Tutorial_solve_reuse_decomposition.cpp index 1b8b0ae9e..3ca06453a 100644 --- a/doc/snippets/Tutorial_solve_reuse_decomposition.cpp +++ b/doc/snippets/Tutorial_solve_reuse_decomposition.cpp @@ -1,6 +1,6 @@ Matrix3f A(3,3); A << 1,2,3, 4,5,6, 7,8,10; -PartialLU luOfA(A); // compute LU decomposition of A +PartialPivLU luOfA(A); // compute LU decomposition of A Vector3f b; b << 3,3,4; Vector3f x; diff --git a/doc/snippets/Tutorial_solve_singular.cpp b/doc/snippets/Tutorial_solve_singular.cpp index f5f2d2f6a..abff1ef73 100644 --- a/doc/snippets/Tutorial_solve_singular.cpp +++ b/doc/snippets/Tutorial_solve_singular.cpp @@ -5,5 +5,5 @@ b << 3, 3, 4; cout << "Here is the matrix A:" << endl << A << endl; cout << "Here is the vector b:" << endl << b << endl; Vector3f x; -x = A.partialLu().solve(b); +x = A.lu().solve(b); cout << "The solution is:" << endl << x << endl; diff --git a/doc/snippets/class_LU.cpp b/doc/snippets/class_FullPivLU.cpp similarity index 95% rename from doc/snippets/class_LU.cpp rename to doc/snippets/class_FullPivLU.cpp index 9958368f1..40d76e8e6 100644 --- a/doc/snippets/class_LU.cpp +++ b/doc/snippets/class_FullPivLU.cpp @@ -2,7 +2,7 @@ typedef Matrix Matrix5x3; typedef Matrix Matrix5x5; Matrix5x3 m = Matrix5x3::Random(); cout << "Here is the matrix m:" << endl << m << endl; -Eigen::LU lu(m); +Eigen::FullPivLU lu(m); cout << "Here is, up to permutations, its LU decomposition matrix:" << endl << lu.matrixLU() << endl; cout << "Here is the L part:" << endl; diff --git a/test/adjoint.cpp b/test/adjoint.cpp index bebf47ac3..344399257 100644 --- a/test/adjoint.cpp +++ b/test/adjoint.cpp @@ -108,16 +108,17 @@ template void adjoint(const MatrixType& m) void test_adjoint() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( adjoint(Matrix()) ); - CALL_SUBTEST( adjoint(Matrix3d()) ); - CALL_SUBTEST( adjoint(Matrix4f()) ); - CALL_SUBTEST( adjoint(MatrixXcf(4, 4)) ); - CALL_SUBTEST( adjoint(MatrixXi(8, 12)) ); - CALL_SUBTEST( adjoint(MatrixXf(21, 21)) ); + CALL_SUBTEST_1( adjoint(Matrix()) ); + CALL_SUBTEST_2( adjoint(Matrix3d()) ); + CALL_SUBTEST_3( adjoint(Matrix4f()) ); + CALL_SUBTEST_4( adjoint(MatrixXcf(4, 4)) ); + CALL_SUBTEST_5( adjoint(MatrixXi(8, 12)) ); + CALL_SUBTEST_6( adjoint(MatrixXf(21, 21)) ); } // test a large matrix only once - CALL_SUBTEST( adjoint(Matrix()) ); + CALL_SUBTEST_7( adjoint(Matrix()) ); +#ifdef EIGEN_TEST_PART_4 { MatrixXcf a(10,10), b(10,10); VERIFY_RAISES_ASSERT(a = a.transpose()); @@ -128,5 +129,6 @@ void test_adjoint() VERIFY_RAISES_ASSERT(a = a.adjoint() + b); VERIFY_RAISES_ASSERT(a = b + a.adjoint()); } +#endif } diff --git a/test/array.cpp b/test/array.cpp index a308f7366..a18724d3a 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -146,26 +146,26 @@ template void lpNorm(const VectorType& v) void test_array() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( array(Matrix()) ); - CALL_SUBTEST( array(Matrix2f()) ); - CALL_SUBTEST( array(Matrix4d()) ); - CALL_SUBTEST( array(MatrixXcf(3, 3)) ); - CALL_SUBTEST( array(MatrixXf(8, 12)) ); - CALL_SUBTEST( array(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( array(Matrix()) ); + CALL_SUBTEST_2( array(Matrix2f()) ); + CALL_SUBTEST_3( array(Matrix4d()) ); + CALL_SUBTEST_4( array(MatrixXcf(3, 3)) ); + CALL_SUBTEST_5( array(MatrixXf(8, 12)) ); + CALL_SUBTEST_6( array(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( comparisons(Matrix()) ); - CALL_SUBTEST( comparisons(Matrix2f()) ); - CALL_SUBTEST( comparisons(Matrix4d()) ); - CALL_SUBTEST( comparisons(MatrixXf(8, 12)) ); - CALL_SUBTEST( comparisons(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( comparisons(Matrix()) ); + CALL_SUBTEST_2( comparisons(Matrix2f()) ); + CALL_SUBTEST_3( comparisons(Matrix4d()) ); + CALL_SUBTEST_5( comparisons(MatrixXf(8, 12)) ); + CALL_SUBTEST_6( comparisons(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( lpNorm(Matrix()) ); - CALL_SUBTEST( lpNorm(Vector2f()) ); - CALL_SUBTEST( lpNorm(Vector3d()) ); - CALL_SUBTEST( lpNorm(Vector4f()) ); - CALL_SUBTEST( lpNorm(VectorXf(16)) ); - CALL_SUBTEST( lpNorm(VectorXcd(10)) ); + CALL_SUBTEST_1( lpNorm(Matrix()) ); + CALL_SUBTEST_2( lpNorm(Vector2f()) ); + CALL_SUBTEST_7( lpNorm(Vector3d()) ); + CALL_SUBTEST_8( lpNorm(Vector4f()) ); + CALL_SUBTEST_5( lpNorm(VectorXf(16)) ); + CALL_SUBTEST_4( lpNorm(VectorXcf(10)) ); } } diff --git a/test/array_replicate.cpp b/test/array_replicate.cpp index cd0f65f26..a23ac7c6f 100644 --- a/test/array_replicate.cpp +++ b/test/array_replicate.cpp @@ -76,11 +76,11 @@ template void replicate(const MatrixType& m) void test_array_replicate() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( replicate(Matrix()) ); - CALL_SUBTEST( replicate(Vector2f()) ); - CALL_SUBTEST( replicate(Vector3d()) ); - CALL_SUBTEST( replicate(Vector4f()) ); - CALL_SUBTEST( replicate(VectorXf(16)) ); - CALL_SUBTEST( replicate(VectorXcd(10)) ); + CALL_SUBTEST_1( replicate(Matrix()) ); + CALL_SUBTEST_2( replicate(Vector2f()) ); + CALL_SUBTEST_3( replicate(Vector3d()) ); + CALL_SUBTEST_4( replicate(Vector4f()) ); + CALL_SUBTEST_5( replicate(VectorXf(16)) ); + CALL_SUBTEST_6( replicate(VectorXcd(10)) ); } } diff --git a/test/array_reverse.cpp b/test/array_reverse.cpp index e77842c7d..ccf8dcc87 100644 --- a/test/array_reverse.cpp +++ b/test/array_reverse.cpp @@ -163,19 +163,20 @@ template void reverse(const MatrixType& m) void test_array_reverse() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( reverse(Matrix()) ); - CALL_SUBTEST( reverse(Matrix2f()) ); - CALL_SUBTEST( reverse(Matrix4f()) ); - CALL_SUBTEST( reverse(Matrix4d()) ); - CALL_SUBTEST( reverse(MatrixXcf(3, 3)) ); - CALL_SUBTEST( reverse(MatrixXi(6, 3)) ); - CALL_SUBTEST( reverse(MatrixXcd(20, 20)) ); - CALL_SUBTEST( reverse(Matrix()) ); - CALL_SUBTEST( reverse(Matrix(6,3)) ); + CALL_SUBTEST_1( reverse(Matrix()) ); + CALL_SUBTEST_2( reverse(Matrix2f()) ); + CALL_SUBTEST_3( reverse(Matrix4f()) ); + CALL_SUBTEST_4( reverse(Matrix4d()) ); + CALL_SUBTEST_5( reverse(MatrixXcf(3, 3)) ); + CALL_SUBTEST_6( reverse(MatrixXi(6, 3)) ); + CALL_SUBTEST_7( reverse(MatrixXcd(20, 20)) ); + CALL_SUBTEST_8( reverse(Matrix()) ); + CALL_SUBTEST_9( reverse(Matrix(6,3)) ); } +#ifdef EIGEN_TEST_PART_3 Vector4f x; x << 1, 2, 3, 4; Vector4f y; y << 4, 3, 2, 1; VERIFY(x.reverse()[1] == 3); VERIFY(x.reverse() == y); - +#endif } diff --git a/test/bandmatrix.cpp b/test/bandmatrix.cpp index 2bdc67e28..ecb7304db 100644 --- a/test/bandmatrix.cpp +++ b/test/bandmatrix.cpp @@ -79,6 +79,6 @@ void test_bandmatrix() int cols = ei_random(1,10); int sups = ei_random(0,cols-1); int subs = ei_random(0,rows-1); - CALL_SUBTEST( bandmatrix(BandMatrix(rows,cols,sups,subs)) ); + CALL_SUBTEST(bandmatrix(BandMatrix(rows,cols,sups,subs)) ); } } diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 29df99f9e..4678439d5 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -146,17 +146,17 @@ void casting() void test_basicstuff() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( basicStuff(Matrix()) ); - CALL_SUBTEST( basicStuff(Matrix4d()) ); - CALL_SUBTEST( basicStuff(MatrixXcf(3, 3)) ); - CALL_SUBTEST( basicStuff(MatrixXi(8, 12)) ); - CALL_SUBTEST( basicStuff(MatrixXcd(20, 20)) ); - CALL_SUBTEST( basicStuff(Matrix()) ); - CALL_SUBTEST( basicStuff(Matrix(10,10)) ); + CALL_SUBTEST_1( basicStuff(Matrix()) ); + CALL_SUBTEST_2( basicStuff(Matrix4d()) ); + CALL_SUBTEST_3( basicStuff(MatrixXcf(3, 3)) ); + CALL_SUBTEST_4( basicStuff(MatrixXi(8, 12)) ); + CALL_SUBTEST_5( basicStuff(MatrixXcd(20, 20)) ); + CALL_SUBTEST_6( basicStuff(Matrix()) ); + CALL_SUBTEST_7( basicStuff(Matrix(10,10)) ); - CALL_SUBTEST( basicStuffComplex(MatrixXcf(21, 17)) ); - CALL_SUBTEST( basicStuffComplex(MatrixXcd(2, 3)) ); + CALL_SUBTEST_3( basicStuffComplex(MatrixXcf(21, 17)) ); + CALL_SUBTEST_5( basicStuffComplex(MatrixXcd(2, 3)) ); } - CALL_SUBTEST(casting()); + CALL_SUBTEST_2(casting()); } diff --git a/test/cholesky.cpp b/test/cholesky.cpp index 526a9f9d0..77d025e59 100644 --- a/test/cholesky.cpp +++ b/test/cholesky.cpp @@ -148,17 +148,17 @@ template void cholesky_verify_assert() void test_cholesky() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( cholesky(Matrix()) ); - CALL_SUBTEST( cholesky(MatrixXd(1,1)) ); - CALL_SUBTEST( cholesky(Matrix2d()) ); - CALL_SUBTEST( cholesky(Matrix3f()) ); - CALL_SUBTEST( cholesky(Matrix4d()) ); - CALL_SUBTEST( cholesky(MatrixXd(200,200)) ); - CALL_SUBTEST( cholesky(MatrixXcd(100,100)) ); + CALL_SUBTEST_1( cholesky(Matrix()) ); + CALL_SUBTEST_2( cholesky(MatrixXd(1,1)) ); + CALL_SUBTEST_3( cholesky(Matrix2d()) ); + CALL_SUBTEST_4( cholesky(Matrix3f()) ); + CALL_SUBTEST_5( cholesky(Matrix4d()) ); + CALL_SUBTEST_2( cholesky(MatrixXd(200,200)) ); + CALL_SUBTEST_6( cholesky(MatrixXcd(100,100)) ); } - CALL_SUBTEST( cholesky_verify_assert() ); - CALL_SUBTEST( cholesky_verify_assert() ); - CALL_SUBTEST( cholesky_verify_assert() ); - CALL_SUBTEST( cholesky_verify_assert() ); + CALL_SUBTEST_4( cholesky_verify_assert() ); + CALL_SUBTEST_7( cholesky_verify_assert() ); + CALL_SUBTEST_8( cholesky_verify_assert() ); + CALL_SUBTEST_2( cholesky_verify_assert() ); } diff --git a/test/conservative_resize.cpp b/test/conservative_resize.cpp index b92dd5449..a7b1f78ff 100644 --- a/test/conservative_resize.cpp +++ b/test/conservative_resize.cpp @@ -110,20 +110,20 @@ void run_vector_tests() void test_conservative_resize() { - run_matrix_tests(); - run_matrix_tests(); - run_matrix_tests(); - run_matrix_tests(); - run_matrix_tests(); - run_matrix_tests(); - run_matrix_tests, Eigen::RowMajor>(); - run_matrix_tests, Eigen::ColMajor>(); - run_matrix_tests, Eigen::RowMajor>(); - run_matrix_tests, Eigen::ColMajor>(); + CALL_SUBTEST_1((run_matrix_tests())); + CALL_SUBTEST_1((run_matrix_tests())); + CALL_SUBTEST_2((run_matrix_tests())); + CALL_SUBTEST_2((run_matrix_tests())); + CALL_SUBTEST_3((run_matrix_tests())); + CALL_SUBTEST_3((run_matrix_tests())); + CALL_SUBTEST_4((run_matrix_tests, Eigen::RowMajor>())); + CALL_SUBTEST_4((run_matrix_tests, Eigen::ColMajor>())); + CALL_SUBTEST_5((run_matrix_tests, Eigen::RowMajor>())); + CALL_SUBTEST_6((run_matrix_tests, Eigen::ColMajor>())); - run_vector_tests(); - run_vector_tests(); - run_vector_tests(); - run_vector_tests >(); - run_vector_tests >(); + CALL_SUBTEST_1((run_vector_tests())); + CALL_SUBTEST_2((run_vector_tests())); + CALL_SUBTEST_3((run_vector_tests())); + CALL_SUBTEST_4((run_vector_tests >())); + CALL_SUBTEST_5((run_vector_tests >())); } diff --git a/test/cwiseop.cpp b/test/cwiseop.cpp index 10784b0f5..7574bcc4a 100644 --- a/test/cwiseop.cpp +++ b/test/cwiseop.cpp @@ -163,11 +163,11 @@ template void cwiseops(const MatrixType& m) void test_cwiseop() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST( cwiseops(Matrix()) ); - CALL_SUBTEST( cwiseops(Matrix4d()) ); - CALL_SUBTEST( cwiseops(MatrixXf(3, 3)) ); - CALL_SUBTEST( cwiseops(MatrixXf(22, 22)) ); - CALL_SUBTEST( cwiseops(MatrixXi(8, 12)) ); - CALL_SUBTEST( cwiseops(MatrixXd(20, 20)) ); + CALL_SUBTEST_1( cwiseops(Matrix()) ); + CALL_SUBTEST_2( cwiseops(Matrix4d()) ); + CALL_SUBTEST_3( cwiseops(MatrixXf(3, 3)) ); + CALL_SUBTEST_4( cwiseops(MatrixXf(22, 22)) ); + CALL_SUBTEST_5( cwiseops(MatrixXi(8, 12)) ); + CALL_SUBTEST_6( cwiseops(MatrixXd(20, 20)) ); } } diff --git a/test/determinant.cpp b/test/determinant.cpp index d9de5f6ce..7aa9a870d 100644 --- a/test/determinant.cpp +++ b/test/determinant.cpp @@ -65,12 +65,12 @@ template void determinant(const MatrixType& m) void test_determinant() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( determinant(Matrix()) ); - CALL_SUBTEST( determinant(Matrix()) ); - CALL_SUBTEST( determinant(Matrix()) ); - CALL_SUBTEST( determinant(Matrix()) ); - CALL_SUBTEST( determinant(Matrix, 10, 10>()) ); - CALL_SUBTEST( determinant(MatrixXd(20, 20)) ); + CALL_SUBTEST_1( determinant(Matrix()) ); + CALL_SUBTEST_2( determinant(Matrix()) ); + CALL_SUBTEST_3( determinant(Matrix()) ); + CALL_SUBTEST_4( determinant(Matrix()) ); + CALL_SUBTEST_5( determinant(Matrix, 10, 10>()) ); + CALL_SUBTEST_6( determinant(MatrixXd(20, 20)) ); } - CALL_SUBTEST( determinant(MatrixXd(200, 200)) ); + CALL_SUBTEST_6( determinant(MatrixXd(200, 200)) ); } diff --git a/test/diagonalmatrices.cpp b/test/diagonalmatrices.cpp index 9eb0f10f2..c24c66d03 100644 --- a/test/diagonalmatrices.cpp +++ b/test/diagonalmatrices.cpp @@ -95,14 +95,14 @@ template void diagonalmatrices(const MatrixType& m) void test_diagonalmatrices() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( diagonalmatrices(Matrix()) ); - CALL_SUBTEST( diagonalmatrices(Matrix3f()) ); - CALL_SUBTEST( diagonalmatrices(Matrix()) ); - CALL_SUBTEST( diagonalmatrices(Matrix4d()) ); - CALL_SUBTEST( diagonalmatrices(Matrix()) ); - CALL_SUBTEST( diagonalmatrices(MatrixXcf(3, 5)) ); - CALL_SUBTEST( diagonalmatrices(MatrixXi(10, 8)) ); - CALL_SUBTEST( diagonalmatrices(Matrix(20, 20)) ); - CALL_SUBTEST( diagonalmatrices(MatrixXf(21, 24)) ); + CALL_SUBTEST_1( diagonalmatrices(Matrix()) ); + CALL_SUBTEST_2( diagonalmatrices(Matrix3f()) ); + CALL_SUBTEST_3( diagonalmatrices(Matrix()) ); + CALL_SUBTEST_4( diagonalmatrices(Matrix4d()) ); + CALL_SUBTEST_5( diagonalmatrices(Matrix()) ); + CALL_SUBTEST_6( diagonalmatrices(MatrixXcf(3, 5)) ); + CALL_SUBTEST_7( diagonalmatrices(MatrixXi(10, 8)) ); + CALL_SUBTEST_8( diagonalmatrices(Matrix(20, 20)) ); + CALL_SUBTEST_9( diagonalmatrices(MatrixXf(21, 24)) ); } } diff --git a/test/dynalloc.cpp b/test/dynalloc.cpp index 08fc0369d..e0a9f9f86 100644 --- a/test/dynalloc.cpp +++ b/test/dynalloc.cpp @@ -112,11 +112,11 @@ void test_dynalloc() for (int i=0; i() ); - CALL_SUBTEST( check_dynaligned() ); - CALL_SUBTEST( check_dynaligned() ); - CALL_SUBTEST( check_dynaligned() ); - CALL_SUBTEST( check_dynaligned() ); + CALL_SUBTEST(check_dynaligned() ); + CALL_SUBTEST(check_dynaligned() ); + CALL_SUBTEST(check_dynaligned() ); + CALL_SUBTEST(check_dynaligned() ); + CALL_SUBTEST(check_dynaligned() ); } // check static allocation, who knows ? diff --git a/test/eigensolver_complex.cpp b/test/eigensolver_complex.cpp index a8e6c709e..86e1b200a 100644 --- a/test/eigensolver_complex.cpp +++ b/test/eigensolver_complex.cpp @@ -54,8 +54,8 @@ template void eigensolver(const MatrixType& m) void test_eigensolver_complex() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST1( eigensolver(Matrix4cf()) ); - CALL_SUBTEST2( eigensolver(MatrixXcd(14,14)) ); + CALL_SUBTEST_1( eigensolver(Matrix4cf()) ); + CALL_SUBTEST_2( eigensolver(MatrixXcd(14,14)) ); } } diff --git a/test/eigensolver_generic.cpp b/test/eigensolver_generic.cpp index 6c91ebabe..5dc18f141 100644 --- a/test/eigensolver_generic.cpp +++ b/test/eigensolver_generic.cpp @@ -75,18 +75,18 @@ template void eigensolver_verify_assert() void test_eigensolver_generic() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST1( eigensolver(Matrix4f()) ); - CALL_SUBTEST2( eigensolver(MatrixXd(17,17)) ); + CALL_SUBTEST_1( eigensolver(Matrix4f()) ); + CALL_SUBTEST_2( eigensolver(MatrixXd(17,17)) ); // some trivial but implementation-wise tricky cases - CALL_SUBTEST2( eigensolver(MatrixXd(1,1)) ); - CALL_SUBTEST2( eigensolver(MatrixXd(2,2)) ); - CALL_SUBTEST3( eigensolver(Matrix()) ); - CALL_SUBTEST4( eigensolver(Matrix2d()) ); + CALL_SUBTEST_2( eigensolver(MatrixXd(1,1)) ); + CALL_SUBTEST_2( eigensolver(MatrixXd(2,2)) ); + CALL_SUBTEST_3( eigensolver(Matrix()) ); + CALL_SUBTEST_4( eigensolver(Matrix2d()) ); } - CALL_SUBTEST1( eigensolver_verify_assert() ); - CALL_SUBTEST2( eigensolver_verify_assert() ); - CALL_SUBTEST4( eigensolver_verify_assert() ); - CALL_SUBTEST5( eigensolver_verify_assert() ); + CALL_SUBTEST_1( eigensolver_verify_assert() ); + CALL_SUBTEST_2( eigensolver_verify_assert() ); + CALL_SUBTEST_4( eigensolver_verify_assert() ); + CALL_SUBTEST_5( eigensolver_verify_assert() ); } diff --git a/test/eigensolver_selfadjoint.cpp b/test/eigensolver_selfadjoint.cpp index 27a5f2246..632c1d2e7 100644 --- a/test/eigensolver_selfadjoint.cpp +++ b/test/eigensolver_selfadjoint.cpp @@ -117,17 +117,17 @@ void test_eigensolver_selfadjoint() { for(int i = 0; i < g_repeat; i++) { // very important to test a 3x3 matrix since we provide a special path for it - CALL_SUBTEST1( selfadjointeigensolver(Matrix3f()) ); - CALL_SUBTEST2( selfadjointeigensolver(Matrix4d()) ); - CALL_SUBTEST3( selfadjointeigensolver(MatrixXf(10,10)) ); - CALL_SUBTEST4( selfadjointeigensolver(MatrixXd(19,19)) ); - CALL_SUBTEST5( selfadjointeigensolver(MatrixXcd(17,17)) ); + CALL_SUBTEST_1( selfadjointeigensolver(Matrix3f()) ); + CALL_SUBTEST_2( selfadjointeigensolver(Matrix4d()) ); + CALL_SUBTEST_3( selfadjointeigensolver(MatrixXf(10,10)) ); + CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(19,19)) ); + CALL_SUBTEST_5( selfadjointeigensolver(MatrixXcd(17,17)) ); // some trivial but implementation-wise tricky cases - CALL_SUBTEST4( selfadjointeigensolver(MatrixXd(1,1)) ); - CALL_SUBTEST4( selfadjointeigensolver(MatrixXd(2,2)) ); - CALL_SUBTEST6( selfadjointeigensolver(Matrix()) ); - CALL_SUBTEST7( selfadjointeigensolver(Matrix()) ); + CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(1,1)) ); + CALL_SUBTEST_4( selfadjointeigensolver(MatrixXd(2,2)) ); + CALL_SUBTEST_6( selfadjointeigensolver(Matrix()) ); + CALL_SUBTEST_7( selfadjointeigensolver(Matrix()) ); } } diff --git a/test/geo_alignedbox.cpp b/test/geo_alignedbox.cpp index 07b3e59e6..d496578da 100644 --- a/test/geo_alignedbox.cpp +++ b/test/geo_alignedbox.cpp @@ -75,8 +75,8 @@ template void alignedbox(const BoxType& _box) void test_geo_alignedbox() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( alignedbox(AlignedBox()) ); - CALL_SUBTEST( alignedbox(AlignedBox()) ); - CALL_SUBTEST( alignedbox(AlignedBox()) ); + CALL_SUBTEST_1( alignedbox(AlignedBox()) ); + CALL_SUBTEST_2( alignedbox(AlignedBox()) ); + CALL_SUBTEST_3( alignedbox(AlignedBox()) ); } } diff --git a/test/geo_eulerangles.cpp b/test/geo_eulerangles.cpp index f11c8e8ef..98cdf6a86 100644 --- a/test/geo_eulerangles.cpp +++ b/test/geo_eulerangles.cpp @@ -64,7 +64,7 @@ template void eulerangles(void) void test_geo_eulerangles() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( eulerangles() ); - CALL_SUBTEST( eulerangles() ); + CALL_SUBTEST_1( eulerangles() ); + CALL_SUBTEST_2( eulerangles() ); } } diff --git a/test/geo_homogeneous.cpp b/test/geo_homogeneous.cpp index 4b66e488c..48d8cbcdf 100644 --- a/test/geo_homogeneous.cpp +++ b/test/geo_homogeneous.cpp @@ -104,8 +104,8 @@ template void homogeneous(void) void test_geo_homogeneous() { for(int i = 0; i < g_repeat; i++) { -// CALL_SUBTEST(( homogeneous() )); - CALL_SUBTEST(( homogeneous() )); -// CALL_SUBTEST(( homogeneous() )); + CALL_SUBTEST_1(( homogeneous() )); + CALL_SUBTEST_2(( homogeneous() )); + CALL_SUBTEST_3(( homogeneous() )); } } diff --git a/test/geo_hyperplane.cpp b/test/geo_hyperplane.cpp index f8281a16b..f1d3b016f 100644 --- a/test/geo_hyperplane.cpp +++ b/test/geo_hyperplane.cpp @@ -130,11 +130,11 @@ template void lines() void test_geo_hyperplane() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( hyperplane(Hyperplane()) ); - CALL_SUBTEST( hyperplane(Hyperplane()) ); - CALL_SUBTEST( hyperplane(Hyperplane()) ); - CALL_SUBTEST( hyperplane(Hyperplane,5>()) ); - CALL_SUBTEST( lines() ); - CALL_SUBTEST( lines() ); + CALL_SUBTEST_1( hyperplane(Hyperplane()) ); + CALL_SUBTEST_2( hyperplane(Hyperplane()) ); + CALL_SUBTEST_3( hyperplane(Hyperplane()) ); + CALL_SUBTEST_4( hyperplane(Hyperplane,5>()) ); + CALL_SUBTEST_1( lines() ); + CALL_SUBTEST_2( lines() ); } } diff --git a/test/geo_orthomethods.cpp b/test/geo_orthomethods.cpp index 540a63b82..54a6febab 100644 --- a/test/geo_orthomethods.cpp +++ b/test/geo_orthomethods.cpp @@ -113,15 +113,15 @@ template void orthomethods(int size=Size) void test_geo_orthomethods() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( orthomethods_3() ); - CALL_SUBTEST( orthomethods_3() ); - CALL_SUBTEST( (orthomethods()) ); - CALL_SUBTEST( (orthomethods()) ); - CALL_SUBTEST( (orthomethods()) ); - CALL_SUBTEST( (orthomethods()) ); - CALL_SUBTEST( (orthomethods()) ); - CALL_SUBTEST( (orthomethods,8>()) ); - CALL_SUBTEST( (orthomethods(36)) ); - CALL_SUBTEST( (orthomethods(35)) ); + CALL_SUBTEST_1( orthomethods_3() ); + CALL_SUBTEST_2( orthomethods_3() ); + CALL_SUBTEST_1( (orthomethods()) ); + CALL_SUBTEST_2( (orthomethods()) ); + CALL_SUBTEST_1( (orthomethods()) ); + CALL_SUBTEST_2( (orthomethods()) ); + CALL_SUBTEST_3( (orthomethods()) ); + CALL_SUBTEST_4( (orthomethods,8>()) ); + CALL_SUBTEST_5( (orthomethods(36)) ); + CALL_SUBTEST_6( (orthomethods(35)) ); } } diff --git a/test/geo_parametrizedline.cpp b/test/geo_parametrizedline.cpp index c90d59d3e..137324a98 100644 --- a/test/geo_parametrizedline.cpp +++ b/test/geo_parametrizedline.cpp @@ -69,9 +69,9 @@ template void parametrizedline(const LineType& _line) void test_geo_parametrizedline() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( parametrizedline(ParametrizedLine()) ); - CALL_SUBTEST( parametrizedline(ParametrizedLine()) ); - CALL_SUBTEST( parametrizedline(ParametrizedLine()) ); - CALL_SUBTEST( parametrizedline(ParametrizedLine,5>()) ); + CALL_SUBTEST_1( parametrizedline(ParametrizedLine()) ); + CALL_SUBTEST_2( parametrizedline(ParametrizedLine()) ); + CALL_SUBTEST_3( parametrizedline(ParametrizedLine()) ); + CALL_SUBTEST_4( parametrizedline(ParametrizedLine,5>()) ); } } diff --git a/test/geo_quaternion.cpp b/test/geo_quaternion.cpp index 762743fba..7dbf890f4 100644 --- a/test/geo_quaternion.cpp +++ b/test/geo_quaternion.cpp @@ -92,9 +92,12 @@ template void quaternion(void) VERIFY_IS_APPROX( v2.normalized(),(q2.setFromTwoVectors(v1, v2)*v1).normalized()); VERIFY_IS_APPROX( v1.normalized(),(q2.setFromTwoVectors(v1, v1)*v1).normalized()); VERIFY_IS_APPROX(-v1.normalized(),(q2.setFromTwoVectors(v1,-v1)*v1).normalized()); - v3 = v1.cwise()+eps; - VERIFY_IS_APPROX( v3.normalized(),(q2.setFromTwoVectors(v1, v3)*v1).normalized()); - VERIFY_IS_APPROX(-v3.normalized(),(q2.setFromTwoVectors(v1,-v3)*v1).normalized()); + if (ei_is_same_type::ret) + { + v3 = v1.cwise()+eps; + VERIFY_IS_APPROX( v3.normalized(),(q2.setFromTwoVectors(v1, v3)*v1).normalized()); + VERIFY_IS_APPROX(-v3.normalized(),(q2.setFromTwoVectors(v1,-v3)*v1).normalized()); + } // inverse and conjugate VERIFY_IS_APPROX(q1 * (q1.inverse() * v1), v1); @@ -110,7 +113,7 @@ template void quaternion(void) void test_geo_quaternion() { for(int i = 0; i < g_repeat; i++) { -// CALL_SUBTEST( quaternion() ); - CALL_SUBTEST( quaternion() ); + CALL_SUBTEST_1( quaternion() ); + CALL_SUBTEST_2( quaternion() ); } } diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp index 23b297314..f1d068b83 100644 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -298,16 +298,19 @@ template void transformations(void) VERIFY_IS_APPROX((t0 * v1).template start<3>(), AlignedScaling3(v0) * v1); // test transform inversion - if(Mode!=AffineCompact) - { - t0.setIdentity(); - t0.translate(v0); - t0.linear().setRandom(); - VERIFY_IS_APPROX(t0.inverse(Affine).matrix(), t0.matrix().inverse()); - t0.setIdentity(); - t0.translate(v0).rotate(q1); - VERIFY_IS_APPROX(t0.inverse(Isometry).matrix(), t0.matrix().inverse()); - } + t0.setIdentity(); + t0.translate(v0); + t0.linear().setRandom(); + Matrix4 t044 = Matrix4::Zero(); + t044(3,3) = 1; + t044.block(0,0,t0.matrix().rows(),4) = t0.matrix(); + VERIFY_IS_APPROX(t0.inverse(Affine).matrix(), t044.inverse().block(0,0,t0.matrix().rows(),4)); + t0.setIdentity(); + t0.translate(v0).rotate(q1); + t044 = Matrix4::Zero(); + t044(3,3) = 1; + t044.block(0,0,t0.matrix().rows(),4) = t0.matrix(); + VERIFY_IS_APPROX(t0.inverse(Isometry).matrix(), t044.inverse().block(0,0,t0.matrix().rows(),4)); // test extract rotation and aligned scaling // t0.setIdentity(); @@ -354,9 +357,8 @@ template void transformations(void) void test_geo_transformations() { for(int i = 0; i < g_repeat; i++) { -// CALL_SUBTEST( transformations() ); - CALL_SUBTEST(( transformations() )); - CALL_SUBTEST(( transformations() )); - CALL_SUBTEST(( transformations() )); + CALL_SUBTEST_1(( transformations() )); + CALL_SUBTEST_2(( transformations() )); + CALL_SUBTEST_3(( transformations() )); } } diff --git a/test/householder.cpp b/test/householder.cpp index b27279479..c9b07622d 100644 --- a/test/householder.cpp +++ b/test/householder.cpp @@ -92,12 +92,12 @@ template void householder(const MatrixType& m) void test_householder() { for(int i = 0; i < 2*g_repeat; i++) { - CALL_SUBTEST( householder(Matrix()) ); - CALL_SUBTEST( householder(Matrix()) ); - CALL_SUBTEST( householder(Matrix()) ); - CALL_SUBTEST( householder(Matrix()) ); - CALL_SUBTEST( householder(MatrixXd(10,12)) ); - CALL_SUBTEST( householder(MatrixXcf(16,17)) ); + CALL_SUBTEST_1( householder(Matrix()) ); + CALL_SUBTEST_2( householder(Matrix()) ); + CALL_SUBTEST_3( householder(Matrix()) ); + CALL_SUBTEST_4( householder(Matrix()) ); + CALL_SUBTEST_5( householder(MatrixXd(10,12)) ); + CALL_SUBTEST_6( householder(MatrixXcf(16,17)) ); } } diff --git a/test/inverse.cpp b/test/inverse.cpp index 269678fd4..3ed61d356 100644 --- a/test/inverse.cpp +++ b/test/inverse.cpp @@ -95,14 +95,14 @@ void test_inverse() { int s; for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST1( inverse(Matrix()) ); - CALL_SUBTEST2( inverse(Matrix2d()) ); - CALL_SUBTEST3( inverse(Matrix3f()) ); - CALL_SUBTEST4( inverse(Matrix4f()) ); + CALL_SUBTEST_1( inverse(Matrix()) ); + CALL_SUBTEST_2( inverse(Matrix2d()) ); + CALL_SUBTEST_3( inverse(Matrix3f()) ); + CALL_SUBTEST_4( inverse(Matrix4f()) ); s = ei_random(50,320); - CALL_SUBTEST5( inverse(MatrixXf(s,s)) ); + CALL_SUBTEST_5( inverse(MatrixXf(s,s)) ); s = ei_random(25,100); - CALL_SUBTEST6( inverse(MatrixXcd(s,s)) ); + CALL_SUBTEST_6( inverse(MatrixXcd(s,s)) ); } #ifdef EIGEN_TEST_PART_4 diff --git a/test/jacobisvd.cpp b/test/jacobisvd.cpp index 2e3f089a0..f3a143e3c 100644 --- a/test/jacobisvd.cpp +++ b/test/jacobisvd.cpp @@ -80,27 +80,27 @@ void test_jacobisvd() Matrix2cd m; m << 0, 1, 0, 1; - CALL_SUBTEST(( svd(m, false) )); + CALL_SUBTEST_1(( svd(m, false) )); m << 1, 0, 1, 0; - CALL_SUBTEST(( svd(m, false) )); + CALL_SUBTEST_1(( svd(m, false) )); Matrix2d n; n << 1, 1, 1, -1; - CALL_SUBTEST(( svd(n, false) )); - CALL_SUBTEST(( svd() )); - CALL_SUBTEST(( svd() )); - CALL_SUBTEST(( svd , AtLeastAsManyColsAsRows>() )); - CALL_SUBTEST(( svd , AtLeastAsManyRowsAsCols>(Matrix(10,2)) )); + CALL_SUBTEST_2(( svd(n, false) )); + CALL_SUBTEST_3(( svd() )); + CALL_SUBTEST_4(( svd() )); + CALL_SUBTEST_5(( svd , AtLeastAsManyColsAsRows>() )); + CALL_SUBTEST_6(( svd , AtLeastAsManyRowsAsCols>(Matrix(10,2)) )); - CALL_SUBTEST(( svd(MatrixXf(50,50)) )); - CALL_SUBTEST(( svd(MatrixXcd(14,7)) )); + CALL_SUBTEST_7(( svd(MatrixXf(50,50)) )); + CALL_SUBTEST_8(( svd(MatrixXcd(14,7)) )); } - CALL_SUBTEST(( svd(MatrixXf(300,200)) )); - CALL_SUBTEST(( svd(MatrixXcd(100,150)) )); + CALL_SUBTEST_9(( svd(MatrixXf(300,200)) )); + CALL_SUBTEST_10(( svd(MatrixXcd(100,150)) )); - CALL_SUBTEST(( svd_verify_assert() )); - CALL_SUBTEST(( svd_verify_assert() )); - CALL_SUBTEST(( svd_verify_assert() )); - CALL_SUBTEST(( svd_verify_assert() )); + CALL_SUBTEST_3(( svd_verify_assert() )); + CALL_SUBTEST_3(( svd_verify_assert() )); + CALL_SUBTEST_9(( svd_verify_assert() )); + CALL_SUBTEST_11(( svd_verify_assert() )); } diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp index 8827c40d1..f2ffc33bd 100644 --- a/test/linearstructure.cpp +++ b/test/linearstructure.cpp @@ -87,13 +87,13 @@ template void linearStructure(const MatrixType& m) void test_linearstructure() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( linearStructure(Matrix()) ); - CALL_SUBTEST( linearStructure(Matrix2f()) ); - CALL_SUBTEST( linearStructure(Vector3d()) ); - CALL_SUBTEST( linearStructure(Matrix4d()) ); - CALL_SUBTEST( linearStructure(MatrixXcf(3, 3)) ); - CALL_SUBTEST( linearStructure(MatrixXf(8, 12)) ); - CALL_SUBTEST( linearStructure(MatrixXi(8, 12)) ); - CALL_SUBTEST( linearStructure(MatrixXcd(20, 20)) ); + CALL_SUBTEST_1( linearStructure(Matrix()) ); + CALL_SUBTEST_2( linearStructure(Matrix2f()) ); + CALL_SUBTEST_3( linearStructure(Vector3d()) ); + CALL_SUBTEST_4( linearStructure(Matrix4d()) ); + CALL_SUBTEST_5( linearStructure(MatrixXcf(3, 3)) ); + CALL_SUBTEST_6( linearStructure(MatrixXf(8, 12)) ); + CALL_SUBTEST_7( linearStructure(MatrixXi(8, 12)) ); + CALL_SUBTEST_8( linearStructure(MatrixXcd(20, 20)) ); } } diff --git a/test/lu.cpp b/test/lu.cpp index 1813172cd..b7214ae12 100644 --- a/test/lu.cpp +++ b/test/lu.cpp @@ -58,13 +58,13 @@ template void lu_non_invertible() int rank = ei_random(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).lu().image(MatrixType::Zero(rows,cols)).cols() == 1)); + VERIFY((MatrixType::Zero(rows,cols).fullPivLu().image(MatrixType::Zero(rows,cols)).cols() == 1)); MatrixType m1(rows, cols), m3(rows, cols2); CMatrixType m2(cols, cols2); createRandomMatrixOfRank(rank, rows, cols, m1); - LU lu(m1); + FullPivLU lu(m1); KernelMatrixType m1kernel = lu.kernel(); ImageMatrixType m1image = lu.image(m1); @@ -75,20 +75,16 @@ template void lu_non_invertible() VERIFY(!lu.isInvertible()); VERIFY(!lu.isSurjective()); VERIFY((m1 * m1kernel).isMuchSmallerThan(m1)); - VERIFY(m1image.lu().rank() == rank); + VERIFY(m1image.fullPivLu().rank() == rank); DynamicMatrixType sidebyside(m1.rows(), m1.cols() + m1image.cols()); sidebyside << m1, m1image; - VERIFY(sidebyside.lu().rank() == rank); + VERIFY(sidebyside.fullPivLu().rank() == rank); m2 = CMatrixType::Random(cols,cols2); m3 = m1*m2; m2 = CMatrixType::Random(cols,cols2); // test that the code, which does resize(), may be applied to an xpr m2.block(0,0,m2.rows(),m2.cols()) = lu.solve(m3); VERIFY_IS_APPROX(m3, m1*m2); - - CMatrixType m4(cols, cols), m5(cols, cols); - createRandomMatrixOfRank(cols/2, cols, cols, m4); - VERIFY(!m4.computeInverseWithCheck(&m5)); } template void lu_invertible() @@ -109,14 +105,14 @@ template void lu_invertible() m1 += a * a.adjoint(); } - LU lu(m1); + FullPivLU lu(m1); VERIFY(0 == lu.dimensionOfKernel()); VERIFY(lu.kernel().cols() == 1); // the kernel() should consist of a single (zero) column vector VERIFY(size == lu.rank()); VERIFY(lu.isInjective()); VERIFY(lu.isSurjective()); VERIFY(lu.isInvertible()); - VERIFY(lu.image(m1).lu().isInvertible()); + VERIFY(lu.image(m1).fullPivLu().isInvertible()); m3 = MatrixType::Random(size,size); m2 = lu.solve(m3); VERIFY_IS_APPROX(m3, m1*m2); @@ -127,7 +123,7 @@ template void lu_verify_assert() { MatrixType tmp; - LU lu; + FullPivLU lu; VERIFY_RAISES_ASSERT(lu.matrixLU()) VERIFY_RAISES_ASSERT(lu.permutationP()) VERIFY_RAISES_ASSERT(lu.permutationQ()) @@ -142,10 +138,10 @@ template void lu_verify_assert() VERIFY_RAISES_ASSERT(lu.isInvertible()) VERIFY_RAISES_ASSERT(lu.inverse()) - PartialLU plu; + PartialPivLU plu; VERIFY_RAISES_ASSERT(plu.matrixLU()) VERIFY_RAISES_ASSERT(plu.permutationP()) - VERIFY_RAISES_ASSERT(plu.solve(tmp,&tmp)) + VERIFY_RAISES_ASSERT(plu.solve(tmp)) VERIFY_RAISES_ASSERT(plu.determinant()) VERIFY_RAISES_ASSERT(plu.inverse()) } @@ -153,26 +149,26 @@ template void lu_verify_assert() void test_lu() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST1( lu_non_invertible() ); - CALL_SUBTEST1( lu_verify_assert() ); + CALL_SUBTEST_1( lu_non_invertible() ); + CALL_SUBTEST_1( lu_verify_assert() ); - CALL_SUBTEST2( (lu_non_invertible >()) ); - CALL_SUBTEST2( (lu_verify_assert >()) ); + CALL_SUBTEST_2( (lu_non_invertible >()) ); + CALL_SUBTEST_2( (lu_verify_assert >()) ); - CALL_SUBTEST3( lu_non_invertible() ); - CALL_SUBTEST3( lu_invertible() ); - CALL_SUBTEST3( lu_verify_assert() ); + CALL_SUBTEST_3( lu_non_invertible() ); + CALL_SUBTEST_3( lu_invertible() ); + CALL_SUBTEST_3( lu_verify_assert() ); - CALL_SUBTEST4( lu_non_invertible() ); - CALL_SUBTEST4( lu_invertible() ); - CALL_SUBTEST4( lu_verify_assert() ); + CALL_SUBTEST_4( lu_non_invertible() ); + CALL_SUBTEST_4( lu_invertible() ); + CALL_SUBTEST_4( lu_verify_assert() ); - CALL_SUBTEST5( lu_non_invertible() ); - CALL_SUBTEST5( lu_invertible() ); - CALL_SUBTEST5( lu_verify_assert() ); + CALL_SUBTEST_5( lu_non_invertible() ); + CALL_SUBTEST_5( lu_invertible() ); + CALL_SUBTEST_5( lu_verify_assert() ); - CALL_SUBTEST6( lu_non_invertible() ); - CALL_SUBTEST6( lu_invertible() ); - CALL_SUBTEST6( lu_verify_assert() ); + CALL_SUBTEST_6( lu_non_invertible() ); + CALL_SUBTEST_6( lu_invertible() ); + CALL_SUBTEST_6( lu_verify_assert() ); } } diff --git a/test/main.h b/test/main.h index 15ae3d645..0b9b0bc4c 100644 --- a/test/main.h +++ b/test/main.h @@ -171,63 +171,99 @@ namespace Eigen } while (0) #ifdef EIGEN_TEST_PART_1 -#define CALL_SUBTEST1(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_1(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST1(FUNC) +#define CALL_SUBTEST_1(FUNC) #endif #ifdef EIGEN_TEST_PART_2 -#define CALL_SUBTEST2(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_2(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST2(FUNC) +#define CALL_SUBTEST_2(FUNC) #endif #ifdef EIGEN_TEST_PART_3 -#define CALL_SUBTEST3(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_3(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST3(FUNC) +#define CALL_SUBTEST_3(FUNC) #endif #ifdef EIGEN_TEST_PART_4 -#define CALL_SUBTEST4(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_4(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST4(FUNC) +#define CALL_SUBTEST_4(FUNC) #endif #ifdef EIGEN_TEST_PART_5 -#define CALL_SUBTEST5(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_5(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST5(FUNC) +#define CALL_SUBTEST_5(FUNC) #endif #ifdef EIGEN_TEST_PART_6 -#define CALL_SUBTEST6(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_6(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST6(FUNC) +#define CALL_SUBTEST_6(FUNC) #endif #ifdef EIGEN_TEST_PART_7 -#define CALL_SUBTEST7(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_7(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST7(FUNC) +#define CALL_SUBTEST_7(FUNC) #endif #ifdef EIGEN_TEST_PART_8 -#define CALL_SUBTEST8(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_8(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST8(FUNC) +#define CALL_SUBTEST_8(FUNC) #endif #ifdef EIGEN_TEST_PART_9 -#define CALL_SUBTEST9(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_9(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST9(FUNC) +#define CALL_SUBTEST_9(FUNC) #endif #ifdef EIGEN_TEST_PART_10 -#define CALL_SUBTEST10(FUNC) CALL_SUBTEST(FUNC) +#define CALL_SUBTEST_10(FUNC) CALL_SUBTEST(FUNC) #else -#define CALL_SUBTEST10(FUNC) +#define CALL_SUBTEST_10(FUNC) +#endif + +#ifdef EIGEN_TEST_PART_11 +#define CALL_SUBTEST_11(FUNC) CALL_SUBTEST(FUNC) +#else +#define CALL_SUBTEST_11(FUNC) +#endif + +#ifdef EIGEN_TEST_PART_12 +#define CALL_SUBTEST_12(FUNC) CALL_SUBTEST(FUNC) +#else +#define CALL_SUBTEST_12(FUNC) +#endif + +#ifdef EIGEN_TEST_PART_13 +#define CALL_SUBTEST_13(FUNC) CALL_SUBTEST(FUNC) +#else +#define CALL_SUBTEST_13(FUNC) +#endif + +#ifdef EIGEN_TEST_PART_14 +#define CALL_SUBTEST_14(FUNC) CALL_SUBTEST(FUNC) +#else +#define CALL_SUBTEST_14(FUNC) +#endif + +#ifdef EIGEN_TEST_PART_15 +#define CALL_SUBTEST_15(FUNC) CALL_SUBTEST(FUNC) +#else +#define CALL_SUBTEST_15(FUNC) +#endif + +#ifdef EIGEN_TEST_PART_16 +#define CALL_SUBTEST_16(FUNC) CALL_SUBTEST(FUNC) +#else +#define CALL_SUBTEST_16(FUNC) #endif namespace Eigen { diff --git a/test/map.cpp b/test/map.cpp index 62e727304..5c0ec3137 100644 --- a/test/map.cpp +++ b/test/map.cpp @@ -80,16 +80,16 @@ template void map_static_methods(const VectorType& m) void test_map() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( map_class(Matrix()) ); - CALL_SUBTEST( map_class(Vector4d()) ); - CALL_SUBTEST( map_class(RowVector4f()) ); - CALL_SUBTEST( map_class(VectorXcf(8)) ); - CALL_SUBTEST( map_class(VectorXi(12)) ); + CALL_SUBTEST_1( map_class(Matrix()) ); + CALL_SUBTEST_2( map_class(Vector4d()) ); + CALL_SUBTEST_3( map_class(RowVector4f()) ); + CALL_SUBTEST_4( map_class(VectorXcf(8)) ); + CALL_SUBTEST_5( map_class(VectorXi(12)) ); - CALL_SUBTEST( map_static_methods(Matrix()) ); - CALL_SUBTEST( map_static_methods(Vector3f()) ); - CALL_SUBTEST( map_static_methods(RowVector3d()) ); - CALL_SUBTEST( map_static_methods(VectorXcd(8)) ); - CALL_SUBTEST( map_static_methods(VectorXf(12)) ); + CALL_SUBTEST_6( map_static_methods(Matrix()) ); + CALL_SUBTEST_7( map_static_methods(Vector3f()) ); + CALL_SUBTEST_8( map_static_methods(RowVector3d()) ); + CALL_SUBTEST_9( map_static_methods(VectorXcd(8)) ); + CALL_SUBTEST_10( map_static_methods(VectorXf(12)) ); } } diff --git a/test/miscmatrices.cpp b/test/miscmatrices.cpp index bf885e252..0adccf5ce 100644 --- a/test/miscmatrices.cpp +++ b/test/miscmatrices.cpp @@ -54,10 +54,10 @@ template void miscMatrices(const MatrixType& m) void test_miscmatrices() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( miscMatrices(Matrix()) ); - CALL_SUBTEST( miscMatrices(Matrix4d()) ); - CALL_SUBTEST( miscMatrices(MatrixXcf(3, 3)) ); - CALL_SUBTEST( miscMatrices(MatrixXi(8, 12)) ); - CALL_SUBTEST( miscMatrices(MatrixXcd(20, 20)) ); + CALL_SUBTEST_1( miscMatrices(Matrix()) ); + CALL_SUBTEST_2( miscMatrices(Matrix4d()) ); + CALL_SUBTEST_3( miscMatrices(MatrixXcf(3, 3)) ); + CALL_SUBTEST_4( miscMatrices(MatrixXi(8, 12)) ); + CALL_SUBTEST_5( miscMatrices(MatrixXcd(20, 20)) ); } } diff --git a/test/mixingtypes.cpp b/test/mixingtypes.cpp index 3e322c7fe..1dcd77a8a 100644 --- a/test/mixingtypes.cpp +++ b/test/mixingtypes.cpp @@ -174,10 +174,10 @@ template void mixingtypes_small() void test_mixingtypes() { // check that our operator new is indeed called: - CALL_SUBTEST(mixingtypes<3>()); - CALL_SUBTEST(mixingtypes<4>()); - CALL_SUBTEST(mixingtypes(20)); + CALL_SUBTEST_1(mixingtypes<3>()); + CALL_SUBTEST_2(mixingtypes<4>()); + CALL_SUBTEST_3(mixingtypes(20)); - CALL_SUBTEST(mixingtypes_small<4>()); - CALL_SUBTEST(mixingtypes_large(20)); + CALL_SUBTEST_4(mixingtypes_small<4>()); + CALL_SUBTEST_5(mixingtypes_large(20)); } diff --git a/test/nomalloc.cpp b/test/nomalloc.cpp index a96bb23da..1a917192b 100644 --- a/test/nomalloc.cpp +++ b/test/nomalloc.cpp @@ -77,7 +77,7 @@ void test_nomalloc() { // check that our operator new is indeed called: VERIFY_RAISES_ASSERT(MatrixXd dummy = MatrixXd::Random(3,3)); - CALL_SUBTEST( nomalloc(Matrix()) ); - CALL_SUBTEST( nomalloc(Matrix4d()) ); - CALL_SUBTEST( nomalloc(Matrix()) ); + CALL_SUBTEST(nomalloc(Matrix()) ); + CALL_SUBTEST(nomalloc(Matrix4d()) ); + CALL_SUBTEST(nomalloc(Matrix()) ); } diff --git a/test/packetmath.cpp b/test/packetmath.cpp index 1745ae5c6..7d863e616 100644 --- a/test/packetmath.cpp +++ b/test/packetmath.cpp @@ -233,12 +233,12 @@ template void packetmath_real() void test_packetmath() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( packetmath() ); - CALL_SUBTEST( packetmath() ); - CALL_SUBTEST( packetmath() ); - CALL_SUBTEST( packetmath >() ); + CALL_SUBTEST_1( packetmath() ); + CALL_SUBTEST_2( packetmath() ); + CALL_SUBTEST_3( packetmath() ); + CALL_SUBTEST_1( packetmath >() ); - CALL_SUBTEST( packetmath_real() ); - CALL_SUBTEST( packetmath_real() ); + CALL_SUBTEST_1( packetmath_real() ); + CALL_SUBTEST_2( packetmath_real() ); } } diff --git a/test/product_extra.cpp b/test/product_extra.cpp index aeaf04d83..e4c853461 100644 --- a/test/product_extra.cpp +++ b/test/product_extra.cpp @@ -119,8 +119,8 @@ template void product_extra(const MatrixType& m) void test_product_extra() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST1( product_extra(MatrixXf(ei_random(2,320), ei_random(2,320))) ); - CALL_SUBTEST2( product_extra(MatrixXcf(ei_random(50,50), ei_random(50,50))) ); - CALL_SUBTEST3( product_extra(Matrix,Dynamic,Dynamic,RowMajor>(ei_random(2,50), ei_random(2,50))) ); + CALL_SUBTEST_1( product_extra(MatrixXf(ei_random(2,320), ei_random(2,320))) ); + CALL_SUBTEST_2( product_extra(MatrixXcf(ei_random(50,50), ei_random(50,50))) ); + CALL_SUBTEST_3( product_extra(Matrix,Dynamic,Dynamic,RowMajor>(ei_random(2,50), ei_random(2,50))) ); } } diff --git a/test/product_large.cpp b/test/product_large.cpp index a64775f6c..519213236 100644 --- a/test/product_large.cpp +++ b/test/product_large.cpp @@ -27,11 +27,11 @@ void test_product_large() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST1( product(MatrixXf(ei_random(1,320), ei_random(1,320))) ); - CALL_SUBTEST2( product(MatrixXd(ei_random(1,320), ei_random(1,320))) ); - CALL_SUBTEST3( product(MatrixXi(ei_random(1,320), ei_random(1,320))) ); - CALL_SUBTEST4( product(MatrixXcf(ei_random(1,50), ei_random(1,50))) ); - CALL_SUBTEST5( product(Matrix(ei_random(1,320), ei_random(1,320))) ); + CALL_SUBTEST_1( product(MatrixXf(ei_random(1,320), ei_random(1,320))) ); + CALL_SUBTEST_2( product(MatrixXd(ei_random(1,320), ei_random(1,320))) ); + CALL_SUBTEST_3( product(MatrixXi(ei_random(1,320), ei_random(1,320))) ); + CALL_SUBTEST_4( product(MatrixXcf(ei_random(1,50), ei_random(1,50))) ); + CALL_SUBTEST_5( product(Matrix(ei_random(1,320), ei_random(1,320))) ); } #if defined EIGEN_TEST_PART_6 diff --git a/test/product_notemporary.cpp b/test/product_notemporary.cpp index e9efeaaae..e592afff7 100644 --- a/test/product_notemporary.cpp +++ b/test/product_notemporary.cpp @@ -117,8 +117,8 @@ void test_product_notemporary() int s; for(int i = 0; i < g_repeat; i++) { s = ei_random(16,320); - CALL_SUBTEST1( product_notemporary(MatrixXf(s, s)) ); + CALL_SUBTEST_1( product_notemporary(MatrixXf(s, s)) ); s = ei_random(16,120); - CALL_SUBTEST2( product_notemporary(MatrixXcd(s,s)) ); + CALL_SUBTEST_2( product_notemporary(MatrixXcd(s,s)) ); } } diff --git a/test/product_selfadjoint.cpp b/test/product_selfadjoint.cpp index 065d4ad8c..aa8da37bd 100644 --- a/test/product_selfadjoint.cpp +++ b/test/product_selfadjoint.cpp @@ -78,13 +78,13 @@ template void product_selfadjoint(const MatrixType& m) void test_product_selfadjoint() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST1( product_selfadjoint(Matrix()) ); - CALL_SUBTEST2( product_selfadjoint(Matrix()) ); - CALL_SUBTEST3( product_selfadjoint(Matrix3d()) ); - CALL_SUBTEST4( product_selfadjoint(MatrixXcf(4, 4)) ); - CALL_SUBTEST5( product_selfadjoint(MatrixXcd(21,21)) ); - CALL_SUBTEST6( product_selfadjoint(MatrixXd(14,14)) ); - CALL_SUBTEST7( product_selfadjoint(Matrix(17,17)) ); - CALL_SUBTEST8( product_selfadjoint(Matrix,Dynamic,Dynamic,RowMajor>(19, 19)) ); + CALL_SUBTEST_1( product_selfadjoint(Matrix()) ); + CALL_SUBTEST_2( product_selfadjoint(Matrix()) ); + CALL_SUBTEST_3( product_selfadjoint(Matrix3d()) ); + CALL_SUBTEST_4( product_selfadjoint(MatrixXcf(4, 4)) ); + CALL_SUBTEST_5( product_selfadjoint(MatrixXcd(21,21)) ); + CALL_SUBTEST_6( product_selfadjoint(MatrixXd(14,14)) ); + CALL_SUBTEST_7( product_selfadjoint(Matrix(17,17)) ); + CALL_SUBTEST_8( product_selfadjoint(Matrix,Dynamic,Dynamic,RowMajor>(19, 19)) ); } } diff --git a/test/product_small.cpp b/test/product_small.cpp index 3a667a5dc..d7f1c09ff 100644 --- a/test/product_small.cpp +++ b/test/product_small.cpp @@ -28,11 +28,11 @@ void test_product_small() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST1( product(Matrix()) ); - CALL_SUBTEST2( product(Matrix()) ); - CALL_SUBTEST3( product(Matrix3d()) ); - CALL_SUBTEST4( product(Matrix4d()) ); - CALL_SUBTEST5( product(Matrix4f()) ); + CALL_SUBTEST_1( product(Matrix()) ); + CALL_SUBTEST_2( product(Matrix()) ); + CALL_SUBTEST_3( product(Matrix3d()) ); + CALL_SUBTEST_4( product(Matrix4d()) ); + CALL_SUBTEST_5( product(Matrix4f()) ); } #ifdef EIGEN_TEST_PART_6 diff --git a/test/product_symm.cpp b/test/product_symm.cpp index ecd46c78e..a9e055bd3 100644 --- a/test/product_symm.cpp +++ b/test/product_symm.cpp @@ -108,10 +108,10 @@ void test_product_symm() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST1(( symm(ei_random(10,320),ei_random(10,320)) )); - CALL_SUBTEST2(( symm,Dynamic,Dynamic>(ei_random(10,320),ei_random(10,320)) )); + CALL_SUBTEST_1(( symm(ei_random(10,320),ei_random(10,320)) )); + CALL_SUBTEST_2(( symm,Dynamic,Dynamic>(ei_random(10,320),ei_random(10,320)) )); - CALL_SUBTEST3(( symm(ei_random(10,320)) )); - CALL_SUBTEST4(( symm,Dynamic,1>(ei_random(10,320)) )); + CALL_SUBTEST_3(( symm(ei_random(10,320)) )); + CALL_SUBTEST_4(( symm,Dynamic,1>(ei_random(10,320)) )); } } diff --git a/test/product_syrk.cpp b/test/product_syrk.cpp index 78b67bb1a..37d54bf16 100644 --- a/test/product_syrk.cpp +++ b/test/product_syrk.cpp @@ -75,8 +75,8 @@ void test_product_syrk() { int s; s = ei_random(10,320); - CALL_SUBTEST1( syrk(MatrixXf(s, s)) ); + CALL_SUBTEST_1( syrk(MatrixXf(s, s)) ); s = ei_random(10,320); - CALL_SUBTEST2( syrk(MatrixXcd(s, s)) ); + CALL_SUBTEST_2( syrk(MatrixXcd(s, s)) ); } } diff --git a/test/product_trmm.cpp b/test/product_trmm.cpp index c3234ba7e..5f92391e6 100644 --- a/test/product_trmm.cpp +++ b/test/product_trmm.cpp @@ -63,7 +63,7 @@ void test_product_trmm() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST1((trmm(ei_random(1,320),ei_random(1,320)))); - CALL_SUBTEST2((trmm >(ei_random(1,320),ei_random(1,320)))); + CALL_SUBTEST_1((trmm(ei_random(1,320),ei_random(1,320)))); + CALL_SUBTEST_2((trmm >(ei_random(1,320),ei_random(1,320)))); } } diff --git a/test/product_trmv.cpp b/test/product_trmv.cpp index 602cdca03..5016a5b1f 100644 --- a/test/product_trmv.cpp +++ b/test/product_trmv.cpp @@ -82,11 +82,11 @@ template void trmv(const MatrixType& m) void test_product_trmv() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST1( trmv(Matrix()) ); - CALL_SUBTEST2( trmv(Matrix()) ); - CALL_SUBTEST3( trmv(Matrix3d()) ); - CALL_SUBTEST4( trmv(Matrix,23, 23>()) ); - CALL_SUBTEST5( trmv(MatrixXcd(17,17)) ); - CALL_SUBTEST6( trmv(Matrix(19, 19)) ); + CALL_SUBTEST_1( trmv(Matrix()) ); + CALL_SUBTEST_2( trmv(Matrix()) ); + CALL_SUBTEST_3( trmv(Matrix3d()) ); + CALL_SUBTEST_4( trmv(Matrix,23, 23>()) ); + CALL_SUBTEST_5( trmv(MatrixXcd(17,17)) ); + CALL_SUBTEST_6( trmv(Matrix(19, 19)) ); } } diff --git a/test/product_trsm.cpp b/test/product_trsm.cpp index 2bd2e5e02..f850e031a 100644 --- a/test/product_trsm.cpp +++ b/test/product_trsm.cpp @@ -59,7 +59,7 @@ void test_product_trsm() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST1((trsm(ei_random(1,320),ei_random(1,320)))); - CALL_SUBTEST2((trsm >(ei_random(1,320),ei_random(1,320)))); + CALL_SUBTEST_1((trsm(ei_random(1,320),ei_random(1,320)))); + CALL_SUBTEST_2((trsm >(ei_random(1,320),ei_random(1,320)))); } } diff --git a/test/qr.cpp b/test/qr.cpp index 864828750..cbb23c4ca 100644 --- a/test/qr.cpp +++ b/test/qr.cpp @@ -115,24 +115,24 @@ template void qr_verify_assert() void test_qr() { for(int i = 0; i < 1; i++) { - CALL_SUBTEST( qr(MatrixXf(47,40)) ); - CALL_SUBTEST( qr(MatrixXcd(17,7)) ); - CALL_SUBTEST(( qr_fixedsize, 2 >() )); - CALL_SUBTEST(( qr_fixedsize, 4 >() )); - CALL_SUBTEST(( qr_fixedsize, 7 >() )); + CALL_SUBTEST_1( qr(MatrixXf(47,40)) ); + CALL_SUBTEST_2( qr(MatrixXcd(17,7)) ); + CALL_SUBTEST_3(( qr_fixedsize, 2 >() )); + CALL_SUBTEST_4(( qr_fixedsize, 4 >() )); + CALL_SUBTEST_5(( qr_fixedsize, 7 >() )); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); + CALL_SUBTEST_1( qr_invertible() ); + CALL_SUBTEST_6( qr_invertible() ); + CALL_SUBTEST_7( qr_invertible() ); + CALL_SUBTEST_8( qr_invertible() ); } - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); + CALL_SUBTEST_9(qr_verify_assert()); + CALL_SUBTEST_10(qr_verify_assert()); + CALL_SUBTEST_1(qr_verify_assert()); + CALL_SUBTEST_6(qr_verify_assert()); + CALL_SUBTEST_7(qr_verify_assert()); + CALL_SUBTEST_8(qr_verify_assert()); } diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp index 5c5c5d259..406be597d 100644 --- a/test/qr_colpivoting.cpp +++ b/test/qr_colpivoting.cpp @@ -36,7 +36,7 @@ template void qr() typedef Matrix VectorType; MatrixType m1; createRandomMatrixOfRank(rank,rows,cols,m1); - ColPivotingHouseholderQR qr(m1); + ColPivHouseholderQR qr(m1); VERIFY_IS_APPROX(rank, qr.rank()); VERIFY(cols - qr.rank() == qr.dimensionOfKernel()); VERIFY(!qr.isInjective()); @@ -74,7 +74,7 @@ template void qr_fixedsize() int rank = ei_random(1, std::min(int(Rows), int(Cols))-1); Matrix m1; createRandomMatrixOfRank(rank,Rows,Cols,m1); - ColPivotingHouseholderQR > qr(m1); + ColPivHouseholderQR > qr(m1); VERIFY_IS_APPROX(rank, qr.rank()); VERIFY(Cols - qr.rank() == qr.dimensionOfKernel()); VERIFY(!qr.isInjective()); @@ -118,7 +118,7 @@ template void qr_invertible() m1 += a * a.adjoint(); } - ColPivotingHouseholderQR qr(m1); + ColPivHouseholderQR qr(m1); m3 = MatrixType::Random(size,size); qr.solve(m3, &m2); VERIFY_IS_APPROX(m3, m1*m2); @@ -138,7 +138,7 @@ template void qr_verify_assert() { MatrixType tmp; - ColPivotingHouseholderQR qr; + ColPivHouseholderQR qr; VERIFY_RAISES_ASSERT(qr.matrixQR()) VERIFY_RAISES_ASSERT(qr.solve(tmp,&tmp)) VERIFY_RAISES_ASSERT(qr.matrixQ()) @@ -155,24 +155,24 @@ template void qr_verify_assert() void test_qr_colpivoting() { for(int i = 0; i < 1; i++) { - CALL_SUBTEST( qr() ); - CALL_SUBTEST( qr() ); - CALL_SUBTEST( qr() ); - CALL_SUBTEST(( qr_fixedsize, 4 >() )); - CALL_SUBTEST(( qr_fixedsize, 3 >() )); + CALL_SUBTEST_1( qr() ); + CALL_SUBTEST_2( qr() ); + CALL_SUBTEST_3( qr() ); + CALL_SUBTEST_4(( qr_fixedsize, 4 >() )); + CALL_SUBTEST_5(( qr_fixedsize, 3 >() )); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); + CALL_SUBTEST_1( qr_invertible() ); + CALL_SUBTEST_2( qr_invertible() ); + CALL_SUBTEST_6( qr_invertible() ); + CALL_SUBTEST_3( qr_invertible() ); } - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); + CALL_SUBTEST_7(qr_verify_assert()); + CALL_SUBTEST_8(qr_verify_assert()); + CALL_SUBTEST_1(qr_verify_assert()); + CALL_SUBTEST_2(qr_verify_assert()); + CALL_SUBTEST_6(qr_verify_assert()); + CALL_SUBTEST_3(qr_verify_assert()); } diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index 891c2a527..38ee4eac1 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -36,7 +36,7 @@ template void qr() typedef Matrix VectorType; MatrixType m1; createRandomMatrixOfRank(rank,rows,cols,m1); - FullPivotingHouseholderQR qr(m1); + FullPivHouseholderQR qr(m1); VERIFY_IS_APPROX(rank, qr.rank()); VERIFY(cols - qr.rank() == qr.dimensionOfKernel()); VERIFY(!qr.isInjective()); @@ -84,7 +84,7 @@ template void qr_invertible() m1 += a * a.adjoint(); } - FullPivotingHouseholderQR qr(m1); + FullPivHouseholderQR qr(m1); VERIFY(qr.isInjective()); VERIFY(qr.isInvertible()); VERIFY(qr.isSurjective()); @@ -108,7 +108,7 @@ template void qr_verify_assert() { MatrixType tmp; - FullPivotingHouseholderQR qr; + FullPivHouseholderQR qr; VERIFY_RAISES_ASSERT(qr.matrixQR()) VERIFY_RAISES_ASSERT(qr.solve(tmp,&tmp)) VERIFY_RAISES_ASSERT(qr.matrixQ()) @@ -126,23 +126,23 @@ void test_qr_fullpivoting() { for(int i = 0; i < 1; i++) { // FIXME : very weird bug here -// CALL_SUBTEST( qr(Matrix2f()) ); - CALL_SUBTEST( qr() ); - CALL_SUBTEST( qr() ); - CALL_SUBTEST( qr() ); +// CALL_SUBTEST(qr(Matrix2f()) ); + CALL_SUBTEST_1( qr() ); + CALL_SUBTEST_2( qr() ); + CALL_SUBTEST_3( qr() ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); - CALL_SUBTEST( qr_invertible() ); + CALL_SUBTEST_1( qr_invertible() ); + CALL_SUBTEST_2( qr_invertible() ); + CALL_SUBTEST_4( qr_invertible() ); + CALL_SUBTEST_3( qr_invertible() ); } - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); - CALL_SUBTEST(qr_verify_assert()); + CALL_SUBTEST_5(qr_verify_assert()); + CALL_SUBTEST_6(qr_verify_assert()); + CALL_SUBTEST_1(qr_verify_assert()); + CALL_SUBTEST_2(qr_verify_assert()); + CALL_SUBTEST_4(qr_verify_assert()); + CALL_SUBTEST_3(qr_verify_assert()); } diff --git a/test/redux.cpp b/test/redux.cpp index 951b34bca..c075c1393 100644 --- a/test/redux.cpp +++ b/test/redux.cpp @@ -112,16 +112,16 @@ template void vectorRedux(const VectorType& w) void test_redux() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( matrixRedux(Matrix()) ); - CALL_SUBTEST( matrixRedux(Matrix2f()) ); - CALL_SUBTEST( matrixRedux(Matrix4d()) ); - CALL_SUBTEST( matrixRedux(MatrixXcf(3, 3)) ); - CALL_SUBTEST( matrixRedux(MatrixXd(8, 12)) ); - CALL_SUBTEST( matrixRedux(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( matrixRedux(Matrix()) ); + CALL_SUBTEST_2( matrixRedux(Matrix2f()) ); + CALL_SUBTEST_3( matrixRedux(Matrix4d()) ); + CALL_SUBTEST_4( matrixRedux(MatrixXcf(3, 3)) ); + CALL_SUBTEST_5( matrixRedux(MatrixXd(8, 12)) ); + CALL_SUBTEST_6( matrixRedux(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( vectorRedux(Vector4f()) ); - CALL_SUBTEST( vectorRedux(VectorXd(10)) ); - CALL_SUBTEST( vectorRedux(VectorXf(33)) ); + CALL_SUBTEST_7( vectorRedux(Vector4f()) ); + CALL_SUBTEST_5( vectorRedux(VectorXd(10)) ); + CALL_SUBTEST_8( vectorRedux(VectorXf(33)) ); } } diff --git a/test/regression.cpp b/test/regression.cpp index 28b6356b3..0e2323bf6 100644 --- a/test/regression.cpp +++ b/test/regression.cpp @@ -95,6 +95,7 @@ void test_regression() { for(int i = 0; i < g_repeat; i++) { +#ifdef EIGEN_TEST_PART_1 { Vector2f points2f [1000]; Vector2f *points2f_ptrs [1000]; @@ -108,7 +109,9 @@ void test_regression() CALL_SUBTEST(check_linearRegression(100, points2f_ptrs, coeffs2f, 0.01f)); CALL_SUBTEST(check_linearRegression(1000, points2f_ptrs, coeffs2f, 0.002f)); } +#endif +#ifdef EIGEN_TEST_PART_2 { Vector2f points2f [1000]; Vector2f *points2f_ptrs [1000]; @@ -119,7 +122,9 @@ void test_regression() CALL_SUBTEST(check_fitHyperplane(100, points2f_ptrs, coeffs3f, 0.01f)); CALL_SUBTEST(check_fitHyperplane(1000, points2f_ptrs, coeffs3f, 0.002f)); } +#endif +#ifdef EIGEN_TEST_PART_3 { Vector4d points4d [1000]; Vector4d *points4d_ptrs [1000]; @@ -130,7 +135,9 @@ void test_regression() CALL_SUBTEST(check_fitHyperplane(100, points4d_ptrs, coeffs5d, 0.01)); CALL_SUBTEST(check_fitHyperplane(1000, points4d_ptrs, coeffs5d, 0.002)); } +#endif +#ifdef EIGEN_TEST_PART_4 { VectorXcd *points11cd_ptrs[1000]; for(int i = 0; i < 1000; i++) points11cd_ptrs[i] = new VectorXcd(11); @@ -141,5 +148,6 @@ void test_regression() delete coeffs12cd; for(int i = 0; i < 1000; i++) delete points11cd_ptrs[i]; } +#endif } } diff --git a/test/resize.cpp b/test/resize.cpp index 3c8f21ee1..dfe3bda17 100644 --- a/test/resize.cpp +++ b/test/resize.cpp @@ -50,7 +50,7 @@ void resizeLikeTest31() { resizeLikeTest<3,1>(); } void test_resize() { - CALL_SUBTEST( resizeLikeTest12() ); - CALL_SUBTEST( resizeLikeTest1020() ); - CALL_SUBTEST( resizeLikeTest31() ); + CALL_SUBTEST(resizeLikeTest12() ); + CALL_SUBTEST(resizeLikeTest1020() ); + CALL_SUBTEST(resizeLikeTest31() ); } diff --git a/test/sizeof.cpp b/test/sizeof.cpp index 8dc9ca7ef..a7243591a 100644 --- a/test/sizeof.cpp +++ b/test/sizeof.cpp @@ -35,14 +35,14 @@ template void verifySizeOf(const MatrixType&) void test_sizeof() { - CALL_SUBTEST( verifySizeOf(Matrix()) ); - CALL_SUBTEST( verifySizeOf(Matrix4d()) ); - CALL_SUBTEST( verifySizeOf(Matrix()) ); - CALL_SUBTEST( verifySizeOf(Matrix()) ); - CALL_SUBTEST( verifySizeOf(MatrixXcf(3, 3)) ); - CALL_SUBTEST( verifySizeOf(MatrixXi(8, 12)) ); - CALL_SUBTEST( verifySizeOf(MatrixXcd(20, 20)) ); - CALL_SUBTEST( verifySizeOf(Matrix()) ); + CALL_SUBTEST(verifySizeOf(Matrix()) ); + CALL_SUBTEST(verifySizeOf(Matrix4d()) ); + CALL_SUBTEST(verifySizeOf(Matrix()) ); + CALL_SUBTEST(verifySizeOf(Matrix()) ); + CALL_SUBTEST(verifySizeOf(MatrixXcf(3, 3)) ); + CALL_SUBTEST(verifySizeOf(MatrixXi(8, 12)) ); + CALL_SUBTEST(verifySizeOf(MatrixXcd(20, 20)) ); + CALL_SUBTEST(verifySizeOf(Matrix()) ); VERIFY(sizeof(std::complex) == 2*sizeof(float)); VERIFY(sizeof(std::complex) == 2*sizeof(double)); diff --git a/test/smallvectors.cpp b/test/smallvectors.cpp index f0807c796..d6dc8e97c 100644 --- a/test/smallvectors.cpp +++ b/test/smallvectors.cpp @@ -50,8 +50,8 @@ template void smallVectors() void test_smallvectors() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( smallVectors() ); - CALL_SUBTEST( smallVectors() ); - CALL_SUBTEST( smallVectors() ); + CALL_SUBTEST(smallVectors() ); + CALL_SUBTEST(smallVectors() ); + CALL_SUBTEST(smallVectors() ); } } diff --git a/test/sparse_basic.cpp b/test/sparse_basic.cpp index 666eea872..050b14995 100644 --- a/test/sparse_basic.cpp +++ b/test/sparse_basic.cpp @@ -344,10 +344,10 @@ template void sparse_basic(const SparseMatrixType& re void test_sparse_basic() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( sparse_basic(SparseMatrix(8, 8)) ); - CALL_SUBTEST( sparse_basic(SparseMatrix >(16, 16)) ); - CALL_SUBTEST( sparse_basic(SparseMatrix(33, 33)) ); + CALL_SUBTEST_1( sparse_basic(SparseMatrix(8, 8)) ); + CALL_SUBTEST_2( sparse_basic(SparseMatrix >(16, 16)) ); + CALL_SUBTEST_1( sparse_basic(SparseMatrix(33, 33)) ); - CALL_SUBTEST( sparse_basic(DynamicSparseMatrix(8, 8)) ); + CALL_SUBTEST_3( sparse_basic(DynamicSparseMatrix(8, 8)) ); } } diff --git a/test/sparse_product.cpp b/test/sparse_product.cpp index 743273f65..f2a4e8bb9 100644 --- a/test/sparse_product.cpp +++ b/test/sparse_product.cpp @@ -123,10 +123,10 @@ template void sparse_product(const SparseMatrixType& void test_sparse_product() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( sparse_product(SparseMatrix(8, 8)) ); - CALL_SUBTEST( sparse_product(SparseMatrix >(16, 16)) ); - CALL_SUBTEST( sparse_product(SparseMatrix(33, 33)) ); + CALL_SUBTEST_1( sparse_product(SparseMatrix(8, 8)) ); + CALL_SUBTEST_2( sparse_product(SparseMatrix >(16, 16)) ); + CALL_SUBTEST_1( sparse_product(SparseMatrix(33, 33)) ); - CALL_SUBTEST( sparse_product(DynamicSparseMatrix(8, 8)) ); + CALL_SUBTEST_3( sparse_product(DynamicSparseMatrix(8, 8)) ); } } diff --git a/test/sparse_solvers.cpp b/test/sparse_solvers.cpp index 09ae1ad60..6c1bb9b33 100644 --- a/test/sparse_solvers.cpp +++ b/test/sparse_solvers.cpp @@ -172,8 +172,8 @@ template void sparse_solvers(int rows, int cols) initSparse(density, refMat2, m2, ForceNonZeroDiag, &zeroCoords, &nonzeroCoords); - LU refLu(refMat2); - refLu.solve(b, &refX); + FullPivLU refLu(refMat2); + refX = refLu.solve(b); #if defined(EIGEN_SUPERLU_SUPPORT) || defined(EIGEN_UMFPACK_SUPPORT) Scalar refDet = refLu.determinant(); #endif @@ -229,8 +229,8 @@ template void sparse_solvers(int rows, int cols) void test_sparse_solvers() { for(int i = 0; i < g_repeat; i++) { -// CALL_SUBTEST( sparse_solvers(8, 8) ); - CALL_SUBTEST( sparse_solvers >(16, 16) ); -// CALL_SUBTEST( sparse_solvers(100, 100) ); +// CALL_SUBTEST(sparse_solvers(8, 8) ); + CALL_SUBTEST(sparse_solvers >(16, 16) ); +// CALL_SUBTEST(sparse_solvers(100, 100) ); } } diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp index 236e14f1b..5c6dadc00 100644 --- a/test/sparse_vector.cpp +++ b/test/sparse_vector.cpp @@ -91,9 +91,9 @@ template void sparse_vector(int rows, int cols) void test_sparse_vector() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( sparse_vector(8, 8) ); - CALL_SUBTEST( sparse_vector >(16, 16) ); - CALL_SUBTEST( sparse_vector(299, 535) ); + CALL_SUBTEST_1( sparse_vector(8, 8) ); + CALL_SUBTEST_2( sparse_vector >(16, 16) ); + CALL_SUBTEST_1( sparse_vector(299, 535) ); } } diff --git a/test/stable_norm.cpp b/test/stable_norm.cpp index ed72bb7a7..7661fc893 100644 --- a/test/stable_norm.cpp +++ b/test/stable_norm.cpp @@ -84,10 +84,10 @@ template void stable_norm(const MatrixType& m) void test_stable_norm() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( stable_norm(Matrix()) ); - CALL_SUBTEST( stable_norm(Vector4d()) ); - CALL_SUBTEST( stable_norm(VectorXd(ei_random(10,2000))) ); - CALL_SUBTEST( stable_norm(VectorXf(ei_random(10,2000))) ); - CALL_SUBTEST( stable_norm(VectorXcd(ei_random(10,2000))) ); + CALL_SUBTEST_1( stable_norm(Matrix()) ); + CALL_SUBTEST_2( stable_norm(Vector4d()) ); + CALL_SUBTEST_3( stable_norm(VectorXd(ei_random(10,2000))) ); + CALL_SUBTEST_4( stable_norm(VectorXf(ei_random(10,2000))) ); + CALL_SUBTEST_5( stable_norm(VectorXcd(ei_random(10,2000))) ); } } diff --git a/test/stdvector.cpp b/test/stdvector.cpp index a976f0cf1..bdca826f4 100644 --- a/test/stdvector.cpp +++ b/test/stdvector.cpp @@ -135,29 +135,29 @@ void check_stdvector_quaternion(const QuaternionType&) void test_stdvector() { // some non vectorizable fixed sizes - CALL_SUBTEST(check_stdvector_matrix(Vector2f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix3f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix3d())); + CALL_SUBTEST_1(check_stdvector_matrix(Vector2f())); + CALL_SUBTEST_1(check_stdvector_matrix(Matrix3f())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix3d())); // some vectorizable fixed sizes - CALL_SUBTEST(check_stdvector_matrix(Matrix2f())); - CALL_SUBTEST(check_stdvector_matrix(Vector4f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix4f())); - CALL_SUBTEST(check_stdvector_matrix(Matrix4d())); + CALL_SUBTEST_1(check_stdvector_matrix(Matrix2f())); + CALL_SUBTEST_1(check_stdvector_matrix(Vector4f())); + CALL_SUBTEST_1(check_stdvector_matrix(Matrix4f())); + CALL_SUBTEST_2(check_stdvector_matrix(Matrix4d())); // some dynamic sizes - CALL_SUBTEST(check_stdvector_matrix(MatrixXd(1,1))); - CALL_SUBTEST(check_stdvector_matrix(VectorXd(20))); - CALL_SUBTEST(check_stdvector_matrix(RowVectorXf(20))); - CALL_SUBTEST(check_stdvector_matrix(MatrixXcf(10,10))); + CALL_SUBTEST_3(check_stdvector_matrix(MatrixXd(1,1))); + CALL_SUBTEST_3(check_stdvector_matrix(VectorXd(20))); + CALL_SUBTEST_3(check_stdvector_matrix(RowVectorXf(20))); + CALL_SUBTEST_3(check_stdvector_matrix(MatrixXcf(10,10))); // some Transform - CALL_SUBTEST(check_stdvector_transform(Transform2f())); - CALL_SUBTEST(check_stdvector_transform(Transform3f())); - CALL_SUBTEST(check_stdvector_transform(Transform3d())); - //CALL_SUBTEST(check_stdvector_transform(Transform4d())); + CALL_SUBTEST_4(check_stdvector_transform(Transform2f())); + CALL_SUBTEST_4(check_stdvector_transform(Transform3f())); + CALL_SUBTEST_4(check_stdvector_transform(Transform3d())); + //CALL_SUBTEST(heck_stdvector_transform(Transform4d())); // some Quaternion - CALL_SUBTEST(check_stdvector_quaternion(Quaternionf())); - CALL_SUBTEST(check_stdvector_quaternion(Quaterniond())); + CALL_SUBTEST_5(check_stdvector_quaternion(Quaternionf())); + CALL_SUBTEST_5(check_stdvector_quaternion(Quaterniond())); } diff --git a/test/submatrices.cpp b/test/submatrices.cpp index 6fe86c281..75b0fde4b 100644 --- a/test/submatrices.cpp +++ b/test/submatrices.cpp @@ -215,14 +215,14 @@ void data_and_stride(const MatrixType& m) void test_submatrices() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( submatrices(Matrix()) ); - CALL_SUBTEST( submatrices(Matrix4d()) ); - CALL_SUBTEST( submatrices(MatrixXcf(3, 3)) ); - CALL_SUBTEST( submatrices(MatrixXi(8, 12)) ); - CALL_SUBTEST( submatrices(MatrixXcd(20, 20)) ); - CALL_SUBTEST( submatrices(MatrixXf(20, 20)) ); + CALL_SUBTEST_1( submatrices(Matrix()) ); + CALL_SUBTEST_2( submatrices(Matrix4d()) ); + CALL_SUBTEST_3( submatrices(MatrixXcf(3, 3)) ); + CALL_SUBTEST_4( submatrices(MatrixXi(8, 12)) ); + CALL_SUBTEST_5( submatrices(MatrixXcd(20, 20)) ); + CALL_SUBTEST_6( submatrices(MatrixXf(20, 20)) ); - CALL_SUBTEST( data_and_stride(MatrixXf(ei_random(5,50), ei_random(5,50))) ); - CALL_SUBTEST( data_and_stride(Matrix(ei_random(5,50), ei_random(5,50))) ); + CALL_SUBTEST_6( data_and_stride(MatrixXf(ei_random(5,50), ei_random(5,50))) ); + CALL_SUBTEST_7( data_and_stride(Matrix(ei_random(5,50), ei_random(5,50))) ); } } diff --git a/test/svd.cpp b/test/svd.cpp index e6a32bd3f..188698a0b 100644 --- a/test/svd.cpp +++ b/test/svd.cpp @@ -100,17 +100,17 @@ template void svd_verify_assert() void test_svd() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( svd(Matrix3f()) ); - CALL_SUBTEST( svd(Matrix4d()) ); - CALL_SUBTEST( svd(MatrixXf(7,7)) ); - CALL_SUBTEST( svd(MatrixXd(14,7)) ); + CALL_SUBTEST_1( svd(Matrix3f()) ); + CALL_SUBTEST_2( svd(Matrix4d()) ); + CALL_SUBTEST_3( svd(MatrixXf(7,7)) ); + CALL_SUBTEST_4( svd(MatrixXd(14,7)) ); // complex are not implemented yet -// CALL_SUBTEST( svd(MatrixXcd(6,6)) ); -// CALL_SUBTEST( svd(MatrixXcf(3,3)) ); +// CALL_SUBTEST(svd(MatrixXcd(6,6)) ); +// CALL_SUBTEST(svd(MatrixXcf(3,3)) ); } - CALL_SUBTEST( svd_verify_assert() ); - CALL_SUBTEST( svd_verify_assert() ); - CALL_SUBTEST( svd_verify_assert() ); - CALL_SUBTEST( svd_verify_assert() ); + CALL_SUBTEST_1( svd_verify_assert() ); + CALL_SUBTEST_2( svd_verify_assert() ); + CALL_SUBTEST_3( svd_verify_assert() ); + CALL_SUBTEST_4( svd_verify_assert() ); } diff --git a/test/swap.cpp b/test/swap.cpp index 8b325992c..c11f0fec0 100644 --- a/test/swap.cpp +++ b/test/swap.cpp @@ -91,8 +91,8 @@ template void swap(const MatrixType& m) void test_swap() { - CALL_SUBTEST( swap(Matrix3f()) ); // fixed size, no vectorization - CALL_SUBTEST( swap(Matrix4d()) ); // fixed size, possible vectorization - CALL_SUBTEST( swap(MatrixXd(3,3)) ); // dyn size, no vectorization - CALL_SUBTEST( swap(MatrixXf(30,30)) ); // dyn size, possible vectorization + CALL_SUBTEST_1( swap(Matrix3f()) ); // fixed size, no vectorization + CALL_SUBTEST_2( swap(Matrix4d()) ); // fixed size, possible vectorization + CALL_SUBTEST_3( swap(MatrixXd(3,3)) ); // dyn size, no vectorization + CALL_SUBTEST_4( swap(MatrixXf(30,30)) ); // dyn size, possible vectorization } diff --git a/test/triangular.cpp b/test/triangular.cpp index 1e0782523..ee02c0022 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -137,12 +137,12 @@ template void triangular(const MatrixType& m) void test_triangular() { for(int i = 0; i < g_repeat ; i++) { - CALL_SUBTEST( triangular(Matrix()) ); - CALL_SUBTEST( triangular(Matrix()) ); - CALL_SUBTEST( triangular(Matrix3d()) ); - CALL_SUBTEST( triangular(MatrixXcf(4, 4)) ); - CALL_SUBTEST( triangular(Matrix,8, 8>()) ); - CALL_SUBTEST( triangular(MatrixXcd(17,17)) ); - CALL_SUBTEST( triangular(Matrix(5, 5)) ); + CALL_SUBTEST_1( triangular(Matrix()) ); + CALL_SUBTEST_2( triangular(Matrix()) ); + CALL_SUBTEST_3( triangular(Matrix3d()) ); + CALL_SUBTEST_4( triangular(MatrixXcf(4, 4)) ); + CALL_SUBTEST_5( triangular(Matrix,8, 8>()) ); + CALL_SUBTEST_6( triangular(MatrixXcd(17,17)) ); + CALL_SUBTEST_7( triangular(Matrix(5, 5)) ); } } diff --git a/test/umeyama.cpp b/test/umeyama.cpp index 0999c59c9..09db27c1b 100644 --- a/test/umeyama.cpp +++ b/test/umeyama.cpp @@ -181,17 +181,17 @@ void test_umeyama() // works also for dimensions bigger than 3... for (int dim=2; dim<8; ++dim) { - CALL_SUBTEST(run_test(dim, num_elements)); - CALL_SUBTEST(run_test(dim, num_elements)); + CALL_SUBTEST_1(run_test(dim, num_elements)); + CALL_SUBTEST_2(run_test(dim, num_elements)); } - CALL_SUBTEST((run_fixed_size_test(num_elements))); - CALL_SUBTEST((run_fixed_size_test(num_elements))); - CALL_SUBTEST((run_fixed_size_test(num_elements))); + CALL_SUBTEST_3((run_fixed_size_test(num_elements))); + CALL_SUBTEST_4((run_fixed_size_test(num_elements))); + CALL_SUBTEST_5((run_fixed_size_test(num_elements))); - CALL_SUBTEST((run_fixed_size_test(num_elements))); - CALL_SUBTEST((run_fixed_size_test(num_elements))); - CALL_SUBTEST((run_fixed_size_test(num_elements))); + CALL_SUBTEST_6((run_fixed_size_test(num_elements))); + CALL_SUBTEST_7((run_fixed_size_test(num_elements))); + CALL_SUBTEST_8((run_fixed_size_test(num_elements))); } // Those two calls don't compile and result in meaningful error messages! diff --git a/test/visitor.cpp b/test/visitor.cpp index 6ec442bc8..65ee60ba4 100644 --- a/test/visitor.cpp +++ b/test/visitor.cpp @@ -115,17 +115,17 @@ template void vectorVisitor(const VectorType& w) void test_visitor() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( matrixVisitor(Matrix()) ); - CALL_SUBTEST( matrixVisitor(Matrix2f()) ); - CALL_SUBTEST( matrixVisitor(Matrix4d()) ); - CALL_SUBTEST( matrixVisitor(MatrixXd(8, 12)) ); - CALL_SUBTEST( matrixVisitor(Matrix(20, 20)) ); - CALL_SUBTEST( matrixVisitor(MatrixXi(8, 12)) ); + CALL_SUBTEST_1( matrixVisitor(Matrix()) ); + CALL_SUBTEST_2( matrixVisitor(Matrix2f()) ); + CALL_SUBTEST_3( matrixVisitor(Matrix4d()) ); + CALL_SUBTEST_4( matrixVisitor(MatrixXd(8, 12)) ); + CALL_SUBTEST_5( matrixVisitor(Matrix(20, 20)) ); + CALL_SUBTEST_6( matrixVisitor(MatrixXi(8, 12)) ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST( vectorVisitor(Vector4f()) ); - CALL_SUBTEST( vectorVisitor(VectorXd(10)) ); - CALL_SUBTEST( vectorVisitor(RowVectorXd(10)) ); - CALL_SUBTEST( vectorVisitor(VectorXf(33)) ); + CALL_SUBTEST_7( vectorVisitor(Vector4f()) ); + CALL_SUBTEST_8( vectorVisitor(VectorXd(10)) ); + CALL_SUBTEST_9( vectorVisitor(RowVectorXd(10)) ); + CALL_SUBTEST_10( vectorVisitor(VectorXf(33)) ); } } diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h index 36d13b7eb..636f37655 100644 --- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h @@ -192,7 +192,7 @@ MatrixExponential::MatrixExponential(const MatrixType &M, MatrixType computeUV(RealScalar()); m_tmp1 = m_U + m_V; // numerator of Pade approximant m_tmp2 = -m_U + m_V; // denominator of Pade approximant - m_tmp2.partialLu().solve(m_tmp1, result); + *result = m_tmp2.partialPivLu().solve(m_tmp1); for (int i=0; i test2; CALL_SUBTEST(test2.testIntersect1()); CALL_SUBTEST(test2.testMinimize1()); CALL_SUBTEST(test2.testIntersect2()); CALL_SUBTEST(test2.testMinimize2()); +#endif +#ifdef EIGEN_TEST_PART_2 TreeTest<3> test3; CALL_SUBTEST(test3.testIntersect1()); CALL_SUBTEST(test3.testMinimize1()); CALL_SUBTEST(test3.testIntersect2()); CALL_SUBTEST(test3.testMinimize2()); +#endif +#ifdef EIGEN_TEST_PART_3 TreeTest<4> test4; CALL_SUBTEST(test4.testIntersect1()); CALL_SUBTEST(test4.testMinimize1()); CALL_SUBTEST(test4.testIntersect2()); CALL_SUBTEST(test4.testMinimize2()); +#endif } } diff --git a/unsupported/test/alignedvector3.cpp b/unsupported/test/alignedvector3.cpp index 52d39ce50..f4b6dd4d9 100644 --- a/unsupported/test/alignedvector3.cpp +++ b/unsupported/test/alignedvector3.cpp @@ -69,6 +69,6 @@ void alignedvector3() void test_alignedvector3() { for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST(( alignedvector3() )); + CALL_SUBTEST( alignedvector3() ); } } diff --git a/unsupported/test/matrixExponential.cpp b/unsupported/test/matrixExponential.cpp index 7d65a701a..f7ee71768 100644 --- a/unsupported/test/matrixExponential.cpp +++ b/unsupported/test/matrixExponential.cpp @@ -110,18 +110,18 @@ void randomTest(const MatrixType& m, double tol) void test_matrixExponential() { - CALL_SUBTEST(test2dRotation(1e-14)); - CALL_SUBTEST(test2dRotation(1e-5)); - CALL_SUBTEST(test2dHyperbolicRotation(1e-14)); - CALL_SUBTEST(test2dHyperbolicRotation(1e-5)); - CALL_SUBTEST(testPascal(1e-5)); - CALL_SUBTEST(testPascal(1e-14)); - CALL_SUBTEST(randomTest(Matrix2d(), 1e-13)); - CALL_SUBTEST(randomTest(Matrix(), 1e-13)); - CALL_SUBTEST(randomTest(Matrix4cd(), 1e-13)); - CALL_SUBTEST(randomTest(MatrixXd(8,8), 1e-13)); - CALL_SUBTEST(randomTest(Matrix2f(), 1e-4)); - CALL_SUBTEST(randomTest(Matrix3cf(), 1e-4)); - CALL_SUBTEST(randomTest(Matrix4f(), 1e-4)); - CALL_SUBTEST(randomTest(MatrixXf(8,8), 1e-4)); + CALL_SUBTEST_2(test2dRotation(1e-14)); + CALL_SUBTEST_1(test2dRotation(1e-5)); + CALL_SUBTEST_2(test2dHyperbolicRotation(1e-14)); + CALL_SUBTEST_1(test2dHyperbolicRotation(1e-5)); + CALL_SUBTEST_1(testPascal(1e-5)); + CALL_SUBTEST_2(testPascal(1e-14)); + CALL_SUBTEST_2(randomTest(Matrix2d(), 1e-13)); + CALL_SUBTEST_2(randomTest(Matrix(), 1e-13)); + CALL_SUBTEST_3(randomTest(Matrix4cd(), 1e-13)); + CALL_SUBTEST_4(randomTest(MatrixXd(8,8), 1e-13)); + CALL_SUBTEST_1(randomTest(Matrix2f(), 1e-4)); + CALL_SUBTEST_5(randomTest(Matrix3cf(), 1e-4)); + CALL_SUBTEST_1(randomTest(Matrix4f(), 1e-4)); + CALL_SUBTEST_6(randomTest(MatrixXf(8,8), 1e-4)); }