MOAB
4.9.3pre
|
#include <HouseholderQR.h>
Static Public Member Functions | |
static void | run (MatrixQR &mat, HCoeffs &hCoeffs, Index maxBlockSize=32, typename MatrixQR::Scalar *tempData=0) |
Definition at line 271 of file HouseholderQR.h.
static void Eigen::internal::householder_qr_inplace_blocked< MatrixQR, HCoeffs, MatrixQRScalar, InnerStrideIsOne >::run | ( | MatrixQR & | mat, |
HCoeffs & | hCoeffs, | ||
Index | maxBlockSize = 32 , |
||
typename MatrixQR::Scalar * | tempData = 0 |
||
) | [inline, static] |
Definition at line 274 of file HouseholderQR.h.
{ typedef typename MatrixQR::Scalar Scalar; typedef Block<MatrixQR,Dynamic,Dynamic> BlockType; Index rows = mat.rows(); Index cols = mat.cols(); Index size = (std::min)(rows, cols); typedef Matrix<Scalar,Dynamic,1,ColMajor,MatrixQR::MaxColsAtCompileTime,1> TempType; TempType tempVector; if(tempData==0) { tempVector.resize(cols); tempData = tempVector.data(); } Index blockSize = (std::min)(maxBlockSize,size); Index k = 0; for (k = 0; k < size; k += blockSize) { Index bs = (std::min)(size-k,blockSize); // actual size of the block Index tcols = cols - k - bs; // trailing columns Index brows = rows-k; // rows of the block // partition the matrix: // A00 | A01 | A02 // mat = A10 | A11 | A12 // A20 | A21 | A22 // and performs the qr dec of [A11^T A12^T]^T // and update [A21^T A22^T]^T using level 3 operations. // Finally, the algorithm continue on A22 BlockType A11_21 = mat.block(k,k,brows,bs); Block<HCoeffs,Dynamic,1> hCoeffsSegment = hCoeffs.segment(k,bs); householder_qr_inplace_unblocked(A11_21, hCoeffsSegment, tempData); if(tcols) { BlockType A21_22 = mat.block(k,k+bs,brows,tcols); apply_block_householder_on_the_left(A21_22,A11_21,hCoeffsSegment, false); // false == backward } } }