34 #ifndef EIGEN_COLPIVOTINGHOUSEHOLDERQR_LAPACKE_H
35 #define EIGEN_COLPIVOTINGHOUSEHOLDERQR_LAPACKE_H
41 #define EIGEN_LAPACKE_QR_COLPIV(EIGTYPE, LAPACKE_TYPE, LAPACKE_PREFIX, EIGCOLROW, LAPACKE_COLROW) \
42 template<> template<typename InputType> inline \
43 ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >& \
44 ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >::compute( \
45 const EigenBase<InputType>& matrix) \
49 typedef Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> MatrixType; \
50 typedef MatrixType::RealScalar RealScalar; \
51 Index rows = matrix.rows();\
52 Index cols = matrix.cols();\
55 Index size = m_qr.diagonalSize();\
56 m_hCoeffs.resize(size);\
58 m_colsTranspositions.resize(cols);\
61 m_nonzero_pivots = 0; \
62 m_maxpivot = RealScalar(0);\
63 m_colsPermutation.resize(cols); \
64 m_colsPermutation.indices().setZero(); \
66 lapack_int lda = internal::convert_index<lapack_int,Index>(m_qr.outerStride()); \
67 lapack_int matrix_order = LAPACKE_COLROW; \
68 LAPACKE_##LAPACKE_PREFIX##geqp3( matrix_order, internal::convert_index<lapack_int,Index>(rows), internal::convert_index<lapack_int,Index>(cols), \
69 (LAPACKE_TYPE*)m_qr.data(), lda, (lapack_int*)m_colsPermutation.indices().data(), (LAPACKE_TYPE*)m_hCoeffs.data()); \
70 m_isInitialized = true; \
71 m_maxpivot=m_qr.diagonal().cwiseAbs().maxCoeff(); \
72 m_hCoeffs.adjointInPlace(); \
73 RealScalar premultiplied_threshold = abs(m_maxpivot) * threshold(); \
74 lapack_int *perm = m_colsPermutation.indices().data(); \
75 for(Index i=0;i<size;i++) { \
76 m_nonzero_pivots += (abs(m_qr.coeff(i,i)) > premultiplied_threshold);\
78 for(Index i=0;i<cols;i++) perm[i]--;\
#define EIGEN_LAPACKE_QR_COLPIV(EIGTYPE, LAPACKE_TYPE, LAPACKE_PREFIX, EIGCOLROW, LAPACKE_COLROW)
Definition: ColPivHouseholderQR_LAPACKE.h:41
@ ColMajor
Definition: Constants.h:319
@ RowMajor
Definition: Constants.h:321
#define LAPACK_COL_MAJOR
Definition: lapacke.h:123
#define LAPACK_ROW_MAJOR
Definition: lapacke.h:122
#define lapack_complex_double
Definition: lapacke.h:92
#define lapack_complex_float
Definition: lapacke.h:76
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
std::complex< double > dcomplex
Definition: MKL_support.h:125
std::complex< float > scomplex
Definition: MKL_support.h:126