57 :
public SolverBase<HouseholderQR<_MatrixType> >
107 template<
typename InputType>
125 template<
typename InputType>
135 #ifdef EIGEN_PARSED_BY_DOXYGEN
150 template<
typename Rhs>
178 template<
typename InputType>
223 #ifndef EIGEN_PARSED_BY_DOXYGEN
224 template<
typename RhsType,
typename DstType>
227 template<
bool Conjugate,
typename RhsType,
typename DstType>
246 template<
typename MatrixType>
250 eigen_assert(m_isInitialized &&
"HouseholderQR is not initialized.");
251 eigen_assert(m_qr.rows() == m_qr.cols() &&
"You can't take the determinant of a non-square matrix!");
252 return abs(m_qr.diagonal().prod());
255 template<
typename MatrixType>
258 eigen_assert(m_isInitialized &&
"HouseholderQR is not initialized.");
259 eigen_assert(m_qr.rows() == m_qr.cols() &&
"You can't take the determinant of a non-square matrix!");
260 return m_qr.diagonal().cwiseAbs().array().log().sum();
266 template<
typename MatrixQR,
typename HCoeffs>
269 typedef typename MatrixQR::Scalar Scalar;
270 typedef typename MatrixQR::RealScalar RealScalar;
271 Index rows = mat.rows();
272 Index cols = mat.cols();
282 tempData = tempVector.data();
287 Index remainingRows = rows - k;
288 Index remainingCols = cols - k - 1;
291 mat.col(k).tail(remainingRows).makeHouseholderInPlace(hCoeffs.coeffRef(k), beta);
292 mat.coeffRef(k,k) = beta;
295 mat.bottomRightCorner(remainingRows, remainingCols)
296 .applyHouseholderOnTheLeft(mat.col(k).tail(remainingRows-1), hCoeffs.coeffRef(k), tempData+k+1);
301 template<
typename MatrixQR,
typename HCoeffs,
302 typename MatrixQRScalar =
typename MatrixQR::Scalar,
303 bool InnerStrideIsOne = (MatrixQR::InnerStrideAtCompileTime == 1 && HCoeffs::InnerStrideAtCompileTime == 1)>
307 static void run(MatrixQR& mat, HCoeffs& hCoeffs,
Index maxBlockSize=32,
308 typename MatrixQR::Scalar* tempData = 0)
310 typedef typename MatrixQR::Scalar Scalar;
313 Index rows = mat.rows();
314 Index cols = mat.cols();
322 tempData = tempVector.data();
328 for (k = 0; k <
size; k += blockSize)
331 Index tcols = cols - k - bs;
332 Index brows = rows-k;
342 BlockType A11_21 = mat.block(k,k,brows,bs);
349 BlockType A21_22 = mat.block(k,k+bs,brows,tcols);
358 #ifndef EIGEN_PARSED_BY_DOXYGEN
359 template<
typename _MatrixType>
360 template<
typename RhsType,
typename DstType>
365 typename RhsType::PlainObject c(rhs);
367 c.applyOnTheLeft(householderQ().setLength(rank).adjoint() );
369 m_qr.topLeftCorner(rank, rank)
370 .template triangularView<Upper>()
371 .solveInPlace(c.topRows(rank));
373 dst.topRows(rank) = c.topRows(rank);
374 dst.bottomRows(cols()-rank).setZero();
377 template<
typename _MatrixType>
378 template<
bool Conjugate,
typename RhsType,
typename DstType>
383 typename RhsType::PlainObject c(rhs);
385 m_qr.topLeftCorner(rank, rank)
386 .template triangularView<Upper>()
387 .transpose().template conjugateIf<Conjugate>()
388 .solveInPlace(c.topRows(rank));
390 dst.topRows(rank) = c.topRows(rank);
391 dst.bottomRows(rows()-rank).setZero();
393 dst.applyOnTheLeft(householderQ().setLength(rank).
template conjugateIf<!Conjugate>() );
403 template<
typename MatrixType>
406 check_template_parameters();
408 Index rows = m_qr.rows();
409 Index cols = m_qr.cols();
412 m_hCoeffs.resize(
size);
418 m_isInitialized =
true;
425 template<
typename Derived>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const AbsReturnType abs() const
Definition: ArrayCwiseUnaryOps.h:52
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
Definition: Macros.h:1264
#define eigen_assert(x)
Definition: Macros.h:1037
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
Definition: StaticAssert.h:187
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:105
Householder QR decomposition of a matrix.
Definition: HouseholderQR.h:58
HouseholderQR(Index rows, Index cols)
Default Constructor with memory preallocation.
Definition: HouseholderQR.h:89
_MatrixType MatrixType
Definition: HouseholderQR.h:61
@ MaxColsAtCompileTime
Definition: HouseholderQR.h:68
@ MaxRowsAtCompileTime
Definition: HouseholderQR.h:67
Index cols() const
Definition: HouseholderQR.h:215
void computeInPlace()
Definition: HouseholderQR.h:404
HouseholderSequence< MatrixType, typename internal::remove_all< typename HCoeffsType::ConjugateReturnType >::type > HouseholderSequenceType
Definition: HouseholderQR.h:73
RowVectorType m_temp
Definition: HouseholderQR.h:242
SolverBase< HouseholderQR > Base
Definition: HouseholderQR.h:62
internal::plain_diag_type< MatrixType >::type HCoeffsType
Definition: HouseholderQR.h:71
HouseholderQR(EigenBase< InputType > &matrix)
Constructs a QR factorization from a given matrix.
Definition: HouseholderQR.h:126
HouseholderQR()
Default Constructor.
Definition: HouseholderQR.h:81
Index rows() const
Definition: HouseholderQR.h:214
bool m_isInitialized
Definition: HouseholderQR.h:243
HouseholderQR & compute(const EigenBase< InputType > &matrix)
Definition: HouseholderQR.h:179
MatrixType::RealScalar absDeterminant() const
Definition: HouseholderQR.h:247
static void check_template_parameters()
Definition: HouseholderQR.h:233
void _solve_impl_transposed(const RhsType &rhs, DstType &dst) const
Definition: HouseholderQR.h:379
HCoeffsType m_hCoeffs
Definition: HouseholderQR.h:241
MatrixType m_qr
Definition: HouseholderQR.h:240
void _solve_impl(const RhsType &rhs, DstType &dst) const
Definition: HouseholderQR.h:361
const MatrixType & matrixQR() const
Definition: HouseholderQR.h:172
const HCoeffsType & hCoeffs() const
Definition: HouseholderQR.h:221
internal::plain_row_type< MatrixType >::type RowVectorType
Definition: HouseholderQR.h:72
MatrixType::RealScalar logAbsDeterminant() const
Definition: HouseholderQR.h:256
HouseholderQR(const EigenBase< InputType > &matrix)
Constructs a QR factorization from a given matrix.
Definition: HouseholderQR.h:108
HouseholderSequenceType householderQ() const
Definition: HouseholderQR.h:163
Sequence of Householder reflections acting on subspaces with decreasing size.
Definition: HouseholderSequence.h:121
Base class for all dense matrices, vectors, and expressions.
Definition: MatrixBase.h:50
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:271
Pseudo expression representing a solving operation.
Definition: Solve.h:63
A base class for matrix decomposition and solvers.
Definition: SolverBase.h:69
internal::traits< HouseholderQR< _MatrixType > >::Scalar Scalar
Definition: SolverBase.h:73
EIGEN_DEVICE_FUNC HouseholderQR< _MatrixType > & derived()
Definition: EigenBase.h:46
const Solve< HouseholderQR< _MatrixType >, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
@ RowsAtCompileTime
Definition: SolverBase.h:80
@ ColMajor
Definition: Constants.h:319
@ RowMajor
Definition: Constants.h:321
const unsigned int RowMajorBit
Definition: Constants.h:66
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16() min(const bfloat16 &a, const bfloat16 &b)
Definition: BFloat16.h:571
void householder_qr_inplace_unblocked(MatrixQR &mat, HCoeffs &hCoeffs, typename MatrixQR::Scalar *tempData=0)
Definition: HouseholderQR.h:267
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
void apply_block_householder_on_the_left(MatrixType &mat, const VectorsType &vectors, const CoeffsType &hCoeffs, bool forward)
Definition: BlockHouseholder.h:86
Namespace containing all symbols from the Eigen library.
Definition: LDLT.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Flags
Special flags for archives.
Definition: cereal.hpp:185
Definition: document.h:416
Definition: json.hpp:5678
Definition: EigenBase.h:30
EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:46
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:39
Definition: Constants.h:522
Definition: Constants.h:513
Definition: HouseholderQR.h:305
static void run(MatrixQR &mat, HCoeffs &hCoeffs, Index maxBlockSize=32, typename MatrixQR::Scalar *tempData=0)
Definition: HouseholderQR.h:307
MatrixXpr XprKind
Definition: HouseholderQR.h:21
int StorageIndex
Definition: HouseholderQR.h:23
SolverStorage StorageKind
Definition: HouseholderQR.h:22
Definition: ForwardDeclarations.h:17