LU decomposition of a matrix with partial pivoting, and related features. More...
Public Member Functions | |
EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
template<typename InputType > | |
PartialPivLU & | compute (const EigenBase< InputType > &matrix) |
Scalar | determinant () const |
const Inverse< PartialPivLU > | inverse () const |
const MatrixType & | matrixLU () const |
PartialPivLU () | |
Default Constructor. More... | |
template<typename InputType > | |
PartialPivLU (const EigenBase< InputType > &matrix) | |
template<typename InputType > | |
PartialPivLU (EigenBase< InputType > &matrix) | |
PartialPivLU (Index size) | |
Default Constructor with memory preallocation. More... | |
const PermutationType & | permutationP () const |
RealScalar | rcond () const |
MatrixType | reconstructedMatrix () const |
EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
template<typename Rhs > | |
const Solve< PartialPivLU, Rhs > | solve (const MatrixBase< Rhs > &b) const |
Public Member Functions inherited from Eigen::SolverBase< PartialPivLU< MatrixType_, PermutationIndex_ > > | |
const AdjointReturnType | adjoint () const |
PartialPivLU< MatrixType_, PermutationIndex_ > & | derived () |
const PartialPivLU< MatrixType_, PermutationIndex_ > & | derived () const |
const Solve< PartialPivLU< MatrixType_, PermutationIndex_ >, Rhs > | solve (const MatrixBase< Rhs > &b) const |
SolverBase () | |
const ConstTransposeReturnType | transpose () const |
~SolverBase () | |
Public Member Functions inherited from Eigen::EigenBase< Derived > | |
template<typename Dest > | |
void | addTo (Dest &dst) const |
template<typename Dest > | |
void | applyThisOnTheLeft (Dest &dst) const |
template<typename Dest > | |
void | applyThisOnTheRight (Dest &dst) const |
EIGEN_CONSTEXPR Index | cols () const EIGEN_NOEXCEPT |
Derived & | const_cast_derived () const |
const Derived & | const_derived () const |
Derived & | derived () |
const Derived & | derived () const |
template<typename Dest > | |
void | evalTo (Dest &dst) const |
EIGEN_CONSTEXPR Index | rows () const EIGEN_NOEXCEPT |
EIGEN_CONSTEXPR Index | size () const EIGEN_NOEXCEPT |
template<typename Dest > | |
void | subTo (Dest &dst) const |
Protected Member Functions | |
void | compute () |
Protected Member Functions inherited from Eigen::SolverBase< PartialPivLU< MatrixType_, PermutationIndex_ > > | |
void | _check_solve_assertion (const Rhs &b) const |
Protected Attributes | |
signed char | m_det_p |
bool | m_isInitialized |
RealScalar | m_l1_norm |
MatrixType | m_lu |
PermutationType | m_p |
TranspositionType | m_rowsTranspositions |
LU decomposition of a matrix with partial 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 a square invertible matrix, with partial pivoting: the matrix A is decomposed as A = PLU where L is unit-lower-triangular, U is upper-triangular, and P is a permutation matrix.
Typically, partial pivoting LU decomposition is only considered numerically stable for square invertible matrices. Thus LAPACK's dgesv and dgesvx require the matrix to be square and invertible. The present class does the same. It will assert that the matrix is square, but it won't (actually it can't) check that the matrix is invertible: it is your task to check that you only use this decomposition on invertible matrices.
The guaranteed safe alternative, working for all matrices, is the full pivoting LU decomposition, provided by class FullPivLU.
This is not a rank-revealing LU decomposition. Many features are intentionally absent from this class, such as rank computation. If you need these features, use class FullPivLU.
This LU decomposition is suitable to invert invertible matrices. It is what MatrixBase::inverse() uses in the general case. On the other hand, it is not suitable to determine whether a given matrix is invertible.
The data of the LU decomposition can be directly accessed through the methods matrixLU(), permutationP().
This class supports the inplace decomposition mechanism.
Definition at line 78 of file PartialPivLU.h.
typedef SolverBase<PartialPivLU> Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::Base |
Definition at line 84 of file PartialPivLU.h.
typedef MatrixType_ Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::MatrixType |
Definition at line 83 of file PartialPivLU.h.
using Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::PermutationIndex = PermutationIndex_ |
Definition at line 92 of file PartialPivLU.h.
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::PermutationType |
Definition at line 93 of file PartialPivLU.h.
typedef MatrixType::PlainObject Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::PlainObject |
Definition at line 95 of file PartialPivLU.h.
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime, PermutationIndex> Eigen::PartialPivLU< MatrixType_, PermutationIndex_ >::TranspositionType |
Definition at line 94 of file PartialPivLU.h.
anonymous enum |
Eigen::PartialPivLU< MatrixType, PermutationIndex >::PartialPivLU |
Default Constructor.
The default constructor is useful in cases in which the user intends to perform decompositions via PartialPivLU::compute(const MatrixType&).
Definition at line 284 of file PartialPivLU.h.
|
explicit |
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 295 of file PartialPivLU.h.
|
explicit |
Constructor.
matrix | the matrix of which to compute the LU decomposition. |
Definition at line 307 of file PartialPivLU.h.
|
explicit |
Constructor for inplace decomposition
matrix | the matrix of which to compute the LU decomposition. |
Definition at line 320 of file PartialPivLU.h.
|
inline |
Definition at line 223 of file PartialPivLU.h.
|
protected |
Definition at line 525 of file PartialPivLU.h.
|
inline |
Definition at line 134 of file PartialPivLU.h.
PartialPivLU< MatrixType, PermutationIndex >::Scalar Eigen::PartialPivLU< MatrixType, PermutationIndex >::determinant |
Definition at line 549 of file PartialPivLU.h.
|
inline |
Definition at line 199 of file PartialPivLU.h.
|
inline |
Definition at line 146 of file PartialPivLU.h.
|
inline |
|
inline |
*this
is the LU decomposition. Definition at line 186 of file PartialPivLU.h.
MatrixType Eigen::PartialPivLU< MatrixType, PermutationIndex >::reconstructedMatrix |
Definition at line 559 of file PartialPivLU.h.
|
inline |
Definition at line 222 of file PartialPivLU.h.
|
inline |
This method returns the solution x to the equation Ax=b, where A is the matrix of which *this is the LU decomposition.
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:
Here is the invertible matrix A: 0.68 0.597 -0.33 -0.211 0.823 0.536 0.566 -0.605 -0.444 Here is the matrix B: 0.108 -0.27 -0.0452 0.0268 0.258 0.904 Here is the (unique) solution X to the equation AX=B: 0.609 2.68 -0.231 -1.57 0.51 3.51 Relative error: 3.28e-16
Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution theoretically exists and is unique regardless of b.
|
protected |
Definition at line 279 of file PartialPivLU.h.
|
protected |
Definition at line 280 of file PartialPivLU.h.
|
protected |
Definition at line 278 of file PartialPivLU.h.
|
protected |
Definition at line 275 of file PartialPivLU.h.
|
protected |
Definition at line 276 of file PartialPivLU.h.
|
protected |
Definition at line 277 of file PartialPivLU.h.