43 #include "../Core/util/NonMPL2.h" 45 #ifndef EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H 46 #define EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H 50 template<
typename Derived>
54 m_matrix.resize(size, size);
55 m_parent.resize(size);
56 m_nonZerosPerCol.resize(size);
65 m_nonZerosPerCol[k] = 0;
72 for(; tags[i] != k; i = m_parent[i])
75 if (m_parent[i] == -1)
77 m_nonZerosPerCol[i]++;
88 Lp[k+1] = Lp[k] + m_nonZerosPerCol[k] + (doLDLT ? 0 : 1);
90 m_matrix.resizeNonZeros(Lp[size]);
92 m_isInitialized =
true;
94 m_analysisIsOk =
true;
95 m_factorizationIsOk =
false;
99 template<
typename Derived>
100 template<
bool DoLDLT>
105 eigen_assert(m_analysisIsOk &&
"You must first call analyzePattern()");
113 Scalar* Lx = m_matrix.valuePtr();
120 m_diag.resize(DoLDLT ? size : 0);
128 m_nonZerosPerCol[k] = 0;
136 for(len = 0; tags[i] != k; i = m_parent[i])
142 pattern[--top] = pattern[--len];
150 for(; top <
size; ++top)
152 Index i = pattern[top];
159 l_ki = yi / m_diag[i];
161 yi = l_ki = yi / Lx[Lp[i]];
163 Index p2 = Lp[i] + m_nonZerosPerCol[i];
165 for(p = Lp[i] + (DoLDLT ? 0 : 1); p < p2; ++p)
170 ++m_nonZerosPerCol[i];
183 Index p = Lp[k] + m_nonZerosPerCol[k]++;
194 m_factorizationIsOk =
true;
199 #endif // EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H
const AutoDiffScalar< DerType > & conj(const AutoDiffScalar< DerType > &x)
EIGEN_DEVICE_FUNC RealReturnType real() const
EIGEN_DEVICE_FUNC const SqrtReturnType sqrt() const
static constexpr size_t size(Tuple< Args... > &)
Provides access to the number of elements in a tuple as a compile-time constant expression.
void analyzePattern_preordered(const CholMatrixType &a, bool doLDLT)
MatrixType::Scalar Scalar
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Base::InnerIterator InnerIterator
MatrixType::RealScalar RealScalar
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
MatrixType::StorageIndex StorageIndex
void factorize_preordered(const CholMatrixType &a)