Eigen::IncompleteLU< Scalar_ > Class Template Reference
+ Inheritance diagram for Eigen::IncompleteLU< Scalar_ >:

Public Types

typedef Matrix< Scalar, Dynamic, DynamicMatrixType
 

Public Member Functions

template<typename Rhs , typename Dest >
void _solve_impl (const Rhs &b, Dest &x) const
 
Index cols () const
 
template<typename MatrixType >
IncompleteLUcompute (const MatrixType &mat)
 
 IncompleteLU ()
 
template<typename MatrixType >
 IncompleteLU (const MatrixType &mat)
 
Index rows () const
 
- Public Member Functions inherited from Eigen::SparseSolverBase< IncompleteLU< Scalar_ > >
Derived & derived ()
 
const Derived & derived () const
 
const Solve< Derived, Rhs > solve (const MatrixBase< Rhs > &b) const
 
const Solve< Derived, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
 SparseSolverBase ()
 
 SparseSolverBase (SparseSolverBase &&other)
 
 ~SparseSolverBase ()
 

Protected Types

typedef SparseSolverBase< IncompleteLU< Scalar_ > > Base
 
typedef SparseMatrix< Scalar, RowMajorFactorType
 
typedef Vector::Index Index
 
typedef Scalar_ Scalar
 
typedef Matrix< Scalar, Dynamic, 1 > Vector
 

Protected Attributes

FactorType m_lu
 
- Protected Attributes inherited from Eigen::SparseSolverBase< IncompleteLU< Scalar_ > >
bool m_isInitialized
 

Detailed Description

template<typename Scalar_>
class Eigen::IncompleteLU< Scalar_ >

Definition at line 18 of file IncompleteLU.h.

Member Typedef Documentation

◆ Base

template<typename Scalar_ >
typedef SparseSolverBase<IncompleteLU<Scalar_> > Eigen::IncompleteLU< Scalar_ >::Base
protected

Definition at line 21 of file IncompleteLU.h.

◆ FactorType

template<typename Scalar_ >
typedef SparseMatrix<Scalar,RowMajor> Eigen::IncompleteLU< Scalar_ >::FactorType
protected

Definition at line 27 of file IncompleteLU.h.

◆ Index

template<typename Scalar_ >
typedef Vector::Index Eigen::IncompleteLU< Scalar_ >::Index
protected

Definition at line 26 of file IncompleteLU.h.

◆ MatrixType

template<typename Scalar_ >
typedef Matrix<Scalar,Dynamic,Dynamic> Eigen::IncompleteLU< Scalar_ >::MatrixType

Definition at line 30 of file IncompleteLU.h.

◆ Scalar

template<typename Scalar_ >
typedef Scalar_ Eigen::IncompleteLU< Scalar_ >::Scalar
protected

Definition at line 24 of file IncompleteLU.h.

◆ Vector

template<typename Scalar_ >
typedef Matrix<Scalar,Dynamic,1> Eigen::IncompleteLU< Scalar_ >::Vector
protected

Definition at line 25 of file IncompleteLU.h.

Constructor & Destructor Documentation

◆ IncompleteLU() [1/2]

template<typename Scalar_ >
Eigen::IncompleteLU< Scalar_ >::IncompleteLU ( )
inline

Definition at line 32 of file IncompleteLU.h.

32 {}

◆ IncompleteLU() [2/2]

template<typename Scalar_ >
template<typename MatrixType >
Eigen::IncompleteLU< Scalar_ >::IncompleteLU ( const MatrixType mat)
inline

Definition at line 35 of file IncompleteLU.h.

36  {
37  compute(mat);
38  }
IncompleteLU & compute(const MatrixType &mat)
Definition: IncompleteLU.h:44

Member Function Documentation

◆ _solve_impl()

template<typename Scalar_ >
template<typename Rhs , typename Dest >
void Eigen::IncompleteLU< Scalar_ >::_solve_impl ( const Rhs &  b,
Dest &  x 
) const
inline

Definition at line 80 of file IncompleteLU.h.

81  {
82  x = m_lu.template triangularView<UnitLower>().solve(b);
83  x = m_lu.template triangularView<Upper>().solve(x);
84  }

◆ cols()

template<typename Scalar_ >
Index Eigen::IncompleteLU< Scalar_ >::cols ( void  ) const
inline

Definition at line 41 of file IncompleteLU.h.

41 { return m_lu.cols(); }
Index cols() const

◆ compute()

template<typename Scalar_ >
template<typename MatrixType >
IncompleteLU& Eigen::IncompleteLU< Scalar_ >::compute ( const MatrixType mat)
inline

Definition at line 44 of file IncompleteLU.h.

45  {
46  m_lu = mat;
47  int size = mat.cols();
48  Vector diag(size);
49  for(int i=0; i<size; ++i)
50  {
51  typename FactorType::InnerIterator k_it(m_lu,i);
52  for(; k_it && k_it.index()<i; ++k_it)
53  {
54  int k = k_it.index();
55  k_it.valueRef() /= diag(k);
56 
57  typename FactorType::InnerIterator j_it(k_it);
58  typename FactorType::InnerIterator kj_it(m_lu, k);
59  while(kj_it && kj_it.index()<=k) ++kj_it;
60  for(++j_it; j_it; )
61  {
62  if(kj_it.index()==j_it.index())
63  {
64  j_it.valueRef() -= k_it.value() * kj_it.value();
65  ++j_it;
66  ++kj_it;
67  }
68  else if(kj_it.index()<j_it.index()) ++kj_it;
69  else ++j_it;
70  }
71  }
72  if(k_it && k_it.index()==i) diag(i) = k_it.value();
73  else diag(i) = 1;
74  }
75  m_isInitialized = true;
76  return *this;
77  }
int i
MatrixXf mat
Matrix< Type, Size, 1 > Vector
SparseMat::Index size

◆ rows()

template<typename Scalar_ >
Index Eigen::IncompleteLU< Scalar_ >::rows ( void  ) const
inline

Definition at line 40 of file IncompleteLU.h.

40 { return m_lu.rows(); }
Index rows() const

Member Data Documentation

◆ m_lu

template<typename Scalar_ >
FactorType Eigen::IncompleteLU< Scalar_ >::m_lu
protected

Definition at line 87 of file IncompleteLU.h.


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