![]() |
|
LU decomposition of a matrix with complete pivoting, and related features. More...
#include <FullPivLU.h>
Public Member Functions | |
FullPivLU () | |
Default Constructor. More... | |
FullPivLU (Index rows, Index cols) | |
Default Constructor with memory preallocation. More... | |
template<typename InputType > | |
FullPivLU (const EigenBase< InputType > &matrix) | |
template<typename InputType > | |
FullPivLU (EigenBase< InputType > &matrix) | |
Constructs a LU factorization from a given matrix. More... | |
template<typename InputType > | |
FullPivLU & | compute (const EigenBase< InputType > &matrix) |
const MatrixType & | matrixLU () const |
Index | nonzeroPivots () const |
RealScalar | maxPivot () const |
EIGEN_DEVICE_FUNC const PermutationPType & | permutationP () const |
const PermutationQType & | permutationQ () const |
const internal::kernel_retval< FullPivLU > | kernel () const |
const internal::image_retval< FullPivLU > | image (const MatrixType &originalMatrix) const |
RealScalar | rcond () const |
internal::traits< MatrixType >::Scalar | determinant () const |
FullPivLU & | setThreshold (const RealScalar &threshold) |
FullPivLU & | setThreshold (Default_t) |
RealScalar | threshold () const |
Index | rank () const |
Index | dimensionOfKernel () const |
bool | isInjective () const |
bool | isSurjective () const |
bool | isInvertible () const |
const Inverse< FullPivLU > | inverse () const |
MatrixType | reconstructedMatrix () const |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
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 |
![]() | |
SolverBase () | |
~SolverBase () | |
const Solve< FullPivLU< MatrixType_, PermutationIndex_ >, Rhs > | solve (const MatrixBase< Rhs > &b) const |
const ConstTransposeReturnType | transpose () const |
const AdjointReturnType | adjoint () const |
constexpr EIGEN_DEVICE_FUNC FullPivLU< MatrixType_, PermutationIndex_ > & | derived () |
constexpr EIGEN_DEVICE_FUNC const FullPivLU< 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 |
Protected Member Functions | |
void | computeInPlace () |
![]() | |
void | _check_solve_assertion (const Rhs &b) const |
Friends | |
class | SolverBase< FullPivLU > |
LU decomposition of a matrix with complete pivoting, and related features.
MatrixType_ | the type of the matrix of which we are computing the LU decomposition |
This class represents a LU decomposition of any matrix, with complete pivoting: the matrix A is decomposed as \( A = P^{-1} L U Q^{-1} \) where L is unit-lower-triangular, U is upper-triangular, and P and Q are permutation matrices. This is a rank-revealing LU decomposition. The eigenvalues (diagonal coefficients) of U are sorted in such a way that any zeros are at the end.
This decomposition provides the generic approach to solving systems of linear equations, computing the rank, invertibility, inverse, kernel, and determinant.
This LU decomposition is very stable and well tested with large matrices. However there are use cases where the SVD decomposition is inherently more stable and/or flexible. For example, when computing the kernel of a matrix, working with the SVD allows to select the smallest singular values of the matrix, something that the LU decomposition doesn't see.
The data of the LU decomposition can be directly accessed through the methods matrixLU(), permutationP(), permutationQ().
As an example, here is how the original matrix can be retrieved:
Output:
This class supports the inplace decomposition mechanism.
typedef SolverBase<FullPivLU> Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::Base |
typedef internal::plain_col_type<MatrixType, PermutationIndex>::type Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::IntColVectorType |
typedef internal::plain_row_type<MatrixType, PermutationIndex>::type Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::IntRowVectorType |
typedef MatrixType_ Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::MatrixType |
using Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::PermutationIndex = PermutationIndex_ |
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::PermutationPType |
typedef PermutationMatrix<ColsAtCompileTime, MaxColsAtCompileTime, PermutationIndex> Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::PermutationQType |
typedef MatrixType::PlainObject Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::PlainObject |
anonymous enum |
Eigen::FullPivLU< MatrixType, PermutationIndex >::FullPivLU |
Default Constructor.
The default constructor is useful in cases in which the user intends to perform decompositions via LU::compute(const MatrixType&).
Eigen::FullPivLU< MatrixType, PermutationIndex >::FullPivLU | ( | Index | rows, |
Index | cols | ||
) |
Default Constructor with memory preallocation.
Like the default constructor but with preallocation of the internal data according to the specified problem size.
|
explicit |
Constructor.
matrix | the matrix of which to compute the LU decomposition. It is required to be nonzero. |
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::compute(), and matrix().
|
explicit |
Constructs a LU factorization from a given matrix.
This overloaded constructor is provided for inplace decomposition when MatrixType
is a Eigen::Ref.
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::computeInPlace().
void Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::_solve_impl | ( | const RhsType & | rhs, |
DstType & | dst | ||
) | const |
References calibrate::c, cols, i, min, and rows.
void Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::_solve_impl_transposed | ( | const RhsType & | rhs, |
DstType & | dst | ||
) | const |
References calibrate::c, cols, i, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::indices(), Eigen::PermutationBase< Derived >::inverse(), min, and rows.
|
inline |
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu.
Referenced by gdb.printers._MatrixEntryIterator::__next__(), gdb.printers.EigenMatrixPrinter::children(), gdb.printers.EigenSparseMatrixPrinter::children(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::dimensionOfKernel(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isInjective(), gdb.printers.EigenMatrixPrinter::to_string(), and gdb.printers.EigenSparseMatrixPrinter::to_string().
|
inline |
Computes the LU decomposition of the given matrix.
matrix | the matrix of which to compute the LU decomposition. It is required to be nonzero. |
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::computeInPlace(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu, and matrix().
Referenced by ctms_decompositions(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::FullPivLU(), Eigen::internal::idrs(), and Eigen::internal::idrstabl().
|
protected |
References cols, eigen_assert, i, Eigen::numext::is_exactly_zero(), k, rows, and size.
Referenced by Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::compute(), and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::FullPivLU().
internal::traits< MatrixType >::Scalar Eigen::FullPivLU< MatrixType, PermutationIndex >::determinant |
References eigen_assert.
|
inline |
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::cols(), eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rank().
|
inline |
originalMatrix | the original matrix, of which *this is the LU decomposition. The reason why it is needed to pass it here, is that this allows a large optimization, as otherwise this method would need to reconstruct it from the LU decomposition. |
Example:
Output:
References eigen_assert, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized.
Referenced by main().
|
inline |
References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu.
|
inline |
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::cols(), eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rank().
Referenced by Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isInvertible().
|
inline |
References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isInjective(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu.
Referenced by inverse_general_4x4().
|
inline |
References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rank(), and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rows().
|
inline |
Example:
Output:
References eigen_assert, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized.
Referenced by main().
|
inline |
References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu.
|
inline |
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_maxpivot.
|
inline |
References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_nonzero_pivots.
|
inline |
References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_p.
|
inline |
References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_q.
|
inline |
References abs(), eigen_assert, i, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_maxpivot, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_nonzero_pivots, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::threshold().
Referenced by Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::dimensionOfKernel(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isInjective(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isSurjective(), and main().
|
inline |
*this
is the LU decomposition. References eigen_assert, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_l1_norm, and Eigen::internal::rcond_estimate_helper().
MatrixType Eigen::FullPivLU< MatrixType, PermutationIndex >::reconstructedMatrix |
References eigen_assert, min, and res.
|
inline |
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu.
Referenced by gdb.printers._MatrixEntryIterator::__next__(), gdb.printers.EigenMatrixPrinter::children(), gdb.printers.EigenSparseMatrixPrinter::children(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isSurjective(), gdb.printers.EigenMatrixPrinter::to_string(), and gdb.printers.EigenSparseMatrixPrinter::to_string().
|
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. This is not used for the LU 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.
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)
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_prescribedThreshold, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_usePrescribedThreshold, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::threshold().
|
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.
See the documentation of setThreshold(const RealScalar&).
References Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_usePrescribedThreshold.
|
inline |
Returns the threshold that will be used by certain methods such as rank().
See the documentation of setThreshold(const RealScalar&).
References eigen_assert, oomph::SarahBL::epsilon, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_isInitialized, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_lu, Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_prescribedThreshold, and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::m_usePrescribedThreshold.
Referenced by Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rank(), and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::setThreshold().
|
friend |
|
protected |
|
protected |
|
protected |
Referenced by Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::dimensionOfKernel(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::image(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::inverse(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isInjective(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isInvertible(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isSurjective(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::kernel(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::matrixLU(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::nonzeroPivots(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::permutationP(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::permutationQ(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rank(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rcond(), and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::threshold().
|
protected |
Referenced by Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rcond().
|
protected |
Referenced by Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::cols(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::compute(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::inverse(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::isInvertible(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::matrixLU(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rank(), Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::rows(), and Eigen::FullPivLU< MatrixType_, PermutationIndex_ >::threshold().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |