Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
Eigen::PartialPivLU Class Reference

LU decomposition of a matrix with partial pivoting, and related features. More...

#include <ForwardDeclarations.h>

Public Types

enum  { MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }
 
typedef SolverBase< PartialPivLUBase
 
typedef _MatrixType MatrixType
 
typedef PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTimePermutationType
 
typedef MatrixType::PlainObject PlainObject
 
typedef Transpositions< RowsAtCompileTime, MaxRowsAtCompileTimeTranspositionType
 

Public Member Functions

template<typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void _solve_impl (const RhsType &rhs, DstType &dst) const
 
template<bool Conjugate, typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void _solve_impl_transposed (const RhsType &rhs, DstType &dst) const
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
template<typename MatrixType >
void compute ()
 
template<typename InputType >
PartialPivLUcompute (const EigenBase< InputType > &matrix)
 
Scalar determinant () const
 
const Inverse< PartialPivLUinverse () const
 
const MatrixTypematrixLU () const
 
 PartialPivLU ()
 Default Constructor. More...
 
template<typename MatrixType >
 PartialPivLU ()
 
template<typename InputType >
 PartialPivLU (const EigenBase< InputType > &matrix)
 
template<typename InputType >
 PartialPivLU (EigenBase< InputType > &matrix)
 
 PartialPivLU (Index size)
 Default Constructor with memory preallocation. More...
 
template<typename MatrixType >
 PartialPivLU (Index size)
 
const PermutationTypepermutationP () const
 
RealScalar rcond () const
 
MatrixType reconstructedMatrix () const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 

Protected Member Functions

void compute ()
 

Static Protected Member Functions

static void check_template_parameters ()
 

Protected Attributes

signed char m_det_p
 
bool m_isInitialized
 
RealScalar m_l1_norm
 
MatrixType m_lu
 
PermutationType m_p
 
TranspositionType m_rowsTranspositions
 

Friends

class SolverBase< PartialPivLU >
 

Detailed Description

LU decomposition of a matrix with partial pivoting, and related features.

Template Parameters
_MatrixTypethe 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.

See also
MatrixBase::partialPivLu(), MatrixBase::determinant(), MatrixBase::inverse(), MatrixBase::computeInverse(), class FullPivLU

Definition at line 269 of file ForwardDeclarations.h.

Member Typedef Documentation

◆ Base

Definition at line 82 of file PartialPivLU.h.

◆ MatrixType

typedef _MatrixType Eigen::PartialPivLU::MatrixType

Definition at line 81 of file PartialPivLU.h.

◆ PermutationType

Definition at line 90 of file PartialPivLU.h.

◆ PlainObject

typedef MatrixType::PlainObject Eigen::PartialPivLU::PlainObject

Definition at line 92 of file PartialPivLU.h.

◆ TranspositionType

Definition at line 91 of file PartialPivLU.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MaxRowsAtCompileTime 
MaxColsAtCompileTime 

Definition at line 86 of file PartialPivLU.h.

Constructor & Destructor Documentation

◆ PartialPivLU() [1/6]

Eigen::PartialPivLU::PartialPivLU ( )

Default Constructor.

The default constructor is useful in cases in which the user intends to perform decompositions via PartialPivLU::compute(const MatrixType&).

◆ PartialPivLU() [2/6]

Eigen::PartialPivLU::PartialPivLU ( Index  size)
explicit

Default Constructor with memory preallocation.

Like the default constructor but with preallocation of the internal data according to the specified problem size.

See also
PartialPivLU()

◆ PartialPivLU() [3/6]

template<typename InputType >
Eigen::PartialPivLU::PartialPivLU ( const EigenBase< InputType > &  matrix)
explicit

Constructor.

Parameters
matrixthe matrix of which to compute the LU decomposition.
Warning
The matrix should have full rank (e.g. if it's square, it should be invertible). If you need to deal with non-full rank, use class FullPivLU instead.

Definition at line 307 of file PartialPivLU.h.

◆ PartialPivLU() [4/6]

template<typename InputType >
Eigen::PartialPivLU::PartialPivLU ( EigenBase< InputType > &  matrix)
explicit

Constructor for inplace decomposition

Parameters
matrixthe matrix of which to compute the LU decomposition.
Warning
The matrix should have full rank (e.g. if it's square, it should be invertible). If you need to deal with non-full rank, use class FullPivLU instead.

Definition at line 320 of file PartialPivLU.h.

◆ PartialPivLU() [5/6]

template<typename MatrixType >
Eigen::PartialPivLU::PartialPivLU ( )

Definition at line 284 of file PartialPivLU.h.

◆ PartialPivLU() [6/6]

template<typename MatrixType >
Eigen::PartialPivLU::PartialPivLU ( Index  size)

Definition at line 295 of file PartialPivLU.h.

Member Function Documentation

◆ _solve_impl()

template<typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void Eigen::PartialPivLU::_solve_impl ( const RhsType &  rhs,
DstType &  dst 
) const
inline

Definition at line 225 of file PartialPivLU.h.

◆ _solve_impl_transposed()

template<bool Conjugate, typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void Eigen::PartialPivLU::_solve_impl_transposed ( const RhsType &  rhs,
DstType &  dst 
) const
inline

Definition at line 245 of file PartialPivLU.h.

◆ check_template_parameters()

static void Eigen::PartialPivLU::check_template_parameters ( )
inlinestaticprotected

Definition at line 268 of file PartialPivLU.h.

◆ cols()

EIGEN_CONSTEXPR Index Eigen::PartialPivLU::cols ( ) const
inline

Definition at line 220 of file PartialPivLU.h.

◆ compute() [1/3]

void Eigen::PartialPivLU::compute ( )
protected

◆ compute() [2/3]

template<typename MatrixType >
void Eigen::PartialPivLU::compute ( )

Definition at line 525 of file PartialPivLU.h.

◆ compute() [3/3]

template<typename InputType >
PartialPivLU& Eigen::PartialPivLU::compute ( const EigenBase< InputType > &  matrix)
inline

Definition at line 131 of file PartialPivLU.h.

◆ determinant()

PartialPivLU< MatrixType >::Scalar Eigen::PartialPivLU::determinant ( ) const
Returns
the determinant of the matrix of which *this is the LU decomposition. It has only linear complexity (that is, O(n) where n is the dimension of the square matrix) as the LU decomposition has already been computed.
Note
For fixed-size matrices of size up to 4, MatrixBase::determinant() offers optimized paths.
Warning
a determinant can be very big or small, so for matrices of large enough dimension, there is a risk of overflow/underflow.
See also
MatrixBase::determinant()

Definition at line 552 of file PartialPivLU.h.

◆ inverse()

const Inverse<PartialPivLU> Eigen::PartialPivLU::inverse ( ) const
inline
Returns
the inverse of the matrix of which *this is the LU decomposition.
Warning
The matrix being decomposed here is assumed to be invertible. If you need to check for invertibility, use class FullPivLU instead.
See also
MatrixBase::inverse(), LU::inverse()

Definition at line 196 of file PartialPivLU.h.

◆ matrixLU()

const MatrixType& Eigen::PartialPivLU::matrixLU ( ) const
inline
Returns
the LU decomposition matrix: the upper-triangular part is U, the unit-lower-triangular part is L (at least for square matrices; in the non-square case, special care is needed, see the documentation of class FullPivLU).
See also
matrixL(), matrixU()

Definition at line 143 of file PartialPivLU.h.

◆ permutationP()

const PermutationType& Eigen::PartialPivLU::permutationP ( ) const
inline
Returns
the permutation matrix P.

Definition at line 151 of file PartialPivLU.h.

◆ rcond()

RealScalar Eigen::PartialPivLU::rcond ( ) const
inline
Returns
an estimate of the reciprocal condition number of the matrix of which *this is the LU decomposition.

Definition at line 183 of file PartialPivLU.h.

◆ reconstructedMatrix()

MatrixType Eigen::PartialPivLU::reconstructedMatrix ( ) const
Returns
the matrix represented by the decomposition, i.e., it returns the product: P^{-1} L U. This function is provided for debug purpose.

Definition at line 562 of file PartialPivLU.h.

◆ rows()

EIGEN_CONSTEXPR Index Eigen::PartialPivLU::rows ( ) const
inline

Definition at line 219 of file PartialPivLU.h.

Friends And Related Function Documentation

◆ SolverBase< PartialPivLU >

friend class SolverBase< PartialPivLU >
friend

Definition at line 83 of file PartialPivLU.h.

Member Data Documentation

◆ m_det_p

signed char Eigen::PartialPivLU::m_det_p
protected

Definition at line 279 of file PartialPivLU.h.

◆ m_isInitialized

bool Eigen::PartialPivLU::m_isInitialized
protected

Definition at line 280 of file PartialPivLU.h.

◆ m_l1_norm

RealScalar Eigen::PartialPivLU::m_l1_norm
protected

Definition at line 278 of file PartialPivLU.h.

◆ m_lu

MatrixType Eigen::PartialPivLU::m_lu
protected

Definition at line 275 of file PartialPivLU.h.

◆ m_p

PermutationType Eigen::PartialPivLU::m_p
protected

Definition at line 276 of file PartialPivLU.h.

◆ m_rowsTranspositions

TranspositionType Eigen::PartialPivLU::m_rowsTranspositions
protected

Definition at line 277 of file PartialPivLU.h.


The documentation for this class was generated from the following files:


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:11:36