LU decomposition of a matrix with complete pivoting, and related features. More...
#include <ForwardDeclarations.h>
Public Member Functions | |
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 |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
template<typename InputType > | |
FullPivLU & | compute (const EigenBase< InputType > &matrix) |
internal::traits< MatrixType >::Scalar | determinant () const |
Index | dimensionOfKernel () const |
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... | |
const internal::image_retval< FullPivLU > | image (const MatrixType &originalMatrix) const |
const Inverse< FullPivLU > | inverse () const |
bool | isInjective () const |
bool | isInvertible () const |
bool | isSurjective () const |
const internal::kernel_retval< FullPivLU > | kernel () const |
const MatrixType & | matrixLU () const |
RealScalar | maxPivot () const |
Index | nonzeroPivots () const |
EIGEN_DEVICE_FUNC const PermutationPType & | permutationP () const |
const PermutationQType & | permutationQ () const |
Index | rank () const |
RealScalar | rcond () const |
MatrixType | reconstructedMatrix () const |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
FullPivLU & | setThreshold (const RealScalar &threshold) |
FullPivLU & | setThreshold (Default_t) |
RealScalar | threshold () const |
Public Member Functions inherited from Eigen::SolverBase< FullPivLU< _MatrixType > > | |
AdjointReturnType | adjoint () const |
const Solve< FullPivLU< _MatrixType >, Rhs > | solve (const MatrixBase< Rhs > &b) const |
SolverBase () | |
ConstTransposeReturnType | transpose () const |
~SolverBase () | |
Public Member Functions inherited from Eigen::EigenBase< Derived > | |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | addTo (Dest &dst) const |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | applyThisOnTheLeft (Dest &dst) const |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | applyThisOnTheRight (Dest &dst) const |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
EIGEN_DEVICE_FUNC Derived & | const_cast_derived () const |
EIGEN_DEVICE_FUNC const Derived & | const_derived () const |
EIGEN_DEVICE_FUNC Derived & | derived () |
EIGEN_DEVICE_FUNC const Derived & | derived () const |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | evalTo (Dest &dst) const |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
template<typename Dest > | |
EIGEN_DEVICE_FUNC void | subTo (Dest &dst) const |
Protected Member Functions | |
void | computeInPlace () |
Protected Member Functions inherited from Eigen::SolverBase< FullPivLU< _MatrixType > > | |
void | _check_solve_assertion (const Rhs &b) const |
Static Protected Member Functions | |
static void | check_template_parameters () |
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 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.
Definition at line 268 of file ForwardDeclarations.h.
typedef SolverBase<FullPivLU> Eigen::FullPivLU< _MatrixType >::Base |
Definition at line 65 of file FullPivLU.h.
typedef internal::plain_col_type<MatrixType, StorageIndex>::type Eigen::FullPivLU< _MatrixType >::IntColVectorType |
Definition at line 74 of file FullPivLU.h.
typedef internal::plain_row_type<MatrixType, StorageIndex>::type Eigen::FullPivLU< _MatrixType >::IntRowVectorType |
Definition at line 73 of file FullPivLU.h.
typedef _MatrixType Eigen::FullPivLU< _MatrixType >::MatrixType |
Definition at line 64 of file FullPivLU.h.
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> Eigen::FullPivLU< _MatrixType >::PermutationPType |
Definition at line 76 of file FullPivLU.h.
typedef PermutationMatrix<ColsAtCompileTime, MaxColsAtCompileTime> Eigen::FullPivLU< _MatrixType >::PermutationQType |
Definition at line 75 of file FullPivLU.h.
typedef MatrixType::PlainObject Eigen::FullPivLU< _MatrixType >::PlainObject |
Definition at line 77 of file FullPivLU.h.
anonymous enum |
Enumerator | |
---|---|
MaxRowsAtCompileTime | |
MaxColsAtCompileTime |
Definition at line 69 of file FullPivLU.h.
Eigen::FullPivLU< MatrixType >::FullPivLU | ( | ) |
Default Constructor.
The default constructor is useful in cases in which the user intends to perform decompositions via LU::compute(const MatrixType&).
Definition at line 442 of file FullPivLU.h.
Eigen::FullPivLU< MatrixType >::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.
Definition at line 448 of file FullPivLU.h.
|
explicit |
Constructor.
matrix | the matrix of which to compute the LU decomposition. It is required to be nonzero. |
Definition at line 461 of file FullPivLU.h.
|
explicit |
Constructs a LU factorization from a given matrix.
This overloaded constructor is provided for inplace decomposition when MatrixType
is a Eigen::Ref.
Definition at line 475 of file FullPivLU.h.
void Eigen::FullPivLU< _MatrixType >::_solve_impl | ( | const RhsType & | rhs, |
DstType & | dst | ||
) | const |
Definition at line 745 of file FullPivLU.h.
void Eigen::FullPivLU< _MatrixType >::_solve_impl_transposed | ( | const RhsType & | rhs, |
DstType & | dst | ||
) | const |
Definition at line 792 of file FullPivLU.h.
|
inlinestaticprotected |
Definition at line 422 of file FullPivLU.h.
|
inline |
Definition at line 410 of file FullPivLU.h.
|
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. |
Definition at line 120 of file FullPivLU.h.
|
protected |
Definition at line 488 of file FullPivLU.h.
internal::traits< MatrixType >::Scalar Eigen::FullPivLU< MatrixType >::determinant | ( | ) | const |
Definition at line 581 of file FullPivLU.h.
|
inline |
Definition at line 347 of file FullPivLU.h.
|
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:
Definition at line 216 of file FullPivLU.h.
|
inline |
Definition at line 398 of file FullPivLU.h.
|
inline |
Definition at line 360 of file FullPivLU.h.
|
inline |
Definition at line 385 of file FullPivLU.h.
|
inline |
Definition at line 373 of file FullPivLU.h.
|
inline |
Example:
Output:
Definition at line 190 of file FullPivLU.h.
|
inline |
Definition at line 132 of file FullPivLU.h.
|
inline |
Definition at line 154 of file FullPivLU.h.
|
inline |
Definition at line 145 of file FullPivLU.h.
|
inline |
|
inline |
|
inline |
Definition at line 330 of file FullPivLU.h.
|
inline |
*this
is the LU decomposition. Definition at line 250 of file FullPivLU.h.
MatrixType Eigen::FullPivLU< MatrixType >::reconstructedMatrix | ( | ) | const |
Definition at line 592 of file FullPivLU.h.
|
inline |
Definition at line 408 of file FullPivLU.h.
|
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 where maxpivot is the biggest pivot.
If you want to come back to the default behavior, call setThreshold(Default_t)
Definition at line 290 of file FullPivLU.h.
|
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&).
Definition at line 305 of file FullPivLU.h.
|
inline |
Returns the threshold that will be used by certain methods such as rank().
See the documentation of setThreshold(const RealScalar&).
Definition at line 315 of file FullPivLU.h.
|
friend |
Definition at line 66 of file FullPivLU.h.
|
protected |
Definition at line 433 of file FullPivLU.h.
|
protected |
Definition at line 437 of file FullPivLU.h.
|
protected |
Definition at line 438 of file FullPivLU.h.
|
protected |
Definition at line 435 of file FullPivLU.h.
|
protected |
Definition at line 429 of file FullPivLU.h.
|
protected |
Definition at line 436 of file FullPivLU.h.
|
protected |
Definition at line 434 of file FullPivLU.h.
|
protected |
Definition at line 430 of file FullPivLU.h.
|
protected |
Definition at line 436 of file FullPivLU.h.
|
protected |
Definition at line 431 of file FullPivLU.h.
|
protected |
Definition at line 432 of file FullPivLU.h.
|
protected |
Definition at line 438 of file FullPivLU.h.