Eigen::internal::householder_qr_inplace_blocked< MatrixQR, HCoeffs, MatrixQRScalar, InnerStrideIsOne > Struct Template Reference

#include <HouseholderQR.h>

Static Public Member Functions

static void run (MatrixQR &mat, HCoeffs &hCoeffs, Index maxBlockSize=32, typename MatrixQR::Scalar *tempData=0)
 

Detailed Description

template<typename MatrixQR, typename HCoeffs, typename MatrixQRScalar = typename MatrixQR::Scalar, bool InnerStrideIsOne = (MatrixQR::InnerStrideAtCompileTime == 1 && HCoeffs::InnerStrideAtCompileTime == 1)>
struct Eigen::internal::householder_qr_inplace_blocked< MatrixQR, HCoeffs, MatrixQRScalar, InnerStrideIsOne >

Member Function Documentation

◆ run()

template<typename MatrixQR , typename HCoeffs , typename MatrixQRScalar = typename MatrixQR::Scalar, bool InnerStrideIsOne = (MatrixQR::InnerStrideAtCompileTime == 1 && HCoeffs::InnerStrideAtCompileTime == 1)>
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 
)
inlinestatic
418  {
419  typedef typename MatrixQR::Scalar Scalar;
420  typedef Block<MatrixQR, Dynamic, Dynamic> BlockType;
421 
422  Index rows = mat.rows();
423  Index cols = mat.cols();
424  Index size = (std::min)(rows, cols);
425 
426  typedef Matrix<Scalar, Dynamic, 1, ColMajor, MatrixQR::MaxColsAtCompileTime, 1> TempType;
427  TempType tempVector;
428  if (tempData == 0) {
429  tempVector.resize(cols);
430  tempData = tempVector.data();
431  }
432 
433  Index blockSize = (std::min)(maxBlockSize, size);
434 
435  Index k = 0;
436  for (k = 0; k < size; k += blockSize) {
437  Index bs = (std::min)(size - k, blockSize); // actual size of the block
438  Index tcols = cols - k - bs; // trailing columns
439  Index brows = rows - k; // rows of the block
440 
441  // partition the matrix:
442  // A00 | A01 | A02
443  // mat = A10 | A11 | A12
444  // A20 | A21 | A22
445  // and performs the qr dec of [A11^T A12^T]^T
446  // and update [A21^T A22^T]^T using level 3 operations.
447  // Finally, the algorithm continue on A22
448 
449  BlockType A11_21 = mat.block(k, k, brows, bs);
450  Block<HCoeffs, Dynamic, 1> hCoeffsSegment = hCoeffs.segment(k, bs);
451 
452  householder_qr_inplace_unblocked(A11_21, hCoeffsSegment, tempData);
453 
454  if (tcols) {
455  BlockType A21_22 = mat.block(k, k + bs, brows, tcols);
456  apply_block_householder_on_the_left(A21_22, A11_21, hCoeffsSegment, false); // false == backward
457  }
458  }
459  }
int rows
Definition: Tutorial_commainit_02.cpp:1
int cols
Definition: Tutorial_commainit_02.cpp:1
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
Index cols() const
Definition: SparseMatrix.h:161
Index rows() const
Definition: SparseMatrix.h:159
#define min(a, b)
Definition: datatypes.h:22
char char char int int * k
Definition: level2_impl.h:374
void householder_qr_inplace_unblocked(MatrixQR &mat, HCoeffs &hCoeffs, typename MatrixQR::Scalar *tempData=0)
Definition: HouseholderQR.h:346
void apply_block_householder_on_the_left(MatrixType &mat, const VectorsType &vectors, const CoeffsType &hCoeffs, bool forward)
Definition: BlockHouseholder.h:86
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83

References Eigen::internal::apply_block_householder_on_the_left(), Eigen::HouseholderQR< MatrixType_ >::cols(), Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::cols(), Eigen::HouseholderQR< MatrixType_ >::hCoeffs(), Eigen::internal::householder_qr_inplace_unblocked(), k, min, Eigen::PlainObjectBase< Derived >::resize(), Eigen::HouseholderQR< MatrixType_ >::rows(), Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::rows(), and Eigen::EigenBase< Derived >::size().

Referenced by Eigen::HouseholderQR< MatrixType_ >::computeInPlace().


The documentation for this struct was generated from the following file: