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>
246template<
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());
255template<
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();
266template<
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);
301template<
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
359template<
typename _MatrixType>
360template<
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();
377template<
typename _MatrixType>
378template<
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>() );
403template<
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;
425template<
typename Derived>
#define EIGEN_GENERIC_PUBLIC_INTERFACE(Derived)
Just a side note.
Definition: Macros.h:1274
#define eigen_assert(x)
Definition: Macros.h:1047
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
Definition: StaticAssert.h:187
constexpr common_return_t< T1, T2 > beta(const T1 a, const T2 b) noexcept
Compile-time beta function.
Definition: beta.hpp:36
Expression of a fixed-size or dynamic-size block.
Definition: Block.h:105
Householder QR decomposition of a matrix.
Definition: HouseholderQR.h:58
@ MaxColsAtCompileTime
Definition: HouseholderQR.h:68
@ MaxRowsAtCompileTime
Definition: HouseholderQR.h:67
const HCoeffsType & hCoeffs() const
Definition: HouseholderQR.h:221
HouseholderQR(Index rows, Index cols)
Default Constructor with memory preallocation.
Definition: HouseholderQR.h:89
_MatrixType MatrixType
Definition: HouseholderQR.h:61
Index cols() const
Definition: HouseholderQR.h:215
void computeInPlace()
Performs the QR factorization of the given matrix matrix.
Definition: HouseholderQR.h:404
HouseholderSequence< MatrixType, typename internal::remove_all< typename HCoeffsType::ConjugateReturnType >::type > HouseholderSequenceType
Definition: HouseholderQR.h:73
const MatrixType & matrixQR() const
Definition: HouseholderQR.h:172
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
MatrixType::RealScalar absDeterminant() const
Definition: HouseholderQR.h:247
static void check_template_parameters()
Definition: HouseholderQR.h:233
HouseholderQR & compute(const EigenBase< InputType > &matrix)
Definition: HouseholderQR.h:179
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
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
This method returns an expression of the unitary matrix Q as a sequence of Householder transformation...
Definition: HouseholderQR.h:163
\householder_module
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)
Resizes *this to a rows x cols matrix.
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
const Solve< HouseholderQR< _MatrixType >, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition: SolverBase.h:106
EIGEN_DEVICE_FUNC HouseholderQR< _MatrixType > & derived()
Definition: EigenBase.h:46
@ RowsAtCompileTime
Definition: SolverBase.h:80
UnitType abs(const UnitType x) noexcept
Compute absolute value.
Definition: math.h:721
@ ColMajor
Storage order is column major (see TopicStorageOrders).
Definition: Constants.h:319
@ RowMajor
Storage order is row major (see TopicStorageOrders).
Definition: Constants.h:321
const unsigned int RowMajorBit
for a matrix, this means that the storage order is row-major.
Definition: Constants.h:66
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:35
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: Core:141
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74
Definition: Eigen_Colamd.h:50
Definition: BFloat16.h:88
static constexpr const velocity::meters_per_second_t c(299792458.0)
Speed of light in vacuum.
Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor Matrix...
Definition: EigenBase.h:30
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:39
EIGEN_DEVICE_FUNC Derived & derived()
Definition: EigenBase.h:46
The type used to identify a matrix expression.
Definition: Constants.h:522
The type used to identify a general solver (factored) storage.
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