Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::CompleteOrthogonalDecomposition< _MatrixType > Class Template Reference

Complete orthogonal decomposition (COD) of a matrix. More...

#include <src/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h>

+ Collaboration diagram for Eigen::CompleteOrthogonalDecomposition< _MatrixType >:

Public Types

enum  { RowsAtCompileTime = MatrixType::RowsAtCompileTime , ColsAtCompileTime = MatrixType::ColsAtCompileTime , MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime , MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }
 
typedef _MatrixType MatrixType
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::StorageIndex StorageIndex
 
typedef internal::plain_diag_type< MatrixType >::type HCoeffsType
 
typedef PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTimePermutationType
 
typedef internal::plain_row_type< MatrixType, Index >::type IntRowVectorType
 
typedef internal::plain_row_type< MatrixType >::type RowVectorType
 
typedef internal::plain_row_type< MatrixType, RealScalar >::type RealRowVectorType
 
typedef HouseholderSequence< MatrixType, typename internal::remove_all< typename HCoeffsType::ConjugateReturnType >::type > HouseholderSequenceType
 
typedef MatrixType::PlainObject PlainObject
 

Public Member Functions

 CompleteOrthogonalDecomposition ()
 Default Constructor.
 
 CompleteOrthogonalDecomposition (Index rows, Index cols)
 Default Constructor with memory preallocation.
 
template<typename InputType >
 CompleteOrthogonalDecomposition (const EigenBase< InputType > &matrix)
 Constructs a complete orthogonal decomposition from a given matrix.
 
template<typename InputType >
 CompleteOrthogonalDecomposition (EigenBase< InputType > &matrix)
 Constructs a complete orthogonal decomposition from a given matrix.
 
template<typename Rhs >
const Solve< CompleteOrthogonalDecomposition, Rhs > solve (const MatrixBase< Rhs > &b) const
 
HouseholderSequenceType householderQ (void) const
 
HouseholderSequenceType matrixQ (void) const
 
MatrixType matrixZ () const
 
const MatrixTypematrixQTZ () const
 
const MatrixTypematrixT () const
 
template<typename InputType >
CompleteOrthogonalDecompositioncompute (const EigenBase< InputType > &matrix)
 
const PermutationTypecolsPermutation () const
 
MatrixType::RealScalar absDeterminant () const
 
MatrixType::RealScalar logAbsDeterminant () const
 
Index rank () const
 
Index dimensionOfKernel () const
 
bool isInjective () const
 
bool isSurjective () const
 
bool isInvertible () const
 
const Inverse< CompleteOrthogonalDecompositionpseudoInverse () const
 
Index rows () const
 
Index cols () const
 
const HCoeffsTypehCoeffs () const
 
const HCoeffsTypezCoeffs () const
 
CompleteOrthogonalDecompositionsetThreshold (const RealScalar &threshold)
 
CompleteOrthogonalDecompositionsetThreshold (Default_t)
 
RealScalar threshold () const
 
Index nonzeroPivots () const
 
RealScalar maxPivot () const
 
ComputationInfo info () const
 Reports whether the complete orthogonal decomposition was succesful.
 
template<typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void _solve_impl (const RhsType &rhs, DstType &dst) const
 
template<typename RhsType , typename DstType >
void _solve_impl (const RhsType &rhs, DstType &dst) const
 

Protected Member Functions

void computeInPlace ()
 
template<typename Rhs >
void applyZAdjointOnTheLeftInPlace (Rhs &rhs) const
 

Static Protected Member Functions

static void check_template_parameters ()
 

Protected Attributes

ColPivHouseholderQR< MatrixTypem_cpqr
 
HCoeffsType m_zCoeffs
 
RowVectorType m_temp
 

Private Types

typedef PermutationType::Index PermIndexType
 

Detailed Description

template<typename _MatrixType>
class Eigen::CompleteOrthogonalDecomposition< _MatrixType >

Complete orthogonal decomposition (COD) of a matrix.

Parameters
MatrixTypethe type of the matrix of which we are computing the COD.

This class performs a rank-revealing complete orthogonal decomposition of a matrix A into matrices P, Q, T, and Z such that

\[
 \mathbf{A} \, \mathbf{P} = \mathbf{Q} \,
                    \begin{bmatrix} \mathbf{T} &  \mathbf{0} \\
                                    \mathbf{0} & \mathbf{0} \end{bmatrix} \, \mathbf{Z}
\]

by using Householder transformations. Here, P is a permutation matrix, Q and Z are unitary matrices and T an upper triangular matrix of size rank-by-rank. A may be rank deficient.

This class supports the inplace decomposition mechanism.

See also
MatrixBase::completeOrthogonalDecomposition()

Member Typedef Documentation

◆ HCoeffsType

template<typename _MatrixType >
typedef internal::plain_diag_type<MatrixType>::type Eigen::CompleteOrthogonalDecomposition< _MatrixType >::HCoeffsType

◆ HouseholderSequenceType

template<typename _MatrixType >
typedef HouseholderSequence< MatrixType, typename internal::remove_all< typename HCoeffsType::ConjugateReturnType>::type> Eigen::CompleteOrthogonalDecomposition< _MatrixType >::HouseholderSequenceType

◆ IntRowVectorType

template<typename _MatrixType >
typedef internal::plain_row_type<MatrixType,Index>::type Eigen::CompleteOrthogonalDecomposition< _MatrixType >::IntRowVectorType

◆ MatrixType

template<typename _MatrixType >
typedef _MatrixType Eigen::CompleteOrthogonalDecomposition< _MatrixType >::MatrixType

◆ PermIndexType

template<typename _MatrixType >
typedef PermutationType::Index Eigen::CompleteOrthogonalDecomposition< _MatrixType >::PermIndexType
private

◆ PermutationType

template<typename _MatrixType >
typedef PermutationMatrix<ColsAtCompileTime, MaxColsAtCompileTime> Eigen::CompleteOrthogonalDecomposition< _MatrixType >::PermutationType

◆ PlainObject

template<typename _MatrixType >
typedef MatrixType::PlainObject Eigen::CompleteOrthogonalDecomposition< _MatrixType >::PlainObject

◆ RealRowVectorType

template<typename _MatrixType >
typedef internal::plain_row_type<MatrixType,RealScalar>::type Eigen::CompleteOrthogonalDecomposition< _MatrixType >::RealRowVectorType

◆ RealScalar

template<typename _MatrixType >
typedef MatrixType::RealScalar Eigen::CompleteOrthogonalDecomposition< _MatrixType >::RealScalar

◆ RowVectorType

template<typename _MatrixType >
typedef internal::plain_row_type<MatrixType>::type Eigen::CompleteOrthogonalDecomposition< _MatrixType >::RowVectorType

◆ Scalar

template<typename _MatrixType >
typedef MatrixType::Scalar Eigen::CompleteOrthogonalDecomposition< _MatrixType >::Scalar

◆ StorageIndex

template<typename _MatrixType >
typedef MatrixType::StorageIndex Eigen::CompleteOrthogonalDecomposition< _MatrixType >::StorageIndex

Member Enumeration Documentation

◆ anonymous enum

template<typename _MatrixType >
anonymous enum
Enumerator
RowsAtCompileTime 
ColsAtCompileTime 
MaxRowsAtCompileTime 
MaxColsAtCompileTime 
51 {
52 RowsAtCompileTime = MatrixType::RowsAtCompileTime,
53 ColsAtCompileTime = MatrixType::ColsAtCompileTime,
54 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
55 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
56 };
@ RowsAtCompileTime
Definition CompleteOrthogonalDecomposition.h:52
@ MaxRowsAtCompileTime
Definition CompleteOrthogonalDecomposition.h:54
@ MaxColsAtCompileTime
Definition CompleteOrthogonalDecomposition.h:55
@ ColsAtCompileTime
Definition CompleteOrthogonalDecomposition.h:53

Constructor & Destructor Documentation

◆ CompleteOrthogonalDecomposition() [1/4]

template<typename _MatrixType >
Eigen::CompleteOrthogonalDecomposition< _MatrixType >::CompleteOrthogonalDecomposition ( )
inline

Default Constructor.

The default constructor is useful in cases in which the user intends to perform decompositions via CompleteOrthogonalDecomposition::compute(const* MatrixType&).

85: m_cpqr(), m_zCoeffs(), m_temp() {}
ColPivHouseholderQR< MatrixType > m_cpqr
Definition CompleteOrthogonalDecomposition.h:385
HCoeffsType m_zCoeffs
Definition CompleteOrthogonalDecomposition.h:386
RowVectorType m_temp
Definition CompleteOrthogonalDecomposition.h:387

◆ CompleteOrthogonalDecomposition() [2/4]

template<typename _MatrixType >
Eigen::CompleteOrthogonalDecomposition< _MatrixType >::CompleteOrthogonalDecomposition ( Index  rows,
Index  cols 
)
inline

Default Constructor with memory preallocation.

Like the default constructor but with preallocation of the internal data according to the specified problem size.

See also
CompleteOrthogonalDecomposition()
94 : m_cpqr(rows, cols), m_zCoeffs((std::min)(rows, cols)), m_temp(cols) {}
Index cols() const
Definition CompleteOrthogonalDecomposition.h:282
Index rows() const
Definition CompleteOrthogonalDecomposition.h:281

◆ CompleteOrthogonalDecomposition() [3/4]

template<typename _MatrixType >
template<typename InputType >
Eigen::CompleteOrthogonalDecomposition< _MatrixType >::CompleteOrthogonalDecomposition ( const EigenBase< InputType > &  matrix)
inlineexplicit

Constructs a complete orthogonal decomposition from a given matrix.

This constructor computes the complete orthogonal decomposition of the matrix matrix by calling the method compute(). The default threshold for rank determination will be used. It is a short cut for:

matrix.cols());
cod.setThreshold(Default);
cod.compute(matrix);
Complete orthogonal decomposition (COD) of a matrix.
Definition CompleteOrthogonalDecomposition.h:48
@ Default
Definition Constants.h:352
See also
compute()
114 : m_cpqr(matrix.rows(), matrix.cols()),
115 m_zCoeffs((std::min)(matrix.rows(), matrix.cols())),
116 m_temp(matrix.cols())
117 {
118 compute(matrix.derived());
119 }
CompleteOrthogonalDecomposition & compute(const EigenBase< InputType > &matrix)
Definition CompleteOrthogonalDecomposition.h:184

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::compute(), and Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ CompleteOrthogonalDecomposition() [4/4]

template<typename _MatrixType >
template<typename InputType >
Eigen::CompleteOrthogonalDecomposition< _MatrixType >::CompleteOrthogonalDecomposition ( EigenBase< InputType > &  matrix)
inlineexplicit

Constructs a complete orthogonal decomposition from a given matrix.

This overloaded constructor is provided for inplace decomposition when MatrixType is a Eigen::Ref.

See also
CompleteOrthogonalDecomposition(const EigenBase&)
129 : m_cpqr(matrix.derived()),
130 m_zCoeffs((std::min)(matrix.rows(), matrix.cols())),
131 m_temp(matrix.cols())
132 {
134 }
void computeInPlace()
Definition CompleteOrthogonalDecomposition.h:410

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::computeInPlace().

+ Here is the call graph for this function:

Member Function Documentation

◆ _solve_impl() [1/2]

template<typename _MatrixType >
template<typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void Eigen::CompleteOrthogonalDecomposition< _MatrixType >::_solve_impl ( const RhsType &  rhs,
DstType &  dst 
) const

◆ _solve_impl() [2/2]

template<typename _MatrixType >
template<typename RhsType , typename DstType >
void Eigen::CompleteOrthogonalDecomposition< _MatrixType >::_solve_impl ( const RhsType &  rhs,
DstType &  dst 
) const
493 {
494 eigen_assert(rhs.rows() == this->rows());
495
496 const Index rank = this->rank();
497 if (rank == 0) {
498 dst.setZero();
499 return;
500 }
501
502 // Compute c = Q^* * rhs
503 // Note that the matrix Q = H_0^* H_1^*... so its inverse is
504 // Q^* = (H_0 H_1 ...)^T
505 typename RhsType::PlainObject c(rhs);
506 c.applyOnTheLeft(
507 householderSequence(matrixQTZ(), hCoeffs()).setLength(rank).transpose());
508
509 // Solve T z = c(1:rank, :)
510 dst.topRows(rank) = matrixT()
511 .topLeftCorner(rank, rank)
512 .template triangularView<Upper>()
513 .solve(c.topRows(rank));
514
515 const Index cols = this->cols();
516 if (rank < cols) {
517 // Compute y = Z^* * [ z ]
518 // [ 0 ]
519 dst.bottomRows(cols - rank).setZero();
521 }
522
523 // Undo permutation to get x = P^{-1} * y.
524 dst = colsPermutation() * dst;
525}
#define eigen_assert(x)
Definition Macros.h:579
void applyZAdjointOnTheLeftInPlace(Rhs &rhs) const
Definition CompleteOrthogonalDecomposition.h:469
const MatrixType & matrixQTZ() const
Definition CompleteOrthogonalDecomposition.h:168
const PermutationType & colsPermutation() const
Definition CompleteOrthogonalDecomposition.h:192
const MatrixType & matrixT() const
Definition CompleteOrthogonalDecomposition.h:181
const HCoeffsType & hCoeffs() const
Definition CompleteOrthogonalDecomposition.h:289
Index rank() const
Definition CompleteOrthogonalDecomposition.h:233
HouseholderSequence< VectorsType, CoeffsType > householderSequence(const VectorsType &v, const CoeffsType &h)
Convenience function for constructing a Householder sequence.
Definition HouseholderSequence.h:451
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition Meta.h:33

References eigen_assert, and Eigen::householderSequence().

+ Here is the call graph for this function:

◆ absDeterminant()

template<typename MatrixType >
MatrixType::RealScalar Eigen::CompleteOrthogonalDecomposition< MatrixType >::absDeterminant
Returns
the absolute value of the determinant of the matrix of which *this is the complete orthogonal decomposition. It has only linear complexity (that is, O(n) where n is the dimension of the square matrix) as the complete orthogonal decomposition has already been computed.
Note
This is only for square matrices.
Warning
a determinant can be very big or small, so for matrices of large enough dimension, there is a risk of overflow/underflow. One way to work around that is to use logAbsDeterminant() instead.
See also
logAbsDeterminant(), MatrixBase::determinant()
392 {
393 return m_cpqr.absDeterminant();
394}
MatrixType::RealScalar absDeterminant() const
Definition ColPivHouseholderQR.h:448

◆ applyZAdjointOnTheLeftInPlace()

template<typename MatrixType >
template<typename Rhs >
void Eigen::CompleteOrthogonalDecomposition< MatrixType >::applyZAdjointOnTheLeftInPlace ( Rhs &  rhs) const
protected

Overwrites rhs with $ \mathbf{Z}^* * \mathbf{rhs} $.

470 {
471 const Index cols = this->cols();
472 const Index nrhs = rhs.cols();
473 const Index rank = this->rank();
474 Matrix<typename MatrixType::Scalar, Dynamic, 1> temp((std::max)(cols, nrhs));
475 for (Index k = 0; k < rank; ++k) {
476 if (k != rank - 1) {
477 rhs.row(k).swap(rhs.row(rank - 1));
478 }
479 rhs.middleRows(rank - 1, cols - rank + 1)
480 .applyHouseholderOnTheLeft(
481 matrixQTZ().row(k).tail(cols - rank).adjoint(), zCoeffs()(k),
482 &temp(0));
483 if (k != rank - 1) {
484 rhs.row(k).swap(rhs.row(rank - 1));
485 }
486 }
487}
EIGEN_DEVICE_FUNC SegmentReturnType tail(Index n)
This is the const version of tail(Index).
Definition BlockMethods.h:949
EIGEN_DEVICE_FUNC RowXpr row(Index i)
This is the const version of row(). *‍/.
Definition BlockMethods.h:859
const HCoeffsType & zCoeffs() const
Definition CompleteOrthogonalDecomposition.h:296

References row(), and tail().

Referenced by Eigen::CompleteOrthogonalDecomposition< _MatrixType >::matrixZ().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_template_parameters()

template<typename _MatrixType >
static void Eigen::CompleteOrthogonalDecomposition< _MatrixType >::check_template_parameters ( )
inlinestaticprotected
374 {
376 }
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
Definition StaticAssert.h:184
MatrixType::Scalar Scalar
Definition CompleteOrthogonalDecomposition.h:57

References EIGEN_STATIC_ASSERT_NON_INTEGER.

◆ cols()

template<typename _MatrixType >
Index Eigen::CompleteOrthogonalDecomposition< _MatrixType >::cols ( ) const
inline
282{ return m_cpqr.cols(); }
Index cols() const
Definition ColPivHouseholderQR.h:328

References Eigen::ColPivHouseholderQR< _MatrixType >::cols(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ colsPermutation()

template<typename _MatrixType >
const PermutationType & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::colsPermutation ( ) const
inline
Returns
a const reference to the column permutation matrix
192 {
193 return m_cpqr.colsPermutation();
194 }
const PermutationType & colsPermutation() const
Definition ColPivHouseholderQR.h:214

References Eigen::ColPivHouseholderQR< _MatrixType >::colsPermutation(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ compute()

template<typename _MatrixType >
template<typename InputType >
CompleteOrthogonalDecomposition & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::compute ( const EigenBase< InputType > &  matrix)
inline
184 {
185 // Compute the column pivoted QR factorization A P = Q R.
186 m_cpqr.compute(matrix);
188 return *this;
189 }
ColPivHouseholderQR & compute(const EigenBase< InputType > &matrix)

References Eigen::ColPivHouseholderQR< _MatrixType >::compute(), Eigen::CompleteOrthogonalDecomposition< _MatrixType >::computeInPlace(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

Referenced by Eigen::CompleteOrthogonalDecomposition< _MatrixType >::CompleteOrthogonalDecomposition().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ computeInPlace()

template<typename MatrixType >
void Eigen::CompleteOrthogonalDecomposition< MatrixType >::computeInPlace
protected

Performs the complete orthogonal decomposition of the given matrix matrix. The result of the factorization is stored into *this, and a reference to *this is returned.

See also
class CompleteOrthogonalDecomposition, CompleteOrthogonalDecomposition(const MatrixType&)
411{
413
414 // the column permutation is stored as int indices, so just to be sure:
415 eigen_assert(m_cpqr.cols() <= NumTraits<int>::highest());
416
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));
421 m_temp.resize(cols);
422
423 if (rank < cols) {
424 // We have reduced the (permuted) matrix to the form
425 // [R11 R12]
426 // [ 0 R22]
427 // where R11 is r-by-r (r = rank) upper triangular, R12 is
428 // r-by-(n-r), and R22 is empty or the norm of R22 is negligible.
429 // We now compute the complete orthogonal decomposition by applying
430 // Householder transformations from the right to the upper trapezoidal
431 // matrix X = [R11 R12] to zero out R12 and obtain the factorization
432 // [R11 R12] = [T11 0] * Z, where T11 is r-by-r upper triangular and
433 // Z = Z(0) * Z(1) ... Z(r-1) is an n-by-n orthogonal matrix.
434 // We store the data representing Z in R12 and m_zCoeffs.
435 for (Index k = rank - 1; k >= 0; --k) {
436 if (k != rank - 1) {
437 // Given the API for Householder reflectors, it is more convenient if
438 // we swap the leading parts of columns k and r-1 (zero-based) to form
439 // the matrix X_k = [X(0:k, k), X(0:k, r:n)]
440 m_cpqr.m_qr.col(k).head(k + 1).swap(
441 m_cpqr.m_qr.col(rank - 1).head(k + 1));
442 }
443 // Construct Householder reflector Z(k) to zero out the last row of X_k,
444 // i.e. choose Z(k) such that
445 // [X(k, k), X(k, r:n)] * Z(k) = [beta, 0, .., 0].
446 RealScalar beta;
447 m_cpqr.m_qr.row(k)
448 .tail(cols - rank + 1)
449 .makeHouseholderInPlace(m_zCoeffs(k), beta);
450 m_cpqr.m_qr(k, rank - 1) = beta;
451 if (k > 0) {
452 // Apply Z(k) to the first k rows of X_k
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),
456 &m_temp(0));
457 }
458 if (k != rank - 1) {
459 // Swap X(0:k,k) back to its proper location.
460 m_cpqr.m_qr.col(k).head(k + 1).swap(
461 m_cpqr.m_qr.col(rank - 1).head(k + 1));
462 }
463 }
464 }
465}
Index rank() const
Definition ColPivHouseholderQR.h:255
Index rows() const
Definition ColPivHouseholderQR.h:327
MatrixType m_qr
Definition ColPivHouseholderQR.h:434
static void check_template_parameters()
Definition CompleteOrthogonalDecomposition.h:374
MatrixType::RealScalar RealScalar
Definition CompleteOrthogonalDecomposition.h:58

References eigen_assert.

Referenced by Eigen::CompleteOrthogonalDecomposition< _MatrixType >::CompleteOrthogonalDecomposition(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::compute().

+ Here is the caller graph for this function:

◆ dimensionOfKernel()

template<typename _MatrixType >
Index Eigen::CompleteOrthogonalDecomposition< _MatrixType >::dimensionOfKernel ( ) const
inline
Returns
the dimension of the kernel of the matrix of which *this is the complete orthogonal decomposition.
Note
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).
242{ return m_cpqr.dimensionOfKernel(); }
Index dimensionOfKernel() const
Definition ColPivHouseholderQR.h:272

References Eigen::ColPivHouseholderQR< _MatrixType >::dimensionOfKernel(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ hCoeffs()

template<typename _MatrixType >
const HCoeffsType & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::hCoeffs ( ) const
inline
Returns
a const reference to the vector of Householder coefficients used to represent the factor Q.

For advanced uses only.

289{ return m_cpqr.hCoeffs(); }
const HCoeffsType & hCoeffs() const
Definition ColPivHouseholderQR.h:334

References Eigen::ColPivHouseholderQR< _MatrixType >::hCoeffs(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ householderQ()

Returns
the matrix Q as a sequence of householder transformations
546 {
547 return m_cpqr.householderQ();
548}
HouseholderSequenceType householderQ() const
Definition ColPivHouseholderQR.h:634

◆ info()

template<typename _MatrixType >
ComputationInfo Eigen::CompleteOrthogonalDecomposition< _MatrixType >::info ( ) const
inline

Reports whether the complete orthogonal decomposition was succesful.

Note
This function always returns Success. It is provided for compatibility with other factorization routines.
Returns
Success
363 {
364 eigen_assert(m_cpqr.m_isInitialized && "Decomposition is not initialized.");
365 return Success;
366 }
bool m_isInitialized
Definition ColPivHouseholderQR.h:441
@ Success
Definition Constants.h:432

References eigen_assert, Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, Eigen::ColPivHouseholderQR< _MatrixType >::m_isInitialized, and Eigen::Success.

◆ isInjective()

template<typename _MatrixType >
bool Eigen::CompleteOrthogonalDecomposition< _MatrixType >::isInjective ( ) const
inline
Returns
true if the matrix of which *this is the decomposition represents an injective linear map, i.e. has trivial kernel; false otherwise.
Note
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).
251{ return m_cpqr.isInjective(); }
bool isInjective() const
Definition ColPivHouseholderQR.h:285

References Eigen::ColPivHouseholderQR< _MatrixType >::isInjective(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ isInvertible()

template<typename _MatrixType >
bool Eigen::CompleteOrthogonalDecomposition< _MatrixType >::isInvertible ( ) const
inline
Returns
true if the matrix of which *this is the complete orthogonal decomposition is invertible.
Note
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).
269{ return m_cpqr.isInvertible(); }
bool isInvertible() const
Definition ColPivHouseholderQR.h:310

References Eigen::ColPivHouseholderQR< _MatrixType >::isInvertible(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ isSurjective()

template<typename _MatrixType >
bool Eigen::CompleteOrthogonalDecomposition< _MatrixType >::isSurjective ( ) const
inline
Returns
true if the matrix of which *this is the decomposition represents a surjective linear map; false otherwise.
Note
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).
260{ return m_cpqr.isSurjective(); }
bool isSurjective() const
Definition ColPivHouseholderQR.h:298

References Eigen::ColPivHouseholderQR< _MatrixType >::isSurjective(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ logAbsDeterminant()

template<typename MatrixType >
MatrixType::RealScalar Eigen::CompleteOrthogonalDecomposition< MatrixType >::logAbsDeterminant
Returns
the natural log of the absolute value of the determinant of the matrix of which *this is the complete orthogonal decomposition. It has only linear complexity (that is, O(n) where n is the dimension of the square matrix) as the complete orthogonal decomposition has already been computed.
Note
This is only for square matrices.
This method is useful to work around the risk of overflow/underflow that's inherent to determinant computation.
See also
absDeterminant(), MatrixBase::determinant()
398 {
399 return m_cpqr.logAbsDeterminant();
400}
MatrixType::RealScalar logAbsDeterminant() const
Definition ColPivHouseholderQR.h:457

◆ matrixQ()

template<typename _MatrixType >
HouseholderSequenceType Eigen::CompleteOrthogonalDecomposition< _MatrixType >::matrixQ ( void  ) const
inline
155{ return m_cpqr.householderQ(); }

References Eigen::ColPivHouseholderQR< _MatrixType >::householderQ(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ matrixQTZ()

template<typename _MatrixType >
const MatrixType & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::matrixQTZ ( ) const
inline
Returns
a reference to the matrix where the complete orthogonal decomposition is stored
168{ return m_cpqr.matrixQR(); }
const MatrixType & matrixQR() const
Definition ColPivHouseholderQR.h:189

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::matrixQR().

+ Here is the call graph for this function:

◆ matrixT()

template<typename _MatrixType >
const MatrixType & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::matrixT ( ) const
inline
Returns
a reference to the matrix where the complete orthogonal decomposition is stored.
Warning
The strict lower part and
cols() - rank()
right columns of this matrix contains internal values. Only the upper triangular part should be referenced. To get it, use
matrixT().template triangularView<Upper>()
For rank-deficient matrices, use
matrixR().topLeftCorner(rank(), rank()).template triangularView<Upper>()
181{ return m_cpqr.matrixQR(); }

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::matrixQR().

+ Here is the call graph for this function:

◆ matrixZ()

template<typename _MatrixType >
MatrixType Eigen::CompleteOrthogonalDecomposition< _MatrixType >::matrixZ ( ) const
inline
Returns
the matrix Z.
159 {
160 MatrixType Z = MatrixType::Identity(m_cpqr.cols(), m_cpqr.cols());
162 return Z.adjoint();
163 }
_MatrixType MatrixType
Definition CompleteOrthogonalDecomposition.h:50
@ Z
Definition libslic3r.h:100

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::applyZAdjointOnTheLeftInPlace(), Eigen::ColPivHouseholderQR< _MatrixType >::cols(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr.

+ Here is the call graph for this function:

◆ maxPivot()

template<typename _MatrixType >
RealScalar Eigen::CompleteOrthogonalDecomposition< _MatrixType >::maxPivot ( ) const
inline
Returns
the absolute value of the biggest pivot, i.e. the biggest diagonal coefficient of R.
353{ return m_cpqr.maxPivot(); }
RealScalar maxPivot() const
Definition ColPivHouseholderQR.h:403

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::maxPivot().

+ Here is the call graph for this function:

◆ nonzeroPivots()

template<typename _MatrixType >
Index Eigen::CompleteOrthogonalDecomposition< _MatrixType >::nonzeroPivots ( ) const
inline
Returns
the number of nonzero pivots in the complete orthogonal decomposition. Here nonzero is meant in the exact sense, not in a fuzzy sense. So that notion isn't really intrinsically interesting, but it is still useful when implementing algorithms.
See also
rank()
348{ return m_cpqr.nonzeroPivots(); }
Index nonzeroPivots() const
Definition ColPivHouseholderQR.h:394

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::nonzeroPivots().

+ Here is the call graph for this function:

◆ pseudoInverse()

template<typename _MatrixType >
const Inverse< CompleteOrthogonalDecomposition > Eigen::CompleteOrthogonalDecomposition< _MatrixType >::pseudoInverse ( ) const
inline
Returns
the pseudo-inverse of the matrix of which *this is the complete orthogonal decomposition.
Warning
: Do not compute this->pseudoInverse()*rhs to solve a linear systems. It is more efficient and numerically stable to call this->solve(rhs).
277 {
278 return Inverse<CompleteOrthogonalDecomposition>(*this);
279 }

◆ rank()

template<typename _MatrixType >
Index Eigen::CompleteOrthogonalDecomposition< _MatrixType >::rank ( ) const
inline
Returns
the rank of the matrix of which *this is the complete orthogonal decomposition.
Note
This method has to determine which pivots should be considered nonzero. For that, it uses the threshold value that you can control by calling setThreshold(const RealScalar&).
233{ return m_cpqr.rank(); }

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::rank().

+ Here is the call graph for this function:

◆ rows()

template<typename _MatrixType >
Index Eigen::CompleteOrthogonalDecomposition< _MatrixType >::rows ( ) const
inline
281{ return m_cpqr.rows(); }

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::rows().

+ Here is the call graph for this function:

◆ setThreshold() [1/2]

template<typename _MatrixType >
CompleteOrthogonalDecomposition & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::setThreshold ( const RealScalar threshold)
inline

Allows to prescribe a threshold to be used by certain methods, such as rank(), who need to determine when pivots are to be considered nonzero. Most be called before calling compute().

When it needs to get the threshold value, Eigen calls threshold(). By default, this uses a formula to automatically determine a reasonable threshold. Once you have called the present method setThreshold(const RealScalar&), your value is used instead.

Parameters
thresholdThe new value to use as the threshold.

A pivot will be considered nonzero if its absolute value is strictly greater than $ \vert pivot \vert \leqslant threshold \times \vert maxpivot \vert $ where maxpivot is the biggest pivot.

If you want to come back to the default behavior, call setThreshold(Default_t)

317 {
319 return *this;
320 }
ColPivHouseholderQR & setThreshold(const RealScalar &threshold)
Definition ColPivHouseholderQR.h:353
RealScalar threshold() const
Definition CompleteOrthogonalDecomposition.h:339

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, Eigen::ColPivHouseholderQR< _MatrixType >::setThreshold(), and Eigen::CompleteOrthogonalDecomposition< _MatrixType >::threshold().

+ Here is the call graph for this function:

◆ setThreshold() [2/2]

template<typename _MatrixType >
CompleteOrthogonalDecomposition & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::setThreshold ( Default_t  )
inline

Allows to come back to the default behavior, letting Eigen use its default formula for determining the threshold.

You should pass the special object Eigen::Default as parameter here.

qr.setThreshold(Eigen::Default);

See the documentation of setThreshold(const RealScalar&).

330 {
332 return *this;
333 }

References Eigen::Default, Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::setThreshold().

+ Here is the call graph for this function:

◆ solve()

template<typename _MatrixType >
template<typename Rhs >
const Solve< CompleteOrthogonalDecomposition, Rhs > Eigen::CompleteOrthogonalDecomposition< _MatrixType >::solve ( const MatrixBase< Rhs > &  b) const
inline

This method computes the minimum-norm solution X to a least squares problem

\[\mathrm{minimize} \|A X - B\|, \]

where A is the matrix of which *this is the complete orthogonal decomposition.

Parameters
bthe right-hand sides of the problem to solve.
Returns
a solution.
148 {
150 "CompleteOrthogonalDecomposition is not initialized.");
151 return Solve<CompleteOrthogonalDecomposition, Rhs>(*this, b.derived());
152 }

References eigen_assert, Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::m_isInitialized.

◆ threshold()

template<typename _MatrixType >
RealScalar Eigen::CompleteOrthogonalDecomposition< _MatrixType >::threshold ( ) const
inline

Returns the threshold that will be used by certain methods such as rank().

See the documentation of setThreshold(const RealScalar&).

339{ return m_cpqr.threshold(); }
RealScalar threshold() const
Definition ColPivHouseholderQR.h:378

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr, and Eigen::ColPivHouseholderQR< _MatrixType >::threshold().

Referenced by Eigen::CompleteOrthogonalDecomposition< _MatrixType >::setThreshold().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ zCoeffs()

template<typename _MatrixType >
const HCoeffsType & Eigen::CompleteOrthogonalDecomposition< _MatrixType >::zCoeffs ( ) const
inline
Returns
a const reference to the vector of Householder coefficients used to represent the factor Z.

For advanced uses only.

296{ return m_zCoeffs; }

References Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_zCoeffs.

Member Data Documentation

◆ m_cpqr

template<typename _MatrixType >
ColPivHouseholderQR<MatrixType> Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_cpqr
protected

◆ m_temp

template<typename _MatrixType >
RowVectorType Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_temp
protected

◆ m_zCoeffs

template<typename _MatrixType >
HCoeffsType Eigen::CompleteOrthogonalDecomposition< _MatrixType >::m_zCoeffs
protected

The documentation for this class was generated from the following files: