20#ifndef EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H
21#define EIGEN_SIMPLICIAL_CHOLESKY_IMPL_H
25template<
typename Derived>
30 m_parent.resize(
size);
31 m_nonZerosPerCol.resize(
size);
40 m_nonZerosPerCol[k] = 0;
47 for(; tags[i] != k; i = m_parent[i])
50 if (m_parent[i] == -1)
52 m_nonZerosPerCol[i]++;
63 Lp[k+1] = Lp[k] + m_nonZerosPerCol[k] + (doLDLT ? 0 : 1);
65 m_matrix.resizeNonZeros(Lp[
size]);
67 m_isInitialized =
true;
69 m_analysisIsOk =
true;
70 m_factorizationIsOk =
false;
74template<
typename Derived>
80 eigen_assert(m_analysisIsOk &&
"You must first call analyzePattern()");
88 Scalar* Lx = m_matrix.valuePtr();
95 m_diag.resize(DoLDLT ?
size : 0);
103 m_nonZerosPerCol[k] = 0;
109 y[i] += numext::conj(it.value());
111 for(len = 0; tags[i] != k; i = m_parent[i])
117 pattern[--top] = pattern[--len];
125 for(; top <
size; ++top)
127 Index i = pattern[top];
136 yi = l_ki = yi / Lx[Lp[i]];
138 Index p2 = Lp[i] + m_nonZerosPerCol[i];
140 for(p = Lp[i] + (DoLDLT ? 0 : 1); p < p2; ++p)
141 y[Li[p]] -= numext::conj(Lx[p]) * yi;
145 ++m_nonZerosPerCol[i];
158 Index p = Lp[k] + m_nonZerosPerCol[k]++;
169 m_factorizationIsOk =
true;
EIGEN_DEVICE_FUNC RealReturnType real() const
Definition: CommonCwiseUnaryOps.h:100
#define eigen_assert(x)
Definition: Macros.h:1047
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
Definition: Memory.h:768
MatrixType::RealScalar RealScalar
Definition: SimplicialCholesky.h:65
void factorize_preordered(const CholMatrixType &a)
Definition: SimplicialCholesky_impl.h:76
MatrixType::Scalar Scalar
Definition: SimplicialCholesky.h:64
MatrixType::StorageIndex StorageIndex
Definition: SimplicialCholesky.h:66
void analyzePattern_preordered(const CholMatrixType &a, bool doLDLT)
Definition: SimplicialCholesky_impl.h:26
Base::InnerIterator InnerIterator
Definition: SparseMatrix.h:114
Index rows() const
Definition: SparseMatrix.h:138
Index cols() const
Definition: SparseMatrix.h:140
auto sqrt(const UnitType &value) noexcept -> unit_t< square_root< typename units::traits::unit_t_traits< UnitType >::unit_type >, typename units::traits::unit_t_traits< UnitType >::underlying_type, linear_scale >
computes the square root of value
Definition: math.h:483
@ NumericalIssue
The provided data did not satisfy the prerequisites.
Definition: Constants.h:444
@ Success
Computation was successful.
Definition: Constants.h:442
const Scalar & y
Definition: MathFunctions.h:821
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
Namespace containing all symbols from the Eigen library.
Definition: MatrixExponential.h:16
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:74