From 6156797016164b87b3e360e02d0e4107f7f66fbc Mon Sep 17 00:00:00 2001 From: Rasmus Munk Larsen Date: Wed, 11 Jan 2023 18:50:52 +0000 Subject: [PATCH] Revert "Add template to specify QR permutation index type, Fix ColPivHouseholderQR Lapacke bindings" This reverts commit be7791e097c1fc21d4f2e8713467431784f3a4fd --- Eigen/src/Cholesky/LLT_LAPACKE.h | 4 +- Eigen/src/Core/MatrixBase.h | 6 +- Eigen/src/Core/util/ForwardDeclarations.h | 13 +- Eigen/src/QR/ColPivHouseholderQR.h | 75 +++++---- Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h | 156 ++++++------------ .../src/QR/CompleteOrthogonalDecomposition.h | 71 ++++---- Eigen/src/QR/FullPivHouseholderQR.h | 68 ++++---- Eigen/src/misc/lapacke_helpers.h | 6 +- test/qr_colpivoting.cpp | 105 ++++++------ test/qr_fullpivoting.cpp | 57 ++++--- 10 files changed, 252 insertions(+), 309 deletions(-) diff --git a/Eigen/src/Cholesky/LLT_LAPACKE.h b/Eigen/src/Cholesky/LLT_LAPACKE.h index a32ff2307..62bc679d4 100644 --- a/Eigen/src/Cholesky/LLT_LAPACKE.h +++ b/Eigen/src/Cholesky/LLT_LAPACKE.h @@ -70,7 +70,6 @@ namespace lapacke_helpers { template struct lapacke_llt { - EIGEN_STATIC_ASSERT(((Mode == Lower) || (Mode == Upper)),MODE_MUST_BE_UPPER_OR_LOWER) template static Index blocked(MatrixType& m) { @@ -81,11 +80,10 @@ namespace lapacke_helpers { /* Set up parameters for ?potrf */ lapack_int size = to_lapack(m.rows()); lapack_int matrix_order = lapack_storage_of(m); - constexpr char uplo = Mode == Upper ? 'U' : 'L'; Scalar* a = &(m.coeffRef(0,0)); lapack_int lda = to_lapack(m.outerStride()); - lapack_int info = potrf(matrix_order, uplo, size, to_lapack(a), lda ); + lapack_int info = potrf(matrix_order, translate_mode, size, to_lapack(a), lda ); info = (info==0) ? -1 : info>0 ? info-1 : size; return info; } diff --git a/Eigen/src/Core/MatrixBase.h b/Eigen/src/Core/MatrixBase.h index c6e81a712..ea2178fe3 100644 --- a/Eigen/src/Core/MatrixBase.h +++ b/Eigen/src/Core/MatrixBase.h @@ -362,9 +362,9 @@ template class MatrixBase /////////// QR module /////////// inline const HouseholderQR householderQr() const; - template inline const ColPivHouseholderQR colPivHouseholderQr() const; - template inline const FullPivHouseholderQR fullPivHouseholderQr() const; - template inline const CompleteOrthogonalDecomposition completeOrthogonalDecomposition() const; + inline const ColPivHouseholderQR colPivHouseholderQr() const; + inline const FullPivHouseholderQR fullPivHouseholderQr() const; + inline const CompleteOrthogonalDecomposition completeOrthogonalDecomposition() const; /////////// Eigenvalues module /////////// diff --git a/Eigen/src/Core/util/ForwardDeclarations.h b/Eigen/src/Core/util/ForwardDeclarations.h index 1ebe0cd37..8f87c4a2c 100644 --- a/Eigen/src/Core/util/ForwardDeclarations.h +++ b/Eigen/src/Core/util/ForwardDeclarations.h @@ -252,22 +252,15 @@ template class VectorwiseOp; template class Replicate; template class Reverse; -#if defined(EIGEN_USE_LAPACKE) -// Lapacke interface requires StorageIndex to be lapack_int -typedef lapack_int DefaultStorageIndex; -#else -typedef int DefaultStorageIndex; -#endif - template class FullPivLU; template class PartialPivLU; namespace internal { template struct inverse_impl; } template class HouseholderQR; -template class ColPivHouseholderQR; -template class FullPivHouseholderQR; -template class CompleteOrthogonalDecomposition; +template class ColPivHouseholderQR; +template class FullPivHouseholderQR; +template class CompleteOrthogonalDecomposition; template class SVDBase; template class JacobiSVD; template class BDCSVD; diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h index 32494df78..c906997fc 100644 --- a/Eigen/src/QR/ColPivHouseholderQR.h +++ b/Eigen/src/QR/ColPivHouseholderQR.h @@ -16,12 +16,12 @@ namespace Eigen { namespace internal { -template struct traits > +template struct traits > : traits { typedef MatrixXpr XprKind; typedef SolverStorage StorageKind; - typedef StorageIndex_ StorageIndex; + typedef int StorageIndex; enum { Flags = 0 }; }; @@ -50,8 +50,8 @@ template struct traits class ColPivHouseholderQR - : public SolverBase > +template class ColPivHouseholderQR + : public SolverBase > { public: @@ -65,13 +65,17 @@ template class ColPivHouseholderQR MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }; typedef typename internal::plain_diag_type::type HCoeffsType; - typedef PermutationMatrix PermutationType; + typedef PermutationMatrix PermutationType; typedef typename internal::plain_row_type::type IntRowVectorType; typedef typename internal::plain_row_type::type RowVectorType; typedef typename internal::plain_row_type::type RealRowVectorType; typedef HouseholderSequence> HouseholderSequenceType; typedef typename MatrixType::PlainObject PlainObject; + private: + + typedef typename PermutationType::StorageIndex PermIndexType; + public: /** @@ -100,7 +104,7 @@ template class ColPivHouseholderQR ColPivHouseholderQR(Index rows, Index cols) : m_qr(rows, cols), m_hCoeffs((std::min)(rows,cols)), - m_colsPermutation(cols), + m_colsPermutation(PermIndexType(cols)), m_colsTranspositions(cols), m_temp(cols), m_colNormsUpdated(cols), @@ -124,7 +128,7 @@ template class ColPivHouseholderQR explicit ColPivHouseholderQR(const EigenBase& matrix) : m_qr(matrix.rows(), matrix.cols()), m_hCoeffs((std::min)(matrix.rows(),matrix.cols())), - m_colsPermutation(matrix.cols()), + m_colsPermutation(PermIndexType(matrix.cols())), m_colsTranspositions(matrix.cols()), m_temp(matrix.cols()), m_colNormsUpdated(matrix.cols()), @@ -145,7 +149,7 @@ template class ColPivHouseholderQR explicit ColPivHouseholderQR(EigenBase& matrix) : m_qr(matrix.derived()), m_hCoeffs((std::min)(matrix.rows(),matrix.cols())), - m_colsPermutation(matrix.cols()), + m_colsPermutation(PermIndexType(matrix.cols())), m_colsTranspositions(matrix.cols()), m_temp(matrix.cols()), m_colNormsUpdated(matrix.cols()), @@ -437,7 +441,7 @@ template class ColPivHouseholderQR protected: - friend class CompleteOrthogonalDecomposition; + friend class CompleteOrthogonalDecomposition; EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) @@ -456,8 +460,8 @@ template class ColPivHouseholderQR Index m_det_p; }; -template -typename MatrixType::Scalar ColPivHouseholderQR::determinant() const +template +typename MatrixType::Scalar ColPivHouseholderQR::determinant() const { eigen_assert(m_isInitialized && "HouseholderQR is not initialized."); eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); @@ -466,8 +470,8 @@ typename MatrixType::Scalar ColPivHouseholderQR::deter return m_qr.diagonal().prod() * detQ * Scalar(m_det_p); } -template -typename MatrixType::RealScalar ColPivHouseholderQR::absDeterminant() const +template +typename MatrixType::RealScalar ColPivHouseholderQR::absDeterminant() const { using std::abs; eigen_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); @@ -475,8 +479,8 @@ typename MatrixType::RealScalar ColPivHouseholderQR::a return abs(m_qr.diagonal().prod()); } -template -typename MatrixType::RealScalar ColPivHouseholderQR::logAbsDeterminant() const +template +typename MatrixType::RealScalar ColPivHouseholderQR::logAbsDeterminant() const { eigen_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); @@ -489,20 +493,20 @@ typename MatrixType::RealScalar ColPivHouseholderQR::l * * \sa class ColPivHouseholderQR, ColPivHouseholderQR(const MatrixType&) */ -template +template template -ColPivHouseholderQR& ColPivHouseholderQR::compute(const EigenBase& matrix) +ColPivHouseholderQR& ColPivHouseholderQR::compute(const EigenBase& matrix) { m_qr = matrix.derived(); computeInPlace(); return *this; } -template -void ColPivHouseholderQR::computeInPlace() +template +void ColPivHouseholderQR::computeInPlace() { - - eigen_assert(m_qr.cols()<=NumTraits::highest()); + // the column permutation is stored as int indices, so just to be sure: + eigen_assert(m_qr.cols()<=NumTraits::highest()); using std::abs; @@ -591,18 +595,18 @@ void ColPivHouseholderQR::computeInPlace() } } - m_colsPermutation.setIdentity(cols); - for(Index k = 0; k < size/*m_nonzero_pivots*/; ++k) - m_colsPermutation.applyTranspositionOnTheRight(k, m_colsTranspositions.coeff(k)); + m_colsPermutation.setIdentity(PermIndexType(cols)); + for(PermIndexType k = 0; k < size/*m_nonzero_pivots*/; ++k) + m_colsPermutation.applyTranspositionOnTheRight(k, PermIndexType(m_colsTranspositions.coeff(k))); m_det_p = (number_of_transpositions%2) ? -1 : 1; m_isInitialized = true; } #ifndef EIGEN_PARSED_BY_DOXYGEN -template +template template -void ColPivHouseholderQR::_solve_impl(const RhsType &rhs, DstType &dst) const +void ColPivHouseholderQR::_solve_impl(const RhsType &rhs, DstType &dst) const { const Index nonzero_pivots = nonzeroPivots(); @@ -624,9 +628,9 @@ void ColPivHouseholderQR::_solve_impl(const RhsType for(Index i = nonzero_pivots; i < cols(); ++i) dst.row(m_colsPermutation.indices().coeff(i)).setZero(); } -template +template template -void ColPivHouseholderQR::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const +void ColPivHouseholderQR::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const { const Index nonzero_pivots = nonzeroPivots(); @@ -652,10 +656,10 @@ void ColPivHouseholderQR::_solve_impl_transposed(con namespace internal { -template -struct Assignment >, internal::assign_op::Scalar>, Dense2Dense> +template +struct Assignment >, internal::assign_op::Scalar>, Dense2Dense> { - typedef ColPivHouseholderQR QrType; + typedef ColPivHouseholderQR QrType; typedef Inverse SrcXprType; static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) { @@ -668,8 +672,8 @@ struct Assignment -typename ColPivHouseholderQR::HouseholderSequenceType ColPivHouseholderQR +template +typename ColPivHouseholderQR::HouseholderSequenceType ColPivHouseholderQR ::householderQ() const { eigen_assert(m_isInitialized && "ColPivHouseholderQR is not initialized."); @@ -681,11 +685,10 @@ typename ColPivHouseholderQR::HouseholderSequenceType * \sa class ColPivHouseholderQR */ template -template -const ColPivHouseholderQR::PlainObject, StorageIndex> +const ColPivHouseholderQR::PlainObject> MatrixBase::colPivHouseholderQr() const { - return ColPivHouseholderQR(eval()); + return ColPivHouseholderQR(eval()); } } // end namespace Eigen diff --git a/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h b/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h index 15f0978bf..7652d3130 100644 --- a/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +++ b/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h @@ -36,110 +36,64 @@ #include "./InternalHeaderCheck.h" -namespace Eigen { +namespace Eigen { -#if defined(EIGEN_USE_LAPACKE) +/** \internal Specialization for the data types supported by LAPACKe */ - template - inline lapack_int call_geqp3(int matrix_layout, lapack_int m, lapack_int n, Scalar* a, lapack_int lda, lapack_int* jpvt, Scalar* tau); - template<> - inline lapack_int call_geqp3(int matrix_layout, lapack_int m, lapack_int n, float* a, lapack_int lda, lapack_int* jpvt, float* tau) - { return LAPACKE_sgeqp3(matrix_layout, m, n, a, lda, jpvt, tau); } - template<> - inline lapack_int call_geqp3(int matrix_layout, lapack_int m, lapack_int n, double* a, lapack_int lda, lapack_int* jpvt, double* tau) - { return LAPACKE_dgeqp3(matrix_layout, m, n, a, lda, jpvt, tau); } - template<> - inline lapack_int call_geqp3(int matrix_layout, lapack_int m, lapack_int n, lapack_complex_float* a, lapack_int lda, lapack_int* jpvt, lapack_complex_float* tau) - { return LAPACKE_cgeqp3(matrix_layout, m, n, a, lda, jpvt, tau); } - template<> - inline lapack_int call_geqp3(int matrix_layout, lapack_int m, lapack_int n, lapack_complex_double* a, lapack_int lda, lapack_int* jpvt, lapack_complex_double* tau) - { return LAPACKE_zgeqp3(matrix_layout, m, n, a, lda, jpvt, tau); } +#define EIGEN_LAPACKE_QR_COLPIV(EIGTYPE, LAPACKE_TYPE, LAPACKE_PREFIX, EIGCOLROW, LAPACKE_COLROW) \ +template<> template inline \ +ColPivHouseholderQR >& \ +ColPivHouseholderQR >::compute( \ + const EigenBase& matrix) \ +\ +{ \ + using std::abs; \ + typedef Matrix MatrixType; \ + typedef MatrixType::RealScalar RealScalar; \ + Index rows = matrix.rows();\ + Index cols = matrix.cols();\ +\ + m_qr = matrix;\ + Index size = m_qr.diagonalSize();\ + m_hCoeffs.resize(size);\ +\ + m_colsTranspositions.resize(cols);\ + /*Index number_of_transpositions = 0;*/ \ +\ + m_nonzero_pivots = 0; \ + m_maxpivot = RealScalar(0);\ + m_colsPermutation.resize(cols); \ + m_colsPermutation.indices().setZero(); \ +\ + lapack_int lda = internal::convert_index(m_qr.outerStride()); \ + lapack_int matrix_order = LAPACKE_COLROW; \ + LAPACKE_##LAPACKE_PREFIX##geqp3( matrix_order, internal::convert_index(rows), internal::convert_index(cols), \ + (LAPACKE_TYPE*)m_qr.data(), lda, (lapack_int*)m_colsPermutation.indices().data(), (LAPACKE_TYPE*)m_hCoeffs.data()); \ + m_isInitialized = true; \ + m_maxpivot=m_qr.diagonal().cwiseAbs().maxCoeff(); \ + m_hCoeffs.adjointInPlace(); \ + RealScalar premultiplied_threshold = abs(m_maxpivot) * threshold(); \ + lapack_int *perm = m_colsPermutation.indices().data(); \ + for(Index i=0;i premultiplied_threshold);\ + } \ + for(Index i=0;i - struct ColPivHouseholderQR_LAPACKE_impl { - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::RealScalar RealScalar; - typedef typename internal::lapacke_helpers::translate_type_imp::type LapackeType; - static constexpr int LapackeStorage = MatrixType::IsRowMajor ? (LAPACK_ROW_MAJOR) : (LAPACK_COL_MAJOR); +EIGEN_LAPACKE_QR_COLPIV(double, double, d, ColMajor, LAPACK_COL_MAJOR) +EIGEN_LAPACKE_QR_COLPIV(float, float, s, ColMajor, LAPACK_COL_MAJOR) +EIGEN_LAPACKE_QR_COLPIV(dcomplex, lapack_complex_double, z, ColMajor, LAPACK_COL_MAJOR) +EIGEN_LAPACKE_QR_COLPIV(scomplex, lapack_complex_float, c, ColMajor, LAPACK_COL_MAJOR) - typedef typename internal::plain_diag_type::type HCoeffsType; - typedef PermutationMatrix PermutationType; - typedef typename internal::plain_row_type::type IntRowVectorType; +EIGEN_LAPACKE_QR_COLPIV(double, double, d, RowMajor, LAPACK_ROW_MAJOR) +EIGEN_LAPACKE_QR_COLPIV(float, float, s, RowMajor, LAPACK_ROW_MAJOR) +EIGEN_LAPACKE_QR_COLPIV(dcomplex, lapack_complex_double, z, RowMajor, LAPACK_ROW_MAJOR) +EIGEN_LAPACKE_QR_COLPIV(scomplex, lapack_complex_float, c, RowMajor, LAPACK_ROW_MAJOR) - static void run(MatrixType& qr, HCoeffsType& hCoeffs, PermutationType& colsPermutation, - IntRowVectorType& colsTranspositions, Index& nonzero_pivots, RealScalar& maxpivot, - bool usePrescribedThreshold, RealScalar prescribedThreshold, Index& det_p, bool& isInitialized) { - using std::abs; - - isInitialized = false; - hCoeffs.resize(qr.diagonalSize()); - colsTranspositions.resize(qr.cols()); - nonzero_pivots = 0; - maxpivot = RealScalar(0); - colsPermutation.resize(qr.cols()); - colsPermutation.indices().setZero(); +} // end namespace Eigen - lapack_int rows = internal::lapacke_helpers::to_lapack(qr.rows()); - lapack_int cols = internal::lapacke_helpers::to_lapack(qr.cols()); - LapackeType* qr_data = (LapackeType*)(qr.data()); - lapack_int lda = internal::lapacke_helpers::to_lapack(qr.outerStride()); - lapack_int* perm_data = colsPermutation.indices().data(); - LapackeType* hCoeffs_data = (LapackeType*)(hCoeffs.data()); - - lapack_int info = call_geqp3(LapackeStorage, rows, cols, qr_data, lda, perm_data, hCoeffs_data); - if (info != 0) return; - - maxpivot = qr.diagonal().cwiseAbs().maxCoeff(); - hCoeffs.adjointInPlace(); - RealScalar defaultThreshold = NumTraits::epsilon() * RealScalar(qr.diagonalSize()); - RealScalar threshold = usePrescribedThreshold ? prescribedThreshold : defaultThreshold; - RealScalar premultiplied_threshold = abs(maxpivot) * threshold; - nonzero_pivots = (qr.diagonal().cwiseAbs().array() > premultiplied_threshold).count(); - colsPermutation.indices().array() -= 1; - det_p = colsPermutation.determinant(); - isInitialized = true; - }; - }; - - typedef Matrix MatrixXfR; - typedef Matrix MatrixXdR; - typedef Matrix MatrixXcfR; - typedef Matrix MatrixXcdR; - - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - template <> inline void ColPivHouseholderQR::computeInPlace() { - ColPivHouseholderQR_LAPACKE_impl::run(m_qr, m_hCoeffs, m_colsPermutation, m_colsTranspositions, - m_nonzero_pivots, m_maxpivot, m_usePrescribedThreshold, - m_prescribedThreshold, m_det_p, m_isInitialized); } - -#endif -} // end namespace Eigen - -#endif // EIGEN_COLPIVOTINGHOUSEHOLDERQR_LAPACKE_H +#endif // EIGEN_COLPIVOTINGHOUSEHOLDERQR_LAPACKE_H diff --git a/Eigen/src/QR/CompleteOrthogonalDecomposition.h b/Eigen/src/QR/CompleteOrthogonalDecomposition.h index b3b07c857..02583a2fd 100644 --- a/Eigen/src/QR/CompleteOrthogonalDecomposition.h +++ b/Eigen/src/QR/CompleteOrthogonalDecomposition.h @@ -15,12 +15,12 @@ namespace Eigen { namespace internal { -template -struct traits > +template +struct traits > : traits { typedef MatrixXpr XprKind; typedef SolverStorage StorageKind; - typedef StorageIndex_ StorageIndex; + typedef int StorageIndex; enum { Flags = 0 }; }; @@ -49,8 +49,8 @@ struct traits > * * \sa MatrixBase::completeOrthogonalDecomposition() */ -template class CompleteOrthogonalDecomposition - : public SolverBase > +template class CompleteOrthogonalDecomposition + : public SolverBase > { public: typedef MatrixType_ MatrixType; @@ -65,7 +65,7 @@ template class CompleteOrthogonal MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }; typedef typename internal::plain_diag_type::type HCoeffsType; - typedef PermutationMatrix + typedef PermutationMatrix PermutationType; typedef typename internal::plain_row_type::type IntRowVectorType; @@ -78,6 +78,9 @@ template class CompleteOrthogonal HouseholderSequenceType; typedef typename MatrixType::PlainObject PlainObject; + private: + typedef typename PermutationType::Index PermIndexType; + public: /** * \brief Default Constructor. @@ -414,26 +417,26 @@ template class CompleteOrthogonal template void applyZAdjointOnTheLeftInPlace(Rhs& rhs) const; - ColPivHouseholderQR m_cpqr; + ColPivHouseholderQR m_cpqr; HCoeffsType m_zCoeffs; RowVectorType m_temp; }; -template +template typename MatrixType::Scalar -CompleteOrthogonalDecomposition::determinant() const { +CompleteOrthogonalDecomposition::determinant() const { return m_cpqr.determinant(); } -template +template typename MatrixType::RealScalar -CompleteOrthogonalDecomposition::absDeterminant() const { +CompleteOrthogonalDecomposition::absDeterminant() const { return m_cpqr.absDeterminant(); } -template +template typename MatrixType::RealScalar -CompleteOrthogonalDecomposition::logAbsDeterminant() const { +CompleteOrthogonalDecomposition::logAbsDeterminant() const { return m_cpqr.logAbsDeterminant(); } @@ -444,10 +447,11 @@ CompleteOrthogonalDecomposition::logAbsDeterminant() c * \sa class CompleteOrthogonalDecomposition, * CompleteOrthogonalDecomposition(const MatrixType&) */ -template -void CompleteOrthogonalDecomposition::computeInPlace() +template +void CompleteOrthogonalDecomposition::computeInPlace() { - eigen_assert(m_cpqr.cols() <= NumTraits::highest()); + // the column permutation is stored as int indices, so just to be sure: + eigen_assert(m_cpqr.cols() <= NumTraits::highest()); const Index rank = m_cpqr.rank(); const Index cols = m_cpqr.cols(); @@ -499,9 +503,9 @@ void CompleteOrthogonalDecomposition::computeInPlace() } } -template +template template -void CompleteOrthogonalDecomposition::applyZOnTheLeftInPlace( +void CompleteOrthogonalDecomposition::applyZOnTheLeftInPlace( Rhs& rhs) const { const Index cols = this->cols(); const Index nrhs = rhs.cols(); @@ -521,9 +525,9 @@ void CompleteOrthogonalDecomposition::applyZOnTheLeftI } } -template +template template -void CompleteOrthogonalDecomposition::applyZAdjointOnTheLeftInPlace( +void CompleteOrthogonalDecomposition::applyZAdjointOnTheLeftInPlace( Rhs& rhs) const { const Index cols = this->cols(); const Index nrhs = rhs.cols(); @@ -544,9 +548,9 @@ void CompleteOrthogonalDecomposition::applyZAdjointOnT } #ifndef EIGEN_PARSED_BY_DOXYGEN -template +template template -void CompleteOrthogonalDecomposition::_solve_impl( +void CompleteOrthogonalDecomposition::_solve_impl( const RhsType& rhs, DstType& dst) const { const Index rank = this->rank(); if (rank == 0) { @@ -576,9 +580,9 @@ void CompleteOrthogonalDecomposition::_solve_impl( dst = colsPermutation() * dst; } -template +template template -void CompleteOrthogonalDecomposition::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const +void CompleteOrthogonalDecomposition::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const { const Index rank = this->rank(); @@ -607,17 +611,17 @@ void CompleteOrthogonalDecomposition::_solve_impl_tr namespace internal { -template -struct traits > > +template +struct traits > > : traits::PlainObject> { enum { Flags = 0 }; }; -template -struct Assignment >, internal::assign_op::Scalar>, Dense2Dense> +template +struct Assignment >, internal::assign_op::Scalar>, Dense2Dense> { - typedef CompleteOrthogonalDecomposition CodType; + typedef CompleteOrthogonalDecomposition CodType; typedef Inverse SrcXprType; static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) { @@ -629,9 +633,9 @@ struct Assignment -typename CompleteOrthogonalDecomposition::HouseholderSequenceType -CompleteOrthogonalDecomposition::householderQ() const { +template +typename CompleteOrthogonalDecomposition::HouseholderSequenceType +CompleteOrthogonalDecomposition::householderQ() const { return m_cpqr.householderQ(); } @@ -640,8 +644,7 @@ CompleteOrthogonalDecomposition::householderQ() const * \sa class CompleteOrthogonalDecomposition */ template -template -const CompleteOrthogonalDecomposition::PlainObject, StorageIndex> +const CompleteOrthogonalDecomposition::PlainObject> MatrixBase::completeOrthogonalDecomposition() const { return CompleteOrthogonalDecomposition(eval()); } diff --git a/Eigen/src/QR/FullPivHouseholderQR.h b/Eigen/src/QR/FullPivHouseholderQR.h index b00fd7b13..ec7e19b55 100644 --- a/Eigen/src/QR/FullPivHouseholderQR.h +++ b/Eigen/src/QR/FullPivHouseholderQR.h @@ -17,19 +17,19 @@ namespace Eigen { namespace internal { -template struct traits > +template struct traits > : traits { typedef MatrixXpr XprKind; typedef SolverStorage StorageKind; - typedef StorageIndex_ StorageIndex; + typedef int StorageIndex; enum { Flags = 0 }; }; -template struct FullPivHouseholderQRMatrixQReturnType; +template struct FullPivHouseholderQRMatrixQReturnType; -template -struct traits > +template +struct traits > { typedef typename MatrixType::PlainObject ReturnType; }; @@ -59,8 +59,8 @@ struct traits > * * \sa MatrixBase::fullPivHouseholderQr() */ -template class FullPivHouseholderQR - : public SolverBase > +template class FullPivHouseholderQR + : public SolverBase > { public: @@ -73,12 +73,12 @@ template class FullPivHouseholderQ MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }; - typedef internal::FullPivHouseholderQRMatrixQReturnType MatrixQReturnType; + typedef internal::FullPivHouseholderQRMatrixQReturnType MatrixQReturnType; typedef typename internal::plain_diag_type::type HCoeffsType; typedef Matrix IntDiagSizeVectorType; - typedef PermutationMatrix PermutationType; + typedef PermutationMatrix PermutationType; typedef typename internal::plain_row_type::type RowVectorType; typedef typename internal::plain_col_type::type ColVectorType; typedef typename MatrixType::PlainObject PlainObject; @@ -437,8 +437,8 @@ template class FullPivHouseholderQ Index m_det_p; }; -template -typename MatrixType::Scalar FullPivHouseholderQR::determinant() const +template +typename MatrixType::Scalar FullPivHouseholderQR::determinant() const { eigen_assert(m_isInitialized && "HouseholderQR is not initialized."); eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); @@ -447,8 +447,8 @@ typename MatrixType::Scalar FullPivHouseholderQR::dete return m_qr.diagonal().prod() * detQ * Scalar(m_det_p); } -template -typename MatrixType::RealScalar FullPivHouseholderQR::absDeterminant() const +template +typename MatrixType::RealScalar FullPivHouseholderQR::absDeterminant() const { using std::abs; eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); @@ -456,8 +456,8 @@ typename MatrixType::RealScalar FullPivHouseholderQR:: return abs(m_qr.diagonal().prod()); } -template -typename MatrixType::RealScalar FullPivHouseholderQR::logAbsDeterminant() const +template +typename MatrixType::RealScalar FullPivHouseholderQR::logAbsDeterminant() const { eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!"); @@ -470,19 +470,18 @@ typename MatrixType::RealScalar FullPivHouseholderQR:: * * \sa class FullPivHouseholderQR, FullPivHouseholderQR(const MatrixType&) */ -template +template template -FullPivHouseholderQR& FullPivHouseholderQR::compute(const EigenBase& matrix) +FullPivHouseholderQR& FullPivHouseholderQR::compute(const EigenBase& matrix) { m_qr = matrix.derived(); computeInPlace(); return *this; } -template -void FullPivHouseholderQR::computeInPlace() +template +void FullPivHouseholderQR::computeInPlace() { - eigen_assert(m_qr.cols() <= NumTraits::highest()); using std::abs; Index rows = m_qr.rows(); Index cols = m_qr.cols(); @@ -562,9 +561,9 @@ void FullPivHouseholderQR::computeInPlace() } #ifndef EIGEN_PARSED_BY_DOXYGEN -template +template template -void FullPivHouseholderQR::_solve_impl(const RhsType &rhs, DstType &dst) const +void FullPivHouseholderQR::_solve_impl(const RhsType &rhs, DstType &dst) const { const Index l_rank = rank(); @@ -596,9 +595,9 @@ void FullPivHouseholderQR::_solve_impl(const RhsType for(Index i = l_rank; i < cols(); ++i) dst.row(m_cols_permutation.indices().coeff(i)).setZero(); } -template +template template -void FullPivHouseholderQR::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const +void FullPivHouseholderQR::_solve_impl_transposed(const RhsType &rhs, DstType &dst) const { const Index l_rank = rank(); @@ -635,10 +634,10 @@ void FullPivHouseholderQR::_solve_impl_transposed(co namespace internal { -template -struct Assignment >, internal::assign_op::Scalar>, Dense2Dense> +template +struct Assignment >, internal::assign_op::Scalar>, Dense2Dense> { - typedef FullPivHouseholderQR QrType; + typedef FullPivHouseholderQR QrType; typedef Inverse SrcXprType; static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op &) { @@ -652,11 +651,11 @@ struct Assignment struct FullPivHouseholderQRMatrixQReturnType - : public ReturnByValue > +template struct FullPivHouseholderQRMatrixQReturnType + : public ReturnByValue > { public: - typedef typename FullPivHouseholderQR::IntDiagSizeVectorType IntDiagSizeVectorType; + typedef typename FullPivHouseholderQR::IntDiagSizeVectorType IntDiagSizeVectorType; typedef typename internal::plain_diag_type::type HCoeffsType; typedef Matrix WorkVectorType; @@ -713,8 +712,8 @@ protected: } // end namespace internal -template -inline typename FullPivHouseholderQR::MatrixQReturnType FullPivHouseholderQR::matrixQ() const +template +inline typename FullPivHouseholderQR::MatrixQReturnType FullPivHouseholderQR::matrixQ() const { eigen_assert(m_isInitialized && "FullPivHouseholderQR is not initialized."); return MatrixQReturnType(m_qr, m_hCoeffs, m_rows_transpositions); @@ -725,11 +724,10 @@ inline typename FullPivHouseholderQR::MatrixQReturnTyp * \sa class FullPivHouseholderQR */ template -template -const FullPivHouseholderQR::PlainObject, StorageIndex> +const FullPivHouseholderQR::PlainObject> MatrixBase::fullPivHouseholderQr() const { - return FullPivHouseholderQR(eval()); + return FullPivHouseholderQR(eval()); } } // end namespace Eigen diff --git a/Eigen/src/misc/lapacke_helpers.h b/Eigen/src/misc/lapacke_helpers.h index 8c190d0ce..b6ad6e89e 100644 --- a/Eigen/src/misc/lapacke_helpers.h +++ b/Eigen/src/misc/lapacke_helpers.h @@ -77,9 +77,9 @@ EIGEN_ALWAYS_INLINE EIGEN_CONSTEXPR lapack_int lapack_storage_of(const EigenBase } /// translate UpLo type to the corresponding letter code -//template char translate_mode; -//template<> constexpr char translate_mode = 'L'; -//template<> constexpr char translate_mode = 'U'; +template char translate_mode; +template<> constexpr char translate_mode = 'L'; +template<> constexpr char translate_mode = 'U'; // --------------------------------------------------------------------------------------------------------------------- diff --git a/test/qr_colpivoting.cpp b/test/qr_colpivoting.cpp index 9f5e3dc47..4185f514e 100644 --- a/test/qr_colpivoting.cpp +++ b/test/qr_colpivoting.cpp @@ -13,8 +13,9 @@ #include #include "solverbase.h" -template +template void cod() { + STATIC_CHECK(( internal::is_same::StorageIndex,int>::value )); Index rows = internal::random(2, EIGEN_TEST_MAX_SIZE); Index cols = internal::random(2, EIGEN_TEST_MAX_SIZE); @@ -27,7 +28,7 @@ void cod() { MatrixQType; MatrixType matrix; createRandomPIMatrixOfRank(rank, rows, cols, matrix); - CompleteOrthogonalDecomposition cod(matrix); + CompleteOrthogonalDecomposition cod(matrix); VERIFY(rank == cod.rank()); VERIFY(cols - cod.rank() == cod.dimensionOfKernel()); VERIFY(!cod.isInjective()); @@ -62,14 +63,14 @@ void cod() { VERIFY_IS_APPROX(cod_solution, pinv * rhs); } -template +template void cod_fixedsize() { enum { Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime }; typedef typename MatrixType::Scalar Scalar; - typedef CompleteOrthogonalDecomposition, StorageIndex> COD; + typedef CompleteOrthogonalDecomposition > COD; int rank = internal::random(1, (std::min)(int(Rows), int(Cols)) - 1); Matrix matrix; createRandomPIMatrixOfRank(rank, Rows, Cols, matrix); @@ -95,10 +96,12 @@ void cod_fixedsize() { VERIFY_IS_APPROX(cod_solution, pinv * rhs); } -template void qr() +template void qr() { using std::sqrt; + STATIC_CHECK(( internal::is_same::StorageIndex,int>::value )); + Index rows = internal::random(2,EIGEN_TEST_MAX_SIZE), cols = internal::random(2,EIGEN_TEST_MAX_SIZE), cols2 = internal::random(2,EIGEN_TEST_MAX_SIZE); Index rank = internal::random(1, (std::min)(rows, cols)-1); @@ -107,7 +110,7 @@ template void qr() typedef Matrix MatrixQType; MatrixType m1; createRandomPIMatrixOfRank(rank,rows,cols,m1); - ColPivHouseholderQR qr(m1); + ColPivHouseholderQR qr(m1); VERIFY_IS_EQUAL(rank, qr.rank()); VERIFY_IS_EQUAL(cols - qr.rank(), qr.dimensionOfKernel()); VERIFY(!qr.isInjective()); @@ -155,7 +158,7 @@ template void qr() } } -template void qr_fixedsize() +template void qr_fixedsize() { using std::sqrt; using std::abs; @@ -165,7 +168,7 @@ template void qr_fixedsiz int rank = internal::random(1, (std::min)(int(Rows), int(Cols))-1); Matrix m1; createRandomPIMatrixOfRank(rank,Rows,Cols,m1); - ColPivHouseholderQR, StorageIndex> qr(m1); + ColPivHouseholderQR > qr(m1); VERIFY_IS_EQUAL(rank, qr.rank()); VERIFY_IS_EQUAL(Cols - qr.rank(), qr.dimensionOfKernel()); VERIFY_IS_EQUAL(qr.isInjective(), (rank == Rows)); @@ -204,7 +207,7 @@ template void qr_fixedsiz // for rank-revealing QR. See // http://www.netlib.org/lapack/lawnspdf/lawn176.pdf // page 3 for more detail. -template void qr_kahan_matrix() +template void qr_kahan_matrix() { using std::sqrt; using std::abs; @@ -224,7 +227,7 @@ template void qr_kahan_matrix() pow_s_i *= s; } m1 = (m1 + m1.transpose()).eval(); - ColPivHouseholderQR qr(m1); + ColPivHouseholderQR qr(m1); MatrixType r = qr.matrixQR().template triangularView(); RealScalar threshold = @@ -244,7 +247,7 @@ template void qr_kahan_matrix() } } -template void qr_invertible() +template void qr_invertible() { using std::log; using std::abs; @@ -263,7 +266,7 @@ template void qr_invertible() m1 += a * a.adjoint(); } - ColPivHouseholderQR qr(m1); + ColPivHouseholderQR qr(m1); check_solverbase(m1, qr, size, size, size); @@ -280,11 +283,11 @@ template void qr_invertible() VERIFY_IS_APPROX(log(absdet), qr.logAbsDeterminant()); } -template void qr_verify_assert() +template void qr_verify_assert() { MatrixType tmp; - ColPivHouseholderQR qr; + ColPivHouseholderQR qr; VERIFY_RAISES_ASSERT(qr.matrixQR()) VERIFY_RAISES_ASSERT(qr.solve(tmp)) VERIFY_RAISES_ASSERT(qr.transpose().solve(tmp)) @@ -300,11 +303,11 @@ template void qr_verify_assert() VERIFY_RAISES_ASSERT(qr.logAbsDeterminant()) } -template void cod_verify_assert() +template void cod_verify_assert() { MatrixType tmp; - CompleteOrthogonalDecomposition cod; + CompleteOrthogonalDecomposition cod; VERIFY_RAISES_ASSERT(cod.matrixQTZ()) VERIFY_RAISES_ASSERT(cod.solve(tmp)) VERIFY_RAISES_ASSERT(cod.transpose().solve(tmp)) @@ -320,58 +323,50 @@ template void cod_verify_assert() VERIFY_RAISES_ASSERT(cod.logAbsDeterminant()) } - - EIGEN_DECLARE_TEST(qr_colpivoting) { - #if defined(EIGEN_USE_LAPACKE) - typedef lapack_int StorageIndex; - #else - typedef int StorageIndex; - #endif - for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST_1( (qr)() ); - CALL_SUBTEST_2( (qr)() ); - CALL_SUBTEST_3( (qr)() ); - CALL_SUBTEST_4(( (qr_fixedsize, StorageIndex, 4>)() )); - CALL_SUBTEST_5(( (qr_fixedsize, StorageIndex, 3>)() )); - CALL_SUBTEST_5(( (qr_fixedsize, StorageIndex, 1>)() )); + CALL_SUBTEST_1( qr() ); + CALL_SUBTEST_2( qr() ); + CALL_SUBTEST_3( qr() ); + CALL_SUBTEST_4(( qr_fixedsize, 4 >() )); + CALL_SUBTEST_5(( qr_fixedsize, 3 >() )); + CALL_SUBTEST_5(( qr_fixedsize, 1 >() )); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST_1( (cod)() ); - CALL_SUBTEST_2( (cod)() ); - CALL_SUBTEST_3( (cod)() ); - CALL_SUBTEST_4(( (cod_fixedsize, StorageIndex, 4>)() )); - CALL_SUBTEST_5(( (cod_fixedsize, StorageIndex, 3>)() )); - CALL_SUBTEST_5(( (cod_fixedsize, StorageIndex, 1>)() )); + CALL_SUBTEST_1( cod() ); + CALL_SUBTEST_2( cod() ); + CALL_SUBTEST_3( cod() ); + CALL_SUBTEST_4(( cod_fixedsize, 4 >() )); + CALL_SUBTEST_5(( cod_fixedsize, 3 >() )); + CALL_SUBTEST_5(( cod_fixedsize, 1 >() )); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST_1( (qr_invertible)() ); - CALL_SUBTEST_2( (qr_invertible)() ); - CALL_SUBTEST_6( (qr_invertible)() ); - CALL_SUBTEST_3( (qr_invertible)() ); + CALL_SUBTEST_1( qr_invertible() ); + CALL_SUBTEST_2( qr_invertible() ); + CALL_SUBTEST_6( qr_invertible() ); + CALL_SUBTEST_3( qr_invertible() ); } - 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)()); + 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()); - CALL_SUBTEST_7( (cod_verify_assert)()); - CALL_SUBTEST_8( (cod_verify_assert)()); - CALL_SUBTEST_1( (cod_verify_assert)()); - CALL_SUBTEST_2( (cod_verify_assert)()); - CALL_SUBTEST_6( (cod_verify_assert)()); - CALL_SUBTEST_3( (cod_verify_assert)()); + CALL_SUBTEST_7(cod_verify_assert()); + CALL_SUBTEST_8(cod_verify_assert()); + CALL_SUBTEST_1(cod_verify_assert()); + CALL_SUBTEST_2(cod_verify_assert()); + CALL_SUBTEST_6(cod_verify_assert()); + CALL_SUBTEST_3(cod_verify_assert()); // Test problem size constructors - CALL_SUBTEST_9((ColPivHouseholderQR(10, 20))); + CALL_SUBTEST_9(ColPivHouseholderQR(10, 20)); - CALL_SUBTEST_1( (qr_kahan_matrix)() ); - CALL_SUBTEST_2( (qr_kahan_matrix)() ); + CALL_SUBTEST_1( qr_kahan_matrix() ); + CALL_SUBTEST_2( qr_kahan_matrix() ); } diff --git a/test/qr_fullpivoting.cpp b/test/qr_fullpivoting.cpp index 971ec73a8..cca9a8c1e 100644 --- a/test/qr_fullpivoting.cpp +++ b/test/qr_fullpivoting.cpp @@ -12,8 +12,9 @@ #include #include "solverbase.h" -template void qr() +template void qr() { + STATIC_CHECK(( internal::is_same::StorageIndex,int>::value )); static const int Rows = MatrixType::RowsAtCompileTime, Cols = MatrixType::ColsAtCompileTime; Index max_size = EIGEN_TEST_MAX_SIZE; @@ -27,7 +28,7 @@ template void qr() typedef Matrix MatrixQType; MatrixType m1; createRandomPIMatrixOfRank(rank,rows,cols,m1); - FullPivHouseholderQR qr(m1); + FullPivHouseholderQR qr(m1); VERIFY_IS_EQUAL(rank, qr.rank()); VERIFY_IS_EQUAL(cols - qr.rank(), qr.dimensionOfKernel()); VERIFY(!qr.isInjective()); @@ -66,7 +67,7 @@ template void qr() } } -template void qr_invertible() +template void qr_invertible() { using std::log; using std::abs; @@ -87,7 +88,7 @@ template void qr_invertible() m1 += a * a.adjoint(); } - FullPivHouseholderQR qr(m1); + FullPivHouseholderQR qr(m1); VERIFY(qr.isInjective()); VERIFY(qr.isInvertible()); VERIFY(qr.isSurjective()); @@ -107,11 +108,11 @@ template void qr_invertible() VERIFY_IS_APPROX(log(absdet), qr.logAbsDeterminant()); } -template void qr_verify_assert() +template void qr_verify_assert() { MatrixType tmp; - FullPivHouseholderQR qr; + FullPivHouseholderQR qr; VERIFY_RAISES_ASSERT(qr.matrixQR()) VERIFY_RAISES_ASSERT(qr.solve(tmp)) VERIFY_RAISES_ASSERT(qr.transpose().solve(tmp)) @@ -129,35 +130,33 @@ template void qr_verify_assert() EIGEN_DECLARE_TEST(qr_fullpivoting) { - typedef int StorageIndex; - for(int i = 0; i < 1; i++) { - CALL_SUBTEST_5( (qr()) ); - CALL_SUBTEST_6( (qr()) ); - CALL_SUBTEST_8( (qr()) ); - CALL_SUBTEST_1( (qr()) ); - CALL_SUBTEST_2( (qr()) ); - CALL_SUBTEST_3( (qr()) ); + CALL_SUBTEST_5( qr() ); + CALL_SUBTEST_6( qr() ); + CALL_SUBTEST_8( qr() ); + CALL_SUBTEST_1( qr() ); + CALL_SUBTEST_2( qr() ); + CALL_SUBTEST_3( qr() ); } for(int i = 0; i < g_repeat; i++) { - CALL_SUBTEST_1( (qr_invertible()) ); - CALL_SUBTEST_2( (qr_invertible()) ); - CALL_SUBTEST_4( (qr_invertible()) ); - CALL_SUBTEST_3( (qr_invertible()) ); + CALL_SUBTEST_1( qr_invertible() ); + CALL_SUBTEST_2( qr_invertible() ); + CALL_SUBTEST_4( qr_invertible() ); + CALL_SUBTEST_3( qr_invertible() ); } - 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()) ); + 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()); // Test problem size constructors - CALL_SUBTEST_7( (FullPivHouseholderQR(10, 20))); - CALL_SUBTEST_7( (FullPivHouseholderQR, StorageIndex>(10, 20))); - CALL_SUBTEST_7( (FullPivHouseholderQR, StorageIndex>(Matrix::Random()))); - CALL_SUBTEST_7( (FullPivHouseholderQR, StorageIndex>(20, 10))); - CALL_SUBTEST_7( (FullPivHouseholderQR, StorageIndex>(Matrix::Random()))); + CALL_SUBTEST_7(FullPivHouseholderQR(10, 20)); + CALL_SUBTEST_7((FullPivHouseholderQR >(10,20))); + CALL_SUBTEST_7((FullPivHouseholderQR >(Matrix::Random()))); + CALL_SUBTEST_7((FullPivHouseholderQR >(20,10))); + CALL_SUBTEST_7((FullPivHouseholderQR >(Matrix::Random()))); }