Go to the documentation of this file.
10 #ifndef EIGEN_COMPLETEORTHOGONALDECOMPOSITION_H
11 #define EIGEN_COMPLETEORTHOGONALDECOMPOSITION_H
16 template <
typename _MatrixType>
47 template <
typename _MatrixType>
48 class CompleteOrthogonalDecomposition {
112 template <
typename InputType>
127 template<
typename InputType>
146 template <
typename Rhs>
150 "CompleteOrthogonalDecomposition is not initialized.");
183 template <
typename InputType>
368 #ifndef EIGEN_PARSED_BY_DOXYGEN
369 template <
typename RhsType,
typename DstType>
370 EIGEN_DEVICE_FUNC
void _solve_impl(
const RhsType& rhs, DstType& dst)
const;
382 template <
typename Rhs>
390 template <
typename MatrixType>
393 return m_cpqr.absDeterminant();
396 template <
typename MatrixType>
399 return m_cpqr.logAbsDeterminant();
409 template <
typename MatrixType>
412 check_template_parameters();
417 const Index rank = m_cpqr.rank();
418 const Index cols = m_cpqr.cols();
419 const Index rows = m_cpqr.rows();
420 m_zCoeffs.resize((
std::min)(rows, cols));
435 for (
Index k = rank - 1; k >= 0; --k) {
440 m_cpqr.m_qr.col(k).head(k + 1).swap(
441 m_cpqr.m_qr.col(rank - 1).head(k + 1));
448 .tail(cols - rank + 1)
449 .makeHouseholderInPlace(m_zCoeffs(k), beta);
450 m_cpqr.m_qr(k, rank - 1) = beta;
453 m_cpqr.m_qr.topRightCorner(k, cols - rank + 1)
454 .applyHouseholderOnTheRight(
455 m_cpqr.m_qr.row(k).tail(cols - rank).transpose(), m_zCoeffs(k),
460 m_cpqr.m_qr.col(k).head(k + 1).swap(
461 m_cpqr.m_qr.col(rank - 1).head(k + 1));
467 template <
typename MatrixType>
468 template <
typename Rhs>
471 const Index cols = this->cols();
472 const Index nrhs = rhs.cols();
473 const Index rank = this->rank();
475 for (
Index k = 0; k < rank; ++k) {
477 rhs.row(k).swap(rhs.row(rank - 1));
479 rhs.middleRows(rank - 1, cols - rank + 1)
480 .applyHouseholderOnTheLeft(
481 matrixQTZ().
row(k).
tail(cols - rank).adjoint(), zCoeffs()(k),
484 rhs.row(k).swap(rhs.row(rank - 1));
489 #ifndef EIGEN_PARSED_BY_DOXYGEN
490 template <
typename _MatrixType>
491 template <
typename RhsType,
typename DstType>
493 const RhsType& rhs, DstType& dst)
const {
496 const Index rank = this->rank();
505 typename RhsType::PlainObject
c(rhs);
510 dst.topRows(rank) = matrixT()
511 .topLeftCorner(rank, rank)
512 .template triangularView<Upper>()
513 .solve(
c.topRows(rank));
515 const Index cols = this->cols();
519 dst.bottomRows(cols - rank).setZero();
520 applyZAdjointOnTheLeftInPlace(dst);
524 dst = colsPermutation() * dst;
530 template<
typename DstXprType,
typename MatrixType>
544 template <
typename MatrixType>
547 return m_cpqr.householderQ();
554 template <
typename Derived>
562 #endif // EIGEN_COMPLETEORTHOGONALDECOMPOSITION_H
Expression of the inverse of another expression.
ColPivHouseholderQR & setThreshold(const RealScalar &threshold)
const PermutationType & colsPermutation() const
Index dimensionOfKernel() const
RealScalar threshold() const
const HCoeffsType & hCoeffs() const
ColPivHouseholderQR< MatrixType > m_cpqr
Inverse< CodType > SrcXprType
MatrixType::RealScalar logAbsDeterminant() const
const Inverse< CompleteOrthogonalDecomposition > pseudoInverse() const
Eigen::Index Index
The interface type of indices.
EIGEN_DEVICE_FUNC void _solve_impl(const RhsType &rhs, DstType &dst) const
HouseholderSequence< VectorsType, CoeffsType > householderSequence(const VectorsType &v, const CoeffsType &h)
Convenience function for constructing a Householder sequence.
const HCoeffsType & hCoeffs() const
bool isInvertible() const
MatrixType::StorageIndex StorageIndex
MatrixType::PlainObject PlainObject
NumTraits< Scalar >::Real RealScalar
const HCoeffsType & zCoeffs() const
Map< Matrix< T, Dynamic, Dynamic, ColMajor >, 0, OuterStride<> > matrix(T *data, int rows, int cols, int stride)
PermutationType::Index PermIndexType
CompleteOrthogonalDecomposition(Index rows, Index cols)
Default Constructor with memory preallocation.
HouseholderSequence< MatrixType, typename internal::remove_all< typename HCoeffsType::ConjugateReturnType >::type > HouseholderSequenceType
RealScalar maxPivot() const
bool isSurjective() const
CompleteOrthogonalDecomposition(EigenBase< InputType > &matrix)
Constructs a complete orthogonal decomposition from a given matrix.
CompleteOrthogonalDecomposition & compute(const EigenBase< InputType > &matrix)
static void run(DstXprType &dst, const SrcXprType &src, const internal::assign_op< typename DstXprType::Scalar, typename CodType::Scalar > &)
HouseholderSequenceType householderQ(void) const
const MatrixType & matrixT() const
internal::plain_row_type< MatrixType, Index >::type IntRowVectorType
CompleteOrthogonalDecomposition & setThreshold(const RealScalar &threshold)
const MatrixType & matrixQTZ() const
MatrixType::Scalar Scalar
ColPivHouseholderQR & compute(const EigenBase< InputType > &matrix)
RealScalar maxPivot() const
const Solve< CompleteOrthogonalDecomposition, Rhs > solve(const MatrixBase< Rhs > &b) const
void applyZAdjointOnTheLeftInPlace(Rhs &rhs) const
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). */.
const EIGEN_DEVICE_FUNC XprTypeNestedCleaned & nestedExpression() const
MatrixType::RealScalar absDeterminant() const
CompleteOrthogonalDecomposition(const EigenBase< InputType > &matrix)
Constructs a complete orthogonal decomposition from a given matrix.
Complete orthogonal decomposition (COD) of a matrix.
MatrixType matrixZ() const
Index dimensionOfKernel() const
internal::plain_row_type< MatrixType >::type RowVectorType
ComputationInfo info() const
Reports whether the complete orthogonal decomposition was succesful.
static void check_template_parameters()
PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime > PermutationType
const CompleteOrthogonalDecomposition< PlainObject > completeOrthogonalDecomposition() const
MatrixType::RealScalar RealScalar
Pseudo expression representing a solving operation.
EIGEN_DEVICE_FUNC SegmentReturnType tail(Index n)
This is the const version of tail(Index).
bool isInvertible() const
const MatrixType & matrixQR() const
Index nonzeroPivots() const
internal::conditional< NumTraits< Scalar >::IsComplex, const CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const Derived >, const Derived & >::type ConjugateReturnType
RealScalar threshold() const
The matrix class, also used for vectors and row-vectors.
Index nonzeroPivots() const
Base class for all dense matrices, vectors, and expressions.
internal::plain_diag_type< MatrixType >::type HCoeffsType
bool isSurjective() const
EIGEN_DEVICE_FUNC Index rows() const
HouseholderSequenceType matrixQ(void) const
Holds information about the various numeric (i.e. scalar) types allowed by Eigen.
HouseholderSequenceType householderQ() const
const PermutationType & colsPermutation() const
internal::plain_row_type< MatrixType, RealScalar >::type RealRowVectorType
CompleteOrthogonalDecomposition()
Default Constructor.
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
CompleteOrthogonalDecomposition & setThreshold(Default_t)
Sequence of Householder reflections acting on subspaces with decreasing size.
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
CompleteOrthogonalDecomposition< MatrixType > CodType
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:40