34 #ifndef EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H 35 #define EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H 37 #include "Eigen/src/Core/util/MKL_support.h" 43 #define EIGEN_MKL_QR_COLPIV(EIGTYPE, MKLTYPE, MKLPREFIX, EIGCOLROW, MKLCOLROW) \ 45 ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >& \ 46 ColPivHouseholderQR<Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> >::compute( \ 47 const Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic>& matrix) \ 51 typedef Matrix<EIGTYPE, Dynamic, Dynamic, EIGCOLROW, Dynamic, Dynamic> MatrixType; \ 52 typedef MatrixType::RealScalar RealScalar; \ 53 Index rows = matrix.rows();\ 54 Index cols = matrix.cols();\ 55 Index size = matrix.diagonalSize();\ 58 m_hCoeffs.resize(size);\ 60 m_colsTranspositions.resize(cols);\ 63 m_nonzero_pivots = 0; \ 64 m_maxpivot = RealScalar(0);\ 65 m_colsPermutation.resize(cols); \ 66 m_colsPermutation.indices().setZero(); \ 68 lapack_int lda = m_qr.outerStride(), i; \ 69 lapack_int matrix_order = MKLCOLROW; \ 70 LAPACKE_##MKLPREFIX##geqp3( matrix_order, rows, cols, (MKLTYPE*)m_qr.data(), lda, (lapack_int*)m_colsPermutation.indices().data(), (MKLTYPE*)m_hCoeffs.data()); \ 71 m_isInitialized = true; \ 72 m_maxpivot=m_qr.diagonal().cwiseAbs().maxCoeff(); \ 73 m_hCoeffs.adjointInPlace(); \ 74 RealScalar premultiplied_threshold = abs(m_maxpivot) * threshold(); \ 75 lapack_int *perm = m_colsPermutation.indices().data(); \ 76 for(i=0;i<size;i++) { \ 77 m_nonzero_pivots += (abs(m_qr.coeff(i,i)) > premultiplied_threshold);\ 79 for(i=0;i<cols;i++) perm[i]--;\ 86 EIGEN_MKL_QR_COLPIV(
double,
double, d,
ColMajor, LAPACK_COL_MAJOR)
87 EIGEN_MKL_QR_COLPIV(
float,
float, s,
ColMajor, LAPACK_COL_MAJOR)
88 EIGEN_MKL_QR_COLPIV(dcomplex, MKL_Complex16, z, ColMajor, LAPACK_COL_MAJOR)
89 EIGEN_MKL_QR_COLPIV(scomplex, MKL_Complex8, c, ColMajor, LAPACK_COL_MAJOR)
91 EIGEN_MKL_QR_COLPIV(
double,
double, d,
RowMajor, LAPACK_ROW_MAJOR)
92 EIGEN_MKL_QR_COLPIV(
float,
float, s, RowMajor, LAPACK_ROW_MAJOR)
93 EIGEN_MKL_QR_COLPIV(dcomplex, MKL_Complex16, z, RowMajor, LAPACK_ROW_MAJOR)
94 EIGEN_MKL_QR_COLPIV(scomplex, MKL_Complex8, c, RowMajor, LAPACK_ROW_MAJOR)
98 #endif // EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H
Definition: Constants.h:266
Definition: Constants.h:264