34 #ifndef EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H 35 #define EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_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::Scalar Scalar; \ 53 typedef MatrixType::RealScalar RealScalar; \ 54 Index rows = matrix.rows();\ 55 Index cols = matrix.cols();\ 56 Index size = matrix.diagonalSize();\ 59 m_hCoeffs.resize(size);\ 61 m_colsTranspositions.resize(cols);\ 64 m_nonzero_pivots = 0; \ 65 m_maxpivot = RealScalar(0);\ 66 m_colsPermutation.resize(cols); \ 67 m_colsPermutation.indices().setZero(); \ 69 lapack_int lda = m_qr.outerStride(), i; \ 70 lapack_int matrix_order = MKLCOLROW; \ 71 LAPACKE_##MKLPREFIX##geqp3( matrix_order, rows, cols, (MKLTYPE*)m_qr.data(), lda, (lapack_int*)m_colsPermutation.indices().data(), (MKLTYPE*)m_hCoeffs.data()); \ 72 m_isInitialized = true; \ 73 m_maxpivot=m_qr.diagonal().cwiseAbs().maxCoeff(); \ 74 m_hCoeffs.adjointInPlace(); \ 75 RealScalar premultiplied_threshold = abs(m_maxpivot) * threshold(); \ 76 lapack_int *perm = m_colsPermutation.indices().data(); \ 77 for(i=0;i<size;i++) { \ 78 m_nonzero_pivots += (abs(m_qr.coeff(i,i)) > premultiplied_threshold);\ 80 for(i=0;i<cols;i++) perm[i]--;\ 99 #endif // EIGEN_COLPIVOTINGHOUSEHOLDERQR_MKL_H
iterative scaling algorithm to equilibrate rows and column norms in matrices
#define EIGEN_MKL_QR_COLPIV(EIGTYPE, MKLTYPE, MKLPREFIX, EIGCOLROW, MKLCOLROW)