LU decomposition of a matrix with complete pivoting, and related features. More...
#include <FullPivLU.h>
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 exemple, here is how the original matrix can be retrieved:
Output:
Definition at line 46 of file FullPivLU.h.
typedef MatrixType::Index Eigen::FullPivLU< _MatrixType >::Index |
Definition at line 60 of file FullPivLU.h.
typedef internal::plain_col_type<MatrixType, Index>::type Eigen::FullPivLU< _MatrixType >::IntColVectorType |
Reimplemented in Eigen::LU< MatrixType >.
Definition at line 62 of file FullPivLU.h.
typedef internal::plain_row_type<MatrixType, Index>::type Eigen::FullPivLU< _MatrixType >::IntRowVectorType |
Reimplemented in Eigen::LU< MatrixType >.
Definition at line 61 of file FullPivLU.h.
typedef _MatrixType Eigen::FullPivLU< _MatrixType >::MatrixType |
Definition at line 49 of file FullPivLU.h.
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> Eigen::FullPivLU< _MatrixType >::PermutationPType |
Definition at line 64 of file FullPivLU.h.
typedef PermutationMatrix<ColsAtCompileTime, MaxColsAtCompileTime> Eigen::FullPivLU< _MatrixType >::PermutationQType |
Definition at line 63 of file FullPivLU.h.
typedef NumTraits<typename MatrixType::Scalar>::Real Eigen::FullPivLU< _MatrixType >::RealScalar |
Reimplemented in Eigen::LU< MatrixType >.
Definition at line 58 of file FullPivLU.h.
typedef MatrixType::Scalar Eigen::FullPivLU< _MatrixType >::Scalar |
Reimplemented in Eigen::LU< MatrixType >.
Definition at line 57 of file FullPivLU.h.
typedef internal::traits<MatrixType>::StorageKind Eigen::FullPivLU< _MatrixType >::StorageKind |
Definition at line 59 of file FullPivLU.h.
anonymous enum |
Definition at line 50 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 394 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 400 of file FullPivLU.h.
Eigen::FullPivLU< MatrixType >::FullPivLU | ( | const MatrixType & | matrix | ) |
Constructor.
matrix | the matrix of which to compute the LU decomposition. It is required to be nonzero. |
Definition at line 412 of file FullPivLU.h.
static void Eigen::FullPivLU< _MatrixType >::check_template_parameters | ( | ) | [inline, static, protected] |
Definition at line 378 of file FullPivLU.h.
Index Eigen::FullPivLU< _MatrixType >::cols | ( | void | ) | const [inline] |
Definition at line 374 of file FullPivLU.h.
FullPivLU< MatrixType > & Eigen::FullPivLU< MatrixType >::compute | ( | const MatrixType & | matrix | ) |
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 425 of file FullPivLU.h.
internal::traits< MatrixType >::Scalar Eigen::FullPivLU< MatrixType >::determinant | ( | ) | const |
Definition at line 515 of file FullPivLU.h.
Index Eigen::FullPivLU< _MatrixType >::dimensionOfKernel | ( | ) | const [inline] |
Definition at line 312 of file FullPivLU.h.
const internal::image_retval<FullPivLU> Eigen::FullPivLU< _MatrixType >::image | ( | const MatrixType & | originalMatrix | ) | const [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 188 of file FullPivLU.h.
const internal::solve_retval<FullPivLU,typename MatrixType::IdentityReturnType> Eigen::FullPivLU< _MatrixType >::inverse | ( | void | ) | const [inline] |
Definition at line 363 of file FullPivLU.h.
bool Eigen::FullPivLU< _MatrixType >::isInjective | ( | ) | const [inline] |
Definition at line 325 of file FullPivLU.h.
bool Eigen::FullPivLU< _MatrixType >::isInvertible | ( | ) | const [inline] |
Definition at line 350 of file FullPivLU.h.
bool Eigen::FullPivLU< _MatrixType >::isSurjective | ( | ) | const [inline] |
Definition at line 338 of file FullPivLU.h.
const internal::kernel_retval<FullPivLU> Eigen::FullPivLU< _MatrixType >::kernel | ( | ) | const [inline] |
Example:
Output:
Definition at line 162 of file FullPivLU.h.
const MatrixType& Eigen::FullPivLU< _MatrixType >::matrixLU | ( | ) | const [inline] |
Definition at line 104 of file FullPivLU.h.
RealScalar Eigen::FullPivLU< _MatrixType >::maxPivot | ( | ) | const [inline] |
Definition at line 126 of file FullPivLU.h.
Index Eigen::FullPivLU< _MatrixType >::nonzeroPivots | ( | ) | const [inline] |
Definition at line 117 of file FullPivLU.h.
const PermutationPType& Eigen::FullPivLU< _MatrixType >::permutationP | ( | ) | const [inline] |
Definition at line 132 of file FullPivLU.h.
const PermutationQType& Eigen::FullPivLU< _MatrixType >::permutationQ | ( | ) | const [inline] |
Definition at line 142 of file FullPivLU.h.
Index Eigen::FullPivLU< _MatrixType >::rank | ( | ) | const [inline] |
Definition at line 295 of file FullPivLU.h.
MatrixType Eigen::FullPivLU< MatrixType >::reconstructedMatrix | ( | ) | const |
Definition at line 526 of file FullPivLU.h.
Index Eigen::FullPivLU< _MatrixType >::rows | ( | void | ) | const [inline] |
Definition at line 373 of file FullPivLU.h.
FullPivLU& Eigen::FullPivLU< _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. 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 255 of file FullPivLU.h.
FullPivLU& Eigen::FullPivLU< _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.
lu.setThreshold(Eigen::Default);
See the documentation of setThreshold(const RealScalar&).
Definition at line 270 of file FullPivLU.h.
const internal::solve_retval<FullPivLU, Rhs> Eigen::FullPivLU< _MatrixType >::solve | ( | const MatrixBase< Rhs > & | b | ) | const [inline] |
b | the right-hand-side of the equation to solve. Can be a vector or a matrix, the only requirement in order for the equation to make sense is that b.rows()==A.rows(), where A is the matrix of which *this is the LU decomposition. |
Example:
Output:
Definition at line 215 of file FullPivLU.h.
RealScalar Eigen::FullPivLU< _MatrixType >::threshold | ( | ) | const [inline] |
Returns the threshold that will be used by certain methods such as rank().
See the documentation of setThreshold(const RealScalar&).
Definition at line 280 of file FullPivLU.h.
IntRowVectorType Eigen::FullPivLU< _MatrixType >::m_colsTranspositions [protected] |
Definition at line 387 of file FullPivLU.h.
Index Eigen::FullPivLU< _MatrixType >::m_det_pq [protected] |
Definition at line 388 of file FullPivLU.h.
bool Eigen::FullPivLU< _MatrixType >::m_isInitialized [protected] |
Definition at line 390 of file FullPivLU.h.
MatrixType Eigen::FullPivLU< _MatrixType >::m_lu [protected] |
Definition at line 383 of file FullPivLU.h.
RealScalar Eigen::FullPivLU< _MatrixType >::m_maxpivot [protected] |
Definition at line 389 of file FullPivLU.h.
Index Eigen::FullPivLU< _MatrixType >::m_nonzero_pivots [protected] |
Definition at line 388 of file FullPivLU.h.
PermutationPType Eigen::FullPivLU< _MatrixType >::m_p [protected] |
Definition at line 384 of file FullPivLU.h.
RealScalar Eigen::FullPivLU< _MatrixType >::m_prescribedThreshold [protected] |
Definition at line 389 of file FullPivLU.h.
PermutationQType Eigen::FullPivLU< _MatrixType >::m_q [protected] |
Definition at line 385 of file FullPivLU.h.
IntColVectorType Eigen::FullPivLU< _MatrixType >::m_rowsTranspositions [protected] |
Definition at line 386 of file FullPivLU.h.
bool Eigen::FullPivLU< _MatrixType >::m_usePrescribedThreshold [protected] |
Definition at line 390 of file FullPivLU.h.