Go to the documentation of this file.
44 template<
typename _MatrixType>
class HouseholderQR
96 template<
typename InputType>
114 template<
typename InputType>
138 template<
typename Rhs>
169 template<
typename InputType>
214 #ifndef EIGEN_PARSED_BY_DOXYGEN
215 template<
typename RhsType,
typename DstType>
217 void _solve_impl(
const RhsType &rhs, DstType &dst)
const;
235 template<
typename MatrixType>
239 eigen_assert(m_isInitialized &&
"HouseholderQR is not initialized.");
240 eigen_assert(m_qr.rows() == m_qr.cols() &&
"You can't take the determinant of a non-square matrix!");
241 return abs(m_qr.diagonal().prod());
244 template<
typename MatrixType>
247 eigen_assert(m_isInitialized &&
"HouseholderQR is not initialized.");
248 eigen_assert(m_qr.rows() == m_qr.cols() &&
"You can't take the determinant of a non-square matrix!");
249 return m_qr.diagonal().cwiseAbs().array().log().sum();
255 template<
typename MatrixQR,
typename HCoeffs>
271 tempData = tempVector.data();
276 Index remainingRows = rows - k;
277 Index remainingCols = cols - k - 1;
280 mat.col(k).tail(remainingRows).makeHouseholderInPlace(hCoeffs.coeffRef(k), beta);
281 mat.coeffRef(k,k) = beta;
284 mat.bottomRightCorner(remainingRows, remainingCols)
285 .applyHouseholderOnTheLeft(
mat.col(k).tail(remainingRows-1), hCoeffs.coeffRef(k), tempData+k+1);
290 template<
typename MatrixQR,
typename HCoeffs,
292 bool InnerStrideIsOne = (MatrixQR::InnerStrideAtCompileTime == 1 && HCoeffs::InnerStrideAtCompileTime == 1)>
296 static void run(MatrixQR&
mat, HCoeffs& hCoeffs,
Index maxBlockSize=32,
311 tempData = tempVector.data();
317 for (k = 0; k <
size; k += blockSize)
320 Index tcols = cols - k - bs;
321 Index brows = rows-k;
331 BlockType A11_21 =
mat.block(k,k,brows,bs);
338 BlockType A21_22 =
mat.block(k,k+bs,brows,tcols);
347 #ifndef EIGEN_PARSED_BY_DOXYGEN
348 template<
typename _MatrixType>
349 template<
typename RhsType,
typename DstType>
355 typename RhsType::PlainObject
c(rhs);
360 m_hCoeffs.head(rank)).transpose()
363 m_qr.topLeftCorner(rank, rank)
364 .template triangularView<Upper>()
365 .solveInPlace(
c.topRows(rank));
367 dst.topRows(rank) =
c.topRows(rank);
368 dst.bottomRows(cols()-rank).setZero();
378 template<
typename MatrixType>
381 check_template_parameters();
383 Index rows = m_qr.rows();
384 Index cols = m_qr.cols();
387 m_hCoeffs.resize(
size);
393 m_isInitialized =
true;
400 template<
typename Derived>
MatrixType::RealScalar RealScalar
Expression of a fixed-size or dynamic-size block.
HouseholderSequence< MatrixType, typename internal::remove_all< typename HCoeffsType::ConjugateReturnType >::type > HouseholderSequenceType
HouseholderSequence< VectorsType, CoeffsType > householderSequence(const VectorsType &v, const CoeffsType &h)
Convenience function for constructing a Householder sequence.
internal::plain_diag_type< MatrixType >::type HCoeffsType
NumTraits< Scalar >::Real RealScalar
const unsigned int RowMajorBit
HouseholderQR()
Default Constructor.
MatrixType::RealScalar absDeterminant() const
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
void householder_qr_inplace_unblocked(MatrixQR &mat, HCoeffs &hCoeffs, typename MatrixQR::Scalar *tempData=0)
EIGEN_DEVICE_FUNC const EIGEN_STRONG_INLINE AbsReturnType abs() const
HouseholderSequenceType householderQ() const
MatrixType::StorageIndex StorageIndex
static void check_template_parameters()
MatrixType::Scalar Scalar
const MatrixType & matrixQR() const
EIGEN_DEVICE_FUNC void _solve_impl(const RhsType &rhs, DstType &dst) const
internal::plain_row_type< MatrixType >::type RowVectorType
HouseholderQR(EigenBase< InputType > &matrix)
Constructs a QR factorization from a given matrix.
const HCoeffsType & hCoeffs() const
void apply_block_householder_on_the_left(MatrixType &mat, const VectorsType &vectors, const CoeffsType &hCoeffs, bool forward)
Pseudo expression representing a solving operation.
HouseholderQR(const EigenBase< InputType > &matrix)
Constructs a QR factorization from a given matrix.
HouseholderQR(Index rows, Index cols)
Default Constructor with memory preallocation.
static void run(MatrixQR &mat, HCoeffs &hCoeffs, Index maxBlockSize=32, typename MatrixQR::Scalar *tempData=0)
void run(Expr &expr, Dev &dev)
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
MatrixType::RealScalar logAbsDeterminant() const
const Solve< HouseholderQR, Rhs > solve(const MatrixBase< Rhs > &b) const
The matrix class, also used for vectors and row-vectors.
HouseholderQR & compute(const EigenBase< InputType > &matrix)
Base class for all dense matrices, vectors, and expressions.
Householder QR decomposition of a matrix.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Sequence of Householder reflections acting on subspaces with decreasing size.
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:48