20 #ifndef EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H
21 #define EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H
27 template<
typename Derived>
32 m_parent.resize(
size);
33 m_nonZerosPerCol.resize(
size);
42 m_nonZerosPerCol[k] = 0;
43 for(
typename CholMatrixType::InnerIterator it(ap,k); it; ++it)
49 for(; tags[
i] != k;
i = m_parent[
i])
52 if (m_parent[
i] == -1)
54 m_nonZerosPerCol[
i]++;
65 Lp[k+1] = Lp[k] + m_nonZerosPerCol[k] + (doLDLT ? 0 : 1);
67 m_matrix.resizeNonZeros(Lp[
size]);
69 m_isInitialized =
true;
71 m_analysisIsOk =
true;
72 m_factorizationIsOk =
false;
76 template<
typename Derived>
82 eigen_assert(m_analysisIsOk &&
"You must first call analyzePattern()");
90 Scalar* Lx = m_matrix.valuePtr();
97 m_diag.resize(DoLDLT ?
size : 0);
105 m_nonZerosPerCol[k] = 0;
106 for(
typename CholMatrixType::InnerIterator it(ap,k); it; ++it)
113 for(len = 0; tags[
i] != k;
i = m_parent[
i])
119 pattern[--top] = pattern[--len];
127 for(; top <
size; ++top)
138 yi = l_ki = yi / Lx[Lp[
i]];
140 Index p2 = Lp[
i] + m_nonZerosPerCol[
i];
142 for(
p = Lp[
i] + (DoLDLT ? 0 : 1);
p < p2; ++
p)
147 ++m_nonZerosPerCol[
i];
160 Index p = Lp[k] + m_nonZerosPerCol[k]++;
171 m_factorizationIsOk =
true;
const SqrtReturnType sqrt() const
RealReturnType real() const
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
MatrixType::RealScalar RealScalar
void factorize_preordered(const CholMatrixType &a)
MatrixType::Scalar Scalar
MatrixType::StorageIndex StorageIndex
void analyzePattern_preordered(const CholMatrixType &a, bool doLDLT)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_conjugate_op< typename Derived::Scalar >, const Derived > conj(const Eigen::ArrayBase< Derived > &x)
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)