|
enum | { MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime
, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
} |
|
typedef MatrixType_ | MatrixType |
|
typedef SolverBase< FullPivHouseholderQR > | Base |
|
typedef PermutationIndex_ | PermutationIndex |
|
typedef internal::FullPivHouseholderQRMatrixQReturnType< MatrixType, PermutationIndex > | MatrixQReturnType |
|
typedef internal::plain_diag_type< MatrixType >::type | HCoeffsType |
|
typedef Matrix< PermutationIndex, 1, internal::min_size_prefer_dynamic(ColsAtCompileTime, RowsAtCompileTime), RowMajor, 1, internal::min_size_prefer_fixed(MaxColsAtCompileTime, MaxRowsAtCompileTime)> | IntDiagSizeVectorType |
|
typedef PermutationMatrix< ColsAtCompileTime, MaxColsAtCompileTime, PermutationIndex > | PermutationType |
|
typedef internal::plain_row_type< MatrixType >::type | RowVectorType |
|
typedef internal::plain_col_type< MatrixType >::type | ColVectorType |
|
typedef MatrixType::PlainObject | PlainObject |
|
enum | |
|
typedef EigenBase< FullPivHouseholderQR< MatrixType_, PermutationIndex_ > > | Base |
|
typedef internal::traits< FullPivHouseholderQR< MatrixType_, PermutationIndex_ > >::Scalar | Scalar |
|
typedef Scalar | CoeffReturnType |
|
typedef Transpose< const FullPivHouseholderQR< MatrixType_, PermutationIndex_ > > | ConstTransposeReturnType |
|
typedef std::conditional_t< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, const ConstTransposeReturnType >, const ConstTransposeReturnType > | AdjointReturnType |
|
typedef Eigen::Index | Index |
| The interface type of indices. More...
|
|
typedef internal::traits< Derived >::StorageKind | StorageKind |
|
|
| FullPivHouseholderQR () |
| Default Constructor. More...
|
|
| FullPivHouseholderQR (Index rows, Index cols) |
| Default Constructor with memory preallocation. More...
|
|
template<typename InputType > |
| FullPivHouseholderQR (const EigenBase< InputType > &matrix) |
| Constructs a QR factorization from a given matrix. More...
|
|
template<typename InputType > |
| FullPivHouseholderQR (EigenBase< InputType > &matrix) |
| Constructs a QR factorization from a given matrix. More...
|
|
MatrixQReturnType | matrixQ (void) const |
|
const MatrixType & | matrixQR () const |
|
template<typename InputType > |
FullPivHouseholderQR & | compute (const EigenBase< InputType > &matrix) |
|
const PermutationType & | colsPermutation () const |
|
const IntDiagSizeVectorType & | rowsTranspositions () const |
|
MatrixType::Scalar | determinant () const |
|
MatrixType::RealScalar | absDeterminant () const |
|
MatrixType::RealScalar | logAbsDeterminant () const |
|
MatrixType::Scalar | signDeterminant () const |
|
Index | rank () const |
|
Index | dimensionOfKernel () const |
|
bool | isInjective () const |
|
bool | isSurjective () const |
|
bool | isInvertible () const |
|
const Inverse< FullPivHouseholderQR > | inverse () const |
|
Index | rows () const |
|
Index | cols () const |
|
const HCoeffsType & | hCoeffs () const |
|
FullPivHouseholderQR & | setThreshold (const RealScalar &threshold) |
|
FullPivHouseholderQR & | setThreshold (Default_t) |
|
RealScalar | threshold () const |
|
Index | nonzeroPivots () const |
|
RealScalar | maxPivot () const |
|
template<typename RhsType , typename DstType > |
void | _solve_impl (const RhsType &rhs, DstType &dst) const |
|
template<bool Conjugate, typename RhsType , typename DstType > |
void | _solve_impl_transposed (const RhsType &rhs, DstType &dst) const |
|
template<typename InputType > |
FullPivHouseholderQR< MatrixType, PermutationIndex > & | compute (const EigenBase< InputType > &matrix) |
|
| SolverBase () |
|
| ~SolverBase () |
|
const Solve< FullPivHouseholderQR< MatrixType_, PermutationIndex_ >, Rhs > | solve (const MatrixBase< Rhs > &b) const |
|
const ConstTransposeReturnType | transpose () const |
|
const AdjointReturnType | adjoint () const |
|
constexpr EIGEN_DEVICE_FUNC FullPivHouseholderQR< MatrixType_, PermutationIndex_ > & | derived () |
|
constexpr EIGEN_DEVICE_FUNC const FullPivHouseholderQR< MatrixType_, PermutationIndex_ > & | derived () const |
|
constexpr EIGEN_DEVICE_FUNC Derived & | derived () |
|
constexpr EIGEN_DEVICE_FUNC const Derived & | derived () const |
|
EIGEN_DEVICE_FUNC Derived & | const_cast_derived () const |
|
EIGEN_DEVICE_FUNC const Derived & | const_derived () const |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
|
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | evalTo (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | addTo (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | subTo (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | applyThisOnTheRight (Dest &dst) const |
|
template<typename Dest > |
EIGEN_DEVICE_FUNC void | applyThisOnTheLeft (Dest &dst) const |
|
template<typename Device > |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< Derived, Device > | device (Device &device) |
|
template<typename Device > |
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE DeviceWrapper< const Derived, Device > | device (Device &device) const |
|
template<typename MatrixType_, typename PermutationIndex_>
class Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >
Householder rank-revealing QR decomposition of a matrix with full pivoting.
- Template Parameters
-
MatrixType_ | the type of the matrix of which we are computing the QR decomposition |
This class performs a rank-revealing QR decomposition of a matrix A into matrices P, P', Q and R such that
\[ \mathbf{P} \, \mathbf{A} \, \mathbf{P}' = \mathbf{Q} \, \mathbf{R} \]
by using Householder transformations. Here, P and P' are permutation matrices, Q a unitary matrix and R an upper triangular matrix.
This decomposition performs a very prudent full pivoting in order to be rank-revealing and achieve optimal numerical stability. The trade-off is that it is slower than HouseholderQR and ColPivHouseholderQR.
This class supports the inplace decomposition mechanism.
- See also
- MatrixBase::fullPivHouseholderQr()
template<typename MatrixType_ , typename PermutationIndex_ >
template<typename RhsType , typename DstType >
574 typename RhsType::PlainObject
c(rhs);
576 Matrix<typename RhsType::Scalar, 1, RhsType::ColsAtCompileTime> temp(rhs.cols());
577 for (
Index k = 0;
k < l_rank; ++
k) {
580 c.bottomRightCorner(remainingSize, rhs.cols())
581 .applyHouseholderOnTheLeft(
m_qr.col(
k).tail(remainingSize - 1),
m_hCoeffs.coeff(
k), &temp.coeffRef(0));
584 m_qr.topLeftCorner(l_rank, l_rank).template triangularView<Upper>().solveInPlace(
c.topRows(l_rank));
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Index rank() const
Definition: FullPivHouseholderQR.h:271
const IndicesType & indices() const
Definition: PermutationMatrix.h:334
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE const Scalar & coeff(Index rowId, Index colId) const
Definition: PlainObjectBase.h:198
char char char int int * k
Definition: level2_impl.h:374
int c
Definition: calibrate.py:100
Eigen::Index Index
The interface type of indices.
Definition: EigenBase.h:43
References calibrate::c, Eigen::PlainObjectBase< Derived >::coeff(), Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::coeffRef(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::cols(), i, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::indices(), k, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_cols_permutation, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_hCoeffs, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_qr, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_rows_transpositions, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::rank(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::rows(), and setZero().
template<typename MatrixType_ , typename PermutationIndex_ >
template<bool Conjugate, typename RhsType , typename DstType >
void Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::_solve_impl_transposed |
( |
const RhsType & |
rhs, |
|
|
DstType & |
dst |
|
) |
| const |
603 m_qr.topLeftCorner(l_rank, l_rank)
604 .template triangularView<Upper>()
606 .template conjugateIf<Conjugate>()
607 .solveInPlace(
c.topRows(l_rank));
609 dst.topRows(l_rank) =
c.topRows(l_rank);
610 dst.bottomRows(
rows() - l_rank).setZero();
612 Matrix<Scalar, 1, DstType::ColsAtCompileTime> temp(dst.cols());
617 dst.bottomRightCorner(remainingSize, dst.cols())
618 .applyHouseholderOnTheLeft(
m_qr.col(
k).tail(remainingSize - 1).template conjugateIf<!Conjugate>(),
619 m_hCoeffs.template conjugateIf<Conjugate>().coeff(
k), &temp.coeffRef(0));
InverseReturnType transpose() const
Definition: PermutationMatrix.h:177
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index size() const EIGEN_NOEXCEPT
Definition: EigenBase.h:64
References calibrate::c, Eigen::PlainObjectBase< Derived >::coeff(), Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::coeffRef(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::cols(), k, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_cols_permutation, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_hCoeffs, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_qr, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_rows_transpositions, min, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::rank(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::rows(), Eigen::EigenBase< Derived >::size(), and Eigen::PermutationBase< Derived >::transpose().
template<typename MatrixType , typename PermutationIndex >
500 Index number_of_transpositions = 0;
508 Index row_of_biggest_in_corner, col_of_biggest_in_corner;
509 typedef internal::scalar_score_coeff_op<Scalar> Scoring;
510 typedef typename Scoring::result_type Score;
513 .unaryExpr(Scoring())
514 .maxCoeff(&row_of_biggest_in_corner, &col_of_biggest_in_corner);
515 row_of_biggest_in_corner +=
k;
516 col_of_biggest_in_corner +=
k;
518 internal::abs_knowing_score<Scalar>()(
m_qr(row_of_biggest_in_corner, col_of_biggest_in_corner), score);
519 if (
k == 0) biggest = biggest_in_corner;
534 if (
k != row_of_biggest_in_corner) {
536 ++number_of_transpositions;
538 if (
k != col_of_biggest_in_corner) {
539 m_qr.col(
k).swap(
m_qr.col(col_of_biggest_in_corner));
540 ++number_of_transpositions;
557 m_det_p = (number_of_transpositions % 2) ? -1 : 1;
Index m_det_p
Definition: FullPivHouseholderQR.h:433
RealScalar m_precision
Definition: FullPivHouseholderQR.h:432
Index m_nonzero_pivots
Definition: FullPivHouseholderQR.h:431
RealScalar m_maxpivot
Definition: FullPivHouseholderQR.h:430
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE Scalar & coeffRef(Index rowId, Index colId)
Definition: PlainObjectBase.h:217
Derived & applyTranspositionOnTheRight(Index i, Index j)
Definition: PermutationMatrix.h:162
void setIdentity()
Definition: PermutationMatrix.h:122
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:294
internal::traits< FullPivHouseholderQR< MatrixType_, PermutationIndex_ > >::Scalar Scalar
Definition: SolverBase.h:75
Scalar beta
Definition: level2_cplx_impl.h:36
EIGEN_DEVICE_FUNC bool isMuchSmallerThan(const Scalar &x, const OtherScalar &y, const typename NumTraits< Scalar >::Real &precision=NumTraits< Scalar >::dummy_precision())
Definition: MathFunctions.h:1916
double epsilon
Definition: osc_ring_sarah_asymptotics.h:43
References abs(), Eigen::PermutationBase< Derived >::applyTranspositionOnTheRight(), beta, Eigen::PlainObjectBase< Derived >::coeff(), Eigen::Matrix< Scalar_, Rows_, Cols_, Options_, MaxRows_, MaxCols_ >::coeffRef(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::cols(), eigen_assert, oomph::SarahBL::epsilon, i, Eigen::internal::isMuchSmallerThan(), k, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_cols_permutation, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_cols_transpositions, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_det_p, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_hCoeffs, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_isInitialized, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_maxpivot, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_nonzero_pivots, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_precision, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_qr, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_rows_transpositions, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_temp, min, Eigen::PlainObjectBase< Derived >::resize(), Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::rows(), Eigen::PermutationBase< Derived >::setIdentity(), and Eigen::EigenBase< Derived >::size().
Referenced by Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::compute(), and Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::FullPivHouseholderQR().
template<typename MatrixType_ , typename PermutationIndex_ >
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. This is not used for the QR decomposition itself.
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
-
threshold | The 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)
RealScalar m_prescribedThreshold
Definition: FullPivHouseholderQR.h:430
References Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_prescribedThreshold, Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::m_usePrescribedThreshold, and Eigen::FullPivHouseholderQR< MatrixType_, PermutationIndex_ >::threshold().