10 #ifndef EIGEN_INCOMPLETE_LU_H 11 #define EIGEN_INCOMPLETE_LU_H 15 template <
typename _Scalar>
28 template<
typename MatrixType>
37 template<
typename MatrixType>
41 int size = mat.
cols();
43 for(
int i=0; i<size; ++i)
45 typename FactorType::InnerIterator k_it(
m_lu,i);
46 for(; k_it && k_it.index()<i; ++k_it)
49 k_it.valueRef() /= diag(k);
51 typename FactorType::InnerIterator j_it(k_it);
52 typename FactorType::InnerIterator kj_it(
m_lu, k);
53 while(kj_it && kj_it.index()<=k) ++kj_it;
56 if(kj_it.index()==j_it.index())
58 j_it.valueRef() -= k_it.value() * kj_it.value();
62 else if(kj_it.index()<j_it.index()) ++kj_it;
66 if(k_it && k_it.index()==i) diag(i) = k_it.value();
73 template<
typename Rhs,
typename Dest>
74 void _solve(
const Rhs& b, Dest& x)
const 76 x =
m_lu.template triangularView<UnitLower>().
solve(b);
77 x =
m_lu.template triangularView<Upper>().
solve(x);
85 &&
"IncompleteLU::solve(): invalid number of rows of the right hand side matrix b");
96 template<
typename _MatrixType,
typename Rhs>
103 template<typename Dest>
void evalTo(Dest& dst)
const 105 dec()._solve(
rhs(),dst);
113 #endif // EIGEN_INCOMPLETE_LU_H Matrix< Scalar, Dynamic, 1 > Vector
internal::traits< Derived >::Index Index
iterative scaling algorithm to equilibrate rows and column norms in matrices
Matrix< Scalar, Dynamic, Dynamic > MatrixType
const internal::solve_retval< IncompleteLU, Rhs > solve(const MatrixBase< Rhs > &b) const
IncompleteLU & compute(const MatrixType &mat)
void rhs(const real_t *x, real_t *f)
void _solve(const Rhs &b, Dest &x) const
IncompleteLU(const MatrixType &mat)
#define EIGEN_MAKE_SOLVE_HELPERS(DecompositionType, Rhs)
SparseMatrix< Scalar, RowMajor > FactorType
EIGEN_STRONG_INLINE Index cols() const
Base class for all dense matrices, vectors, and expressions.
IncompleteLU< _MatrixType > Dec