Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Eigen::PartialPivLU< _MatrixType > Class Template Reference

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

#include <src/eigen/Eigen/src/LU/PartialPivLU.h>

+ Inheritance diagram for Eigen::PartialPivLU< _MatrixType >:
+ Collaboration diagram for Eigen::PartialPivLU< _MatrixType >:

Public Types

enum  { MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime , MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }
 
typedef _MatrixType MatrixType
 
typedef SolverBase< PartialPivLUBase
 
typedef PermutationMatrix< RowsAtCompileTime, MaxRowsAtCompileTimePermutationType
 
typedef Transpositions< RowsAtCompileTime, MaxRowsAtCompileTimeTranspositionType
 
typedef MatrixType::PlainObject PlainObject
 
enum  
 
typedef internal::traits< PartialPivLU< _MatrixType > >::Scalar Scalar
 
typedef Scalar CoeffReturnType
 
typedef internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
 
typedef internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
 
typedef Eigen::Index Index
 The interface type of indices.
 
typedef internal::traits< Derived >::StorageKind StorageKind
 

Public Member Functions

 PartialPivLU ()
 Default Constructor.
 
 PartialPivLU (Index size)
 Default Constructor with memory preallocation.
 
template<typename InputType >
 PartialPivLU (const EigenBase< InputType > &matrix)
 
template<typename InputType >
 PartialPivLU (EigenBase< InputType > &matrix)
 
template<typename InputType >
PartialPivLUcompute (const EigenBase< InputType > &matrix)
 
const MatrixTypematrixLU () const
 
const PermutationTypepermutationP () const
 
template<typename Rhs >
const Solve< PartialPivLU, Rhs > solve (const MatrixBase< Rhs > &b) const
 
RealScalar rcond () const
 
const Inverse< PartialPivLUinverse () const
 
Scalar determinant () const
 
MatrixType reconstructedMatrix () const
 
Index rows () const
 
Index cols () const
 
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
 
ConstTransposeReturnType transpose () const
 
AdjointReturnType adjoint () const
 
EIGEN_DEVICE_FUNC PartialPivLU< _MatrixType > & derived ()
 
EIGEN_DEVICE_FUNC const PartialPivLU< _MatrixType > & derived () const
 
EIGEN_DEVICE_FUNC Derived & const_cast_derived () const
 
EIGEN_DEVICE_FUNC const Derived & const_derived () const
 
EIGEN_DEVICE_FUNC Index size () const
 
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
 

Protected Member Functions

void compute ()
 

Static Protected Member Functions

static void check_template_parameters ()
 

Protected Attributes

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

Detailed Description

template<typename _MatrixType>
class Eigen::PartialPivLU< _MatrixType >

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

Member Typedef Documentation

◆ AdjointReturnType

◆ Base

template<typename _MatrixType >
typedef SolverBase<PartialPivLU> Eigen::PartialPivLU< _MatrixType >::Base

◆ CoeffReturnType

typedef Scalar Eigen::SolverBase< PartialPivLU< _MatrixType > >::CoeffReturnType
inherited

◆ ConstTransposeReturnType

typedef internal::add_const<Transpose<constDerived>>::type Eigen::SolverBase< PartialPivLU< _MatrixType > >::ConstTransposeReturnType
inherited

◆ Index

template<typename Derived >
typedef Eigen::Index Eigen::EigenBase< Derived >::Index
inherited

The interface type of indices.

To change this, #define the preprocessor symbol EIGEN_DEFAULT_DENSE_INDEX_TYPE.

See also
StorageIndex, TopicPreprocessorDirectives.

◆ MatrixType

template<typename _MatrixType >
typedef _MatrixType Eigen::PartialPivLU< _MatrixType >::MatrixType

◆ PermutationType

template<typename _MatrixType >
typedef PermutationMatrix<RowsAtCompileTime, MaxRowsAtCompileTime> Eigen::PartialPivLU< _MatrixType >::PermutationType

◆ PlainObject

template<typename _MatrixType >
typedef MatrixType::PlainObject Eigen::PartialPivLU< _MatrixType >::PlainObject

◆ Scalar

typedef internal::traits<PartialPivLU< _MatrixType > >::Scalar Eigen::SolverBase< PartialPivLU< _MatrixType > >::Scalar
inherited

◆ StorageKind

template<typename Derived >
typedef internal::traits<Derived>::StorageKind Eigen::EigenBase< Derived >::StorageKind
inherited

◆ TranspositionType

template<typename _MatrixType >
typedef Transpositions<RowsAtCompileTime, MaxRowsAtCompileTime> Eigen::PartialPivLU< _MatrixType >::TranspositionType

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
49 {
50 RowsAtCompileTime = internal::traits<Derived>::RowsAtCompileTime,
51 ColsAtCompileTime = internal::traits<Derived>::ColsAtCompileTime,
52 SizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::RowsAtCompileTime,
53 internal::traits<Derived>::ColsAtCompileTime>::ret),
54 MaxRowsAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime,
55 MaxColsAtCompileTime = internal::traits<Derived>::MaxColsAtCompileTime,
56 MaxSizeAtCompileTime = (internal::size_at_compile_time<internal::traits<Derived>::MaxRowsAtCompileTime,
57 internal::traits<Derived>::MaxColsAtCompileTime>::ret),
58 IsVectorAtCompileTime = internal::traits<Derived>::MaxRowsAtCompileTime == 1
59 || internal::traits<Derived>::MaxColsAtCompileTime == 1
60 };
@ RowsAtCompileTime
Definition SolverBase.h:50
@ ColsAtCompileTime
Definition SolverBase.h:51
@ IsVectorAtCompileTime
Definition SolverBase.h:58
@ SizeAtCompileTime
Definition SolverBase.h:52

◆ anonymous enum

template<typename _MatrixType >
anonymous enum
Enumerator
MaxRowsAtCompileTime 
MaxColsAtCompileTime 
84 {
85 MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime,
86 MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime
87 };
@ MaxRowsAtCompileTime
Definition PartialPivLU.h:85
@ MaxColsAtCompileTime
Definition PartialPivLU.h:86

Constructor & Destructor Documentation

◆ PartialPivLU() [1/4]

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

Default Constructor.

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

293 : m_lu(),
294 m_p(),
296 m_l1_norm(0),
297 m_det_p(0),
298 m_isInitialized(false)
299{
300}
RealScalar m_l1_norm
Definition PartialPivLU.h:286
MatrixType m_lu
Definition PartialPivLU.h:283
signed char m_det_p
Definition PartialPivLU.h:287
bool m_isInitialized
Definition PartialPivLU.h:288
TranspositionType m_rowsTranspositions
Definition PartialPivLU.h:285
PermutationType m_p
Definition PartialPivLU.h:284

◆ PartialPivLU() [2/4]

template<typename MatrixType >
Eigen::PartialPivLU< MatrixType >::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()
304 : m_lu(size, size),
305 m_p(size),
307 m_l1_norm(0),
308 m_det_p(0),
309 m_isInitialized(false)
310{
311}
EIGEN_DEVICE_FUNC Index size() const
Definition EigenBase.h:66

◆ PartialPivLU() [3/4]

template<typename MatrixType >
template<typename InputType >
Eigen::PartialPivLU< MatrixType >::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.
316 : m_lu(matrix.rows(),matrix.cols()),
317 m_p(matrix.rows()),
318 m_rowsTranspositions(matrix.rows()),
319 m_l1_norm(0),
320 m_det_p(0),
321 m_isInitialized(false)
322{
323 compute(matrix.derived());
324}
void compute()
Definition PartialPivLU.h:515

References Eigen::PartialPivLU< _MatrixType >::compute(), and Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ PartialPivLU() [4/4]

template<typename MatrixType >
template<typename InputType >
Eigen::PartialPivLU< MatrixType >::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.
329 : m_lu(matrix.derived()),
330 m_p(matrix.rows()),
331 m_rowsTranspositions(matrix.rows()),
332 m_l1_norm(0),
333 m_det_p(0),
334 m_isInitialized(false)
335{
336 compute();
337}

References Eigen::PartialPivLU< _MatrixType >::compute().

+ Here is the call graph for this function:

Member Function Documentation

◆ _solve_impl()

template<typename _MatrixType >
template<typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void Eigen::PartialPivLU< _MatrixType >::_solve_impl ( const RhsType &  rhs,
DstType &  dst 
) const
inline
226 {
227 /* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
228 * So we proceed as follows:
229 * Step 1: compute c = Pb.
230 * Step 2: replace c by the solution x to Lx = c.
231 * Step 3: replace c by the solution x to Ux = c.
232 */
233
234 eigen_assert(rhs.rows() == m_lu.rows());
235
236 // Step 1
237 dst = permutationP() * rhs;
238
239 // Step 2
240 m_lu.template triangularView<UnitLower>().solveInPlace(dst);
241
242 // Step 3
243 m_lu.template triangularView<Upper>().solveInPlace(dst);
244 }
#define eigen_assert(x)
Definition Macros.h:579
const PermutationType & permutationP() const
Definition PartialPivLU.h:149

References eigen_assert, Eigen::PartialPivLU< _MatrixType >::m_lu, and Eigen::PartialPivLU< _MatrixType >::permutationP().

+ Here is the call graph for this function:

◆ _solve_impl_transposed()

template<typename _MatrixType >
template<bool Conjugate, typename RhsType , typename DstType >
EIGEN_DEVICE_FUNC void Eigen::PartialPivLU< _MatrixType >::_solve_impl_transposed ( const RhsType &  rhs,
DstType &  dst 
) const
inline
248 {
249 /* The decomposition PA = LU can be rewritten as A = P^{-1} L U.
250 * So we proceed as follows:
251 * Step 1: compute c = Pb.
252 * Step 2: replace c by the solution x to Lx = c.
253 * Step 3: replace c by the solution x to Ux = c.
254 */
255
256 eigen_assert(rhs.rows() == m_lu.cols());
257
258 if (Conjugate) {
259 // Step 1
260 dst = m_lu.template triangularView<Upper>().adjoint().solve(rhs);
261 // Step 2
262 m_lu.template triangularView<UnitLower>().adjoint().solveInPlace(dst);
263 } else {
264 // Step 1
265 dst = m_lu.template triangularView<Upper>().transpose().solve(rhs);
266 // Step 2
267 m_lu.template triangularView<UnitLower>().transpose().solveInPlace(dst);
268 }
269 // Step 3
270 dst = permutationP().transpose() * dst;
271 }
InverseReturnType transpose() const
Definition PermutationMatrix.h:202

References eigen_assert, Eigen::PartialPivLU< _MatrixType >::m_lu, Eigen::PartialPivLU< _MatrixType >::permutationP(), and Eigen::PermutationBase< Derived >::transpose().

+ Here is the call graph for this function:

◆ addTo()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::addTo ( Dest &  dst) const
inlineinherited
78 {
79 // This is the default implementation,
80 // derived class can reimplement it in a more optimized way.
81 typename Dest::PlainObject res(rows(),cols());
82 evalTo(res);
83 dst += res;
84 }
EIGEN_DEVICE_FUNC Index cols() const
Definition EigenBase.h:62
EIGEN_DEVICE_FUNC Index rows() const
Definition EigenBase.h:59
EIGEN_DEVICE_FUNC void evalTo(Dest &dst) const
Definition EigenBase.h:71

◆ adjoint()

AdjointReturnType Eigen::SolverBase< PartialPivLU< _MatrixType > >::adjoint ( ) const
inlineinherited
Returns
an expression of the adjoint of the factored matrix

A typical usage is to solve for the adjoint problem A' x = b:

x = dec.adjoint().solve(b);

For real scalar types, this function is equivalent to transpose().

See also
transpose(), solve()
110 {
112 }
internal::conditional< NumTraits< Scalar >::IsComplex, CwiseUnaryOp< internal::scalar_conjugate_op< Scalar >, ConstTransposeReturnType >, ConstTransposeReturnType >::type AdjointReturnType
Definition SolverBase.h:99
ConstTransposeReturnType transpose() const
Definition SolverBase.h:90
EIGEN_DEVICE_FUNC PartialPivLU< _MatrixType > & derived()
Definition EigenBase.h:45

◆ applyThisOnTheLeft()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::applyThisOnTheLeft ( Dest &  dst) const
inlineinherited
110 {
111 // This is the default implementation,
112 // derived class can reimplement it in a more optimized way.
113 dst = this->derived() * dst;
114 }
EIGEN_DEVICE_FUNC Derived & derived()
Definition EigenBase.h:45

References Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ applyThisOnTheRight()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::applyThisOnTheRight ( Dest &  dst) const
inlineinherited
101 {
102 // This is the default implementation,
103 // derived class can reimplement it in a more optimized way.
104 dst = dst * this->derived();
105 }

References Eigen::EigenBase< Derived >::derived().

+ Here is the call graph for this function:

◆ check_template_parameters()

template<typename _MatrixType >
static void Eigen::PartialPivLU< _MatrixType >::check_template_parameters ( )
inlinestaticprotected
277 {
279 }
#define EIGEN_STATIC_ASSERT_NON_INTEGER(TYPE)
Definition StaticAssert.h:184
internal::traits< PartialPivLU< _MatrixType > >::Scalar Scalar
Definition SolverBase.h:46

References EIGEN_STATIC_ASSERT_NON_INTEGER.

◆ cols()

template<typename _MatrixType >
Index Eigen::PartialPivLU< _MatrixType >::cols ( ) const
inline
221{ return m_lu.cols(); }

References Eigen::PartialPivLU< _MatrixType >::m_lu.

◆ compute() [1/2]

template<typename MatrixType >
void Eigen::PartialPivLU< MatrixType >::compute
protected
516{
518
519 // the row permutation is stored as int indices, so just to be sure:
520 eigen_assert(m_lu.rows()<NumTraits<int>::highest());
521
522 m_l1_norm = m_lu.cwiseAbs().colwise().sum().maxCoeff();
523
524 eigen_assert(m_lu.rows() == m_lu.cols() && "PartialPivLU is only for square (and moreover invertible) matrices");
525 const Index size = m_lu.rows();
526
528
529 typename TranspositionType::StorageIndex nb_transpositions;
531 m_det_p = (nb_transpositions%2) ? -1 : 1;
532
534
535 m_isInitialized = true;
536}
static void check_template_parameters()
Definition PartialPivLU.h:276
void resize(Index newSize)
Definition Transpositions.h:74
IndicesType::Scalar StorageIndex
Definition Transpositions.h:165
void partial_lu_inplace(MatrixType &lu, TranspositionType &row_transpositions, typename TranspositionType::StorageIndex &nb_transpositions)
Definition PartialPivLU.h:502
Eigen::Index Index
The interface type of indices.
Definition EigenBase.h:38

References eigen_assert, and Eigen::internal::partial_lu_inplace().

Referenced by Eigen::PartialPivLU< _MatrixType >::PartialPivLU(), Eigen::PartialPivLU< _MatrixType >::PartialPivLU(), and Eigen::PartialPivLU< _MatrixType >::compute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compute() [2/2]

template<typename _MatrixType >
template<typename InputType >
PartialPivLU & Eigen::PartialPivLU< _MatrixType >::compute ( const EigenBase< InputType > &  matrix)
inline
129 {
130 m_lu = matrix.derived();
131 compute();
132 return *this;
133 }

References Eigen::PartialPivLU< _MatrixType >::compute(), Eigen::EigenBase< Derived >::derived(), and Eigen::PartialPivLU< _MatrixType >::m_lu.

+ Here is the call graph for this function:

◆ const_cast_derived()

template<typename Derived >
EIGEN_DEVICE_FUNC Derived & Eigen::EigenBase< Derived >::const_cast_derived ( ) const
inlineinherited
52 { return *static_cast<Derived*>(const_cast<EigenBase*>(this)); }

Referenced by Eigen::TriangularViewImpl< _MatrixType, _Mode, Dense >::swap().

+ Here is the caller graph for this function:

◆ const_derived()

template<typename Derived >
EIGEN_DEVICE_FUNC const Derived & Eigen::EigenBase< Derived >::const_derived ( ) const
inlineinherited
55 { return *static_cast<const Derived*>(this); }

◆ derived() [1/2]

EIGEN_DEVICE_FUNC PartialPivLU< _MatrixType > & Eigen::EigenBase< PartialPivLU< _MatrixType > >::derived ( )
inlineinherited
Returns
a reference to the derived object
45{ return *static_cast<Derived*>(this); }

◆ derived() [2/2]

EIGEN_DEVICE_FUNC const PartialPivLU< _MatrixType > & Eigen::EigenBase< PartialPivLU< _MatrixType > >::derived ( ) const
inlineinherited
Returns
a const reference to the derived object
48{ return *static_cast<const Derived*>(this); }

◆ determinant()

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()
540{
541 eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
542 return Scalar(m_det_p) * m_lu.diagonal().prod();
543}

References eigen_assert.

◆ evalTo()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::evalTo ( Dest &  dst) const
inlineinherited
72 { derived().evalTo(dst); }

Referenced by Eigen::EigenBase< Derived >::subTo().

+ Here is the caller graph for this function:

◆ inverse()

template<typename _MatrixType >
const Inverse< PartialPivLU > Eigen::PartialPivLU< _MatrixType >::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()
198 {
199 eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
200 return Inverse<PartialPivLU>(*this);
201 }

References eigen_assert, and Eigen::PartialPivLU< _MatrixType >::m_isInitialized.

◆ matrixLU()

template<typename _MatrixType >
const MatrixType & Eigen::PartialPivLU< _MatrixType >::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()
142 {
143 eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
144 return m_lu;
145 }

References eigen_assert, Eigen::PartialPivLU< _MatrixType >::m_isInitialized, and Eigen::PartialPivLU< _MatrixType >::m_lu.

◆ permutationP()

template<typename _MatrixType >
const PermutationType & Eigen::PartialPivLU< _MatrixType >::permutationP ( ) const
inline
Returns
the permutation matrix P.
150 {
151 eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
152 return m_p;
153 }

References eigen_assert, Eigen::PartialPivLU< _MatrixType >::m_isInitialized, and Eigen::PartialPivLU< _MatrixType >::m_p.

Referenced by Eigen::PartialPivLU< _MatrixType >::_solve_impl(), and Eigen::PartialPivLU< _MatrixType >::_solve_impl_transposed().

+ Here is the caller graph for this function:

◆ rcond()

template<typename _MatrixType >
RealScalar Eigen::PartialPivLU< _MatrixType >::rcond ( ) const
inline
Returns
an estimate of the reciprocal condition number of the matrix of which *this is the LU decomposition.
185 {
186 eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
188 }
Decomposition::RealScalar rcond_estimate_helper(typename Decomposition::RealScalar matrix_norm, const Decomposition &dec)
Reciprocal condition number estimator.
Definition ConditionEstimator.h:159

References eigen_assert, Eigen::PartialPivLU< _MatrixType >::m_isInitialized, Eigen::PartialPivLU< _MatrixType >::m_l1_norm, and Eigen::internal::rcond_estimate_helper().

+ Here is the call graph for this function:

◆ reconstructedMatrix()

template<typename MatrixType >
MatrixType Eigen::PartialPivLU< MatrixType >::reconstructedMatrix
Returns
the matrix represented by the decomposition, i.e., it returns the product: P^{-1} L U. This function is provided for debug purpose.
550{
551 eigen_assert(m_isInitialized && "LU is not initialized.");
552 // LU
553 MatrixType res = m_lu.template triangularView<UnitLower>().toDenseMatrix()
554 * m_lu.template triangularView<Upper>();
555
556 // P^{-1}(LU)
557 res = m_p.inverse() * res;
558
559 return res;
560}
_MatrixType MatrixType
Definition PartialPivLU.h:80
InverseReturnType inverse() const
Definition PermutationMatrix.h:196

References eigen_assert.

◆ rows()

template<typename _MatrixType >
Index Eigen::PartialPivLU< _MatrixType >::rows ( ) const
inline
220{ return m_lu.rows(); }

References Eigen::PartialPivLU< _MatrixType >::m_lu.

◆ size()

template<typename Derived >
EIGEN_DEVICE_FUNC Index Eigen::EigenBase< Derived >::size ( ) const
inlineinherited
Returns
the number of coefficients, which is rows()*cols().
See also
rows(), cols(), SizeAtCompileTime.
66{ return rows() * cols(); }

References Eigen::EigenBase< Derived >::cols(), and Eigen::EigenBase< Derived >::rows().

Referenced by Eigen::PlainObjectBase< Derived >::_resize_to_match(), Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::resize(), Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::setIdentity(), and Eigen::DiagonalMatrix< _Scalar, SizeAtCompileTime, MaxSizeAtCompileTime >::setZero().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ solve()

template<typename _MatrixType >
template<typename Rhs >
const Solve< PartialPivLU, Rhs > Eigen::PartialPivLU< _MatrixType >::solve ( const MatrixBase< Rhs > &  b) const
inline

This method returns the solution x to the equation Ax=b, where A is the matrix of which *this is the LU decomposition.

Parameters
bthe 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.
Returns
the solution.

Example:

Output:

Since this PartialPivLU class assumes anyway that the matrix A is invertible, the solution theoretically exists and is unique regardless of b.

See also
TriangularView::solve(), inverse(), computeInverse()
176 {
177 eigen_assert(m_isInitialized && "PartialPivLU is not initialized.");
178 return Solve<PartialPivLU, Rhs>(*this, b.derived());
179 }

References eigen_assert, and Eigen::PartialPivLU< _MatrixType >::m_isInitialized.

◆ subTo()

template<typename Derived >
template<typename Dest >
EIGEN_DEVICE_FUNC void Eigen::EigenBase< Derived >::subTo ( Dest &  dst) const
inlineinherited
90 {
91 // This is the default implementation,
92 // derived class can reimplement it in a more optimized way.
93 typename Dest::PlainObject res(rows(),cols());
94 evalTo(res);
95 dst -= res;
96 }

References Eigen::EigenBase< Derived >::cols(), Eigen::EigenBase< Derived >::evalTo(), and Eigen::EigenBase< Derived >::rows().

+ Here is the call graph for this function:

◆ transpose()

ConstTransposeReturnType Eigen::SolverBase< PartialPivLU< _MatrixType > >::transpose ( ) const
inlineinherited
Returns
an expression of the transposed of the factored matrix.

A typical usage is to solve for the transposed problem A^T x = b:

x = dec.transpose().solve(b);
See also
adjoint(), solve()
91 {
93 }
internal::add_const< Transpose< constDerived > >::type ConstTransposeReturnType
Definition SolverBase.h:82

Member Data Documentation

◆ m_det_p

template<typename _MatrixType >
signed char Eigen::PartialPivLU< _MatrixType >::m_det_p
protected

◆ m_isInitialized

◆ m_l1_norm

template<typename _MatrixType >
RealScalar Eigen::PartialPivLU< _MatrixType >::m_l1_norm
protected

◆ m_lu

◆ m_p

template<typename _MatrixType >
PermutationType Eigen::PartialPivLU< _MatrixType >::m_p
protected

◆ m_rowsTranspositions

template<typename _MatrixType >
TranspositionType Eigen::PartialPivLU< _MatrixType >::m_rowsTranspositions
protected

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