Eigen::SimplicialCholeskyBase< Derived > Class Template Reference

A base class for direct sparse Cholesky factorizations. More...

#include <SimplicialCholesky.h>

+ Inheritance diagram for Eigen::SimplicialCholeskyBase< Derived >:

Classes

struct  keep_diag
 

Public Types

enum  { UpLo = internal::traits<Derived>::UpLo }
 
enum  { ColsAtCompileTime = MatrixType::ColsAtCompileTime , MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime }
 
typedef internal::traits< Derived >::MatrixType MatrixType
 
typedef internal::traits< Derived >::OrderingType OrderingType
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::RealScalar RealScalar
 
typedef internal::traits< Derived >::DiagonalScalar DiagonalScalar
 
typedef MatrixType::StorageIndex StorageIndex
 
typedef SparseMatrix< Scalar, ColMajor, StorageIndexCholMatrixType
 
typedef CholMatrixType const * ConstCholMatrixPtr
 
typedef Matrix< Scalar, Dynamic, 1 > VectorType
 
typedef Matrix< StorageIndex, Dynamic, 1 > VectorI
 

Public Member Functions

 SimplicialCholeskyBase ()
 
 SimplicialCholeskyBase (const MatrixType &matrix)
 
 ~SimplicialCholeskyBase ()
 
Derived & derived ()
 
const Derived & derived () const
 
Index cols () const
 
Index rows () const
 
ComputationInfo info () const
 Reports whether previous computation was successful. More...
 
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationP () const
 
const PermutationMatrix< Dynamic, Dynamic, StorageIndex > & permutationPinv () const
 
Derived & setShift (const DiagonalScalar &offset, const DiagonalScalar &scale=1)
 
template<typename Stream >
void dumpMemory (Stream &s)
 
template<typename Rhs , typename Dest >
void _solve_impl (const MatrixBase< Rhs > &b, MatrixBase< Dest > &dest) const
 
template<typename Rhs , typename Dest >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 
Derived & derived ()
 
const Derived & derived () const
 
- Public Member Functions inherited from Eigen::SparseSolverBase< Derived >
 SparseSolverBase ()
 
 SparseSolverBase (SparseSolverBase &&other)
 
 ~SparseSolverBase ()
 
Derived & derived ()
 
const Derived & derived () const
 
template<typename Rhs >
const Solve< Derived, Rhs > solve (const MatrixBase< Rhs > &b) const
 
template<typename Rhs >
const Solve< Derived, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
template<typename Rhs , typename Dest >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 

Protected Member Functions

template<bool DoLDLT, bool NonHermitian>
void compute (const MatrixType &matrix)
 
template<bool DoLDLT, bool NonHermitian>
void factorize (const MatrixType &a)
 
template<bool DoLDLT, bool NonHermitian>
void factorize_preordered (const CholMatrixType &a)
 
template<bool DoLDLT, bool NonHermitian>
void analyzePattern (const MatrixType &a)
 
void analyzePattern_preordered (const CholMatrixType &a, bool doLDLT)
 
template<bool NonHermitian>
void ordering (const MatrixType &a, ConstCholMatrixPtr &pmat, CholMatrixType &ap)
 
DiagonalScalar getDiag (Scalar x)
 
Scalar getSymm (Scalar x)
 

Protected Attributes

ComputationInfo m_info
 
bool m_factorizationIsOk
 
bool m_analysisIsOk
 
CholMatrixType m_matrix
 
VectorType m_diag
 
VectorI m_parent
 
VectorI m_workSpace
 
PermutationMatrix< Dynamic, Dynamic, StorageIndexm_P
 
PermutationMatrix< Dynamic, Dynamic, StorageIndexm_Pinv
 
DiagonalScalar m_shiftOffset
 
DiagonalScalar m_shiftScale
 
- Protected Attributes inherited from Eigen::SparseSolverBase< Derived >
bool m_isInitialized
 

Private Types

typedef SparseSolverBase< Derived > Base
 

Private Attributes

bool m_isInitialized
 

Detailed Description

template<typename Derived>
class Eigen::SimplicialCholeskyBase< Derived >

A base class for direct sparse Cholesky factorizations.

This is a base class for LL^T and LDL^T Cholesky factorizations of sparse matrices that are selfadjoint and positive definite. These factorizations allow for solving A.X = B where X and B can be either dense or sparse.

In order to reduce the fill-in, a symmetric permutation P is applied prior to the factorization such that the factorized matrix is P A P^-1.

Template Parameters
Derivedthe type of the derived class, that is the actual factorization type.

Member Typedef Documentation

◆ Base

template<typename Derived >
typedef SparseSolverBase<Derived> Eigen::SimplicialCholeskyBase< Derived >::Base
private

◆ CholMatrixType

template<typename Derived >
typedef SparseMatrix<Scalar, ColMajor, StorageIndex> Eigen::SimplicialCholeskyBase< Derived >::CholMatrixType

◆ ConstCholMatrixPtr

template<typename Derived >
typedef CholMatrixType const* Eigen::SimplicialCholeskyBase< Derived >::ConstCholMatrixPtr

◆ DiagonalScalar

template<typename Derived >
typedef internal::traits<Derived>::DiagonalScalar Eigen::SimplicialCholeskyBase< Derived >::DiagonalScalar

◆ MatrixType

template<typename Derived >
typedef internal::traits<Derived>::MatrixType Eigen::SimplicialCholeskyBase< Derived >::MatrixType

◆ OrderingType

template<typename Derived >
typedef internal::traits<Derived>::OrderingType Eigen::SimplicialCholeskyBase< Derived >::OrderingType

◆ RealScalar

template<typename Derived >
typedef MatrixType::RealScalar Eigen::SimplicialCholeskyBase< Derived >::RealScalar

◆ Scalar

template<typename Derived >
typedef MatrixType::Scalar Eigen::SimplicialCholeskyBase< Derived >::Scalar

◆ StorageIndex

template<typename Derived >
typedef MatrixType::StorageIndex Eigen::SimplicialCholeskyBase< Derived >::StorageIndex

◆ VectorI

template<typename Derived >
typedef Matrix<StorageIndex, Dynamic, 1> Eigen::SimplicialCholeskyBase< Derived >::VectorI

◆ VectorType

template<typename Derived >
typedef Matrix<Scalar, Dynamic, 1> Eigen::SimplicialCholeskyBase< Derived >::VectorType

Member Enumeration Documentation

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
UpLo 
58 { UpLo = internal::traits<Derived>::UpLo };
@ UpLo
Definition: SimplicialCholesky.h:58

◆ anonymous enum

template<typename Derived >
anonymous enum
Enumerator
ColsAtCompileTime 
MaxColsAtCompileTime 
68 { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
@ ColsAtCompileTime
Definition: SimplicialCholesky.h:68
@ MaxColsAtCompileTime
Definition: SimplicialCholesky.h:68

Constructor & Destructor Documentation

◆ SimplicialCholeskyBase() [1/2]

template<typename Derived >
Eigen::SimplicialCholeskyBase< Derived >::SimplicialCholeskyBase ( )
inline

Default constructor

bool m_analysisIsOk
Definition: SimplicialCholesky.h:238
DiagonalScalar m_shiftScale
Definition: SimplicialCholesky.h:248
DiagonalScalar m_shiftOffset
Definition: SimplicialCholesky.h:247
bool m_factorizationIsOk
Definition: SimplicialCholesky.h:237
ComputationInfo m_info
Definition: SimplicialCholesky.h:236
@ Success
Definition: Constants.h:440

◆ SimplicialCholeskyBase() [2/2]

template<typename Derived >
Eigen::SimplicialCholeskyBase< Derived >::SimplicialCholeskyBase ( const MatrixType matrix)
inlineexplicit
79  derived().compute(matrix);
80  }
Derived & derived()
Definition: SimplicialCholesky.h:84
Eigen::Map< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor >, 0, Eigen::OuterStride<> > matrix(T *data, int rows, int cols, int stride)
Definition: common.h:85

References Eigen::SimplicialCholeskyBase< Derived >::derived(), and matrix().

◆ ~SimplicialCholeskyBase()

template<typename Derived >
Eigen::SimplicialCholeskyBase< Derived >::~SimplicialCholeskyBase ( )
inline
82 {}

Member Function Documentation

◆ _solve_impl() [1/2]

template<typename Derived >
template<typename Rhs , typename Dest >
void Eigen::SimplicialCholeskyBase< Derived >::_solve_impl ( const MatrixBase< Rhs > &  b,
MatrixBase< Dest > &  dest 
) const
inline
149  {
151  "The decomposition is not in a valid state for solving, you must first call either compute() or "
152  "symbolic()/numeric()");
153  eigen_assert(m_matrix.rows() == b.rows());
154 
155  if (m_info != Success) return;
156 
157  if (m_P.size() > 0)
158  dest = m_P * b;
159  else
160  dest = b;
161 
162  if (m_matrix.nonZeros() > 0) // otherwise L==I
163  derived().matrixL().solveInPlace(dest);
164 
165  if (m_diag.size() > 0) dest = m_diag.asDiagonal().inverse() * dest;
166 
167  if (m_matrix.nonZeros() > 0) // otherwise U==I
168  derived().matrixU().solveInPlace(dest);
169 
170  if (m_P.size() > 0) dest = m_Pinv * dest;
171  }
#define eigen_assert(x)
Definition: Macros.h:910
Scalar * b
Definition: benchVecAdd.cpp:17
EIGEN_DEVICE_FUNC Index size() const
Definition: PermutationMatrix.h:96
CholMatrixType m_matrix
Definition: SimplicialCholesky.h:240
VectorType m_diag
Definition: SimplicialCholesky.h:241
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_Pinv
Definition: SimplicialCholesky.h:245
PermutationMatrix< Dynamic, Dynamic, StorageIndex > m_P
Definition: SimplicialCholesky.h:244
Index nonZeros() const
Definition: SparseCompressedBase.h:64
Index rows() const
Definition: SparseMatrix.h:159

References b, Eigen::SimplicialCholeskyBase< Derived >::derived(), eigen_assert, Eigen::SimplicialCholeskyBase< Derived >::m_diag, Eigen::SimplicialCholeskyBase< Derived >::m_factorizationIsOk, Eigen::SimplicialCholeskyBase< Derived >::m_info, Eigen::SimplicialCholeskyBase< Derived >::m_matrix, Eigen::SimplicialCholeskyBase< Derived >::m_P, Eigen::SimplicialCholeskyBase< Derived >::m_Pinv, Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::nonZeros(), Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::rows(), Eigen::PermutationBase< Derived >::size(), and Eigen::Success.

◆ _solve_impl() [2/2]

template<typename Derived >
template<typename Rhs , typename Dest >
void Eigen::SimplicialCholeskyBase< Derived >::_solve_impl ( const SparseMatrixBase< Rhs > &  b,
SparseMatrixBase< Dest > &  dest 
) const
inline
174  {
176  }
std::enable_if_t< Rhs::ColsAtCompileTime !=1 &&Dest::ColsAtCompileTime !=1 > solve_sparse_through_dense_panels(const Decomposition &dec, const Rhs &rhs, Dest &dest)
Definition: SparseSolverBase.h:25

References b, Eigen::SimplicialCholeskyBase< Derived >::derived(), and Eigen::internal::solve_sparse_through_dense_panels().

◆ analyzePattern()

template<typename Derived >
template<bool DoLDLT, bool NonHermitian>
void Eigen::SimplicialCholeskyBase< Derived >::analyzePattern ( const MatrixType a)
inlineprotected
215  {
216  eigen_assert(a.rows() == a.cols());
217  Index size = a.cols();
219  ConstCholMatrixPtr pmat;
220  ordering<NonHermitian>(a, pmat, tmp);
221  analyzePattern_preordered(*pmat, DoLDLT);
222  }
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
CholMatrixType const * ConstCholMatrixPtr
Definition: SimplicialCholesky.h:64
SparseMatrix< Scalar, ColMajor, StorageIndex > CholMatrixType
Definition: SimplicialCholesky.h:63
void analyzePattern_preordered(const CholMatrixType &a, bool doLDLT)
Definition: SimplicialCholesky_impl.h:280
const Scalar * a
Definition: level2_cplx_impl.h:32
Eigen::Matrix< Scalar, Dynamic, Dynamic, ColMajor > tmp
Definition: level3_impl.h:365
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83

References a, Eigen::SimplicialCholeskyBase< Derived >::analyzePattern_preordered(), eigen_assert, size, and tmp.

◆ analyzePattern_preordered()

template<typename Derived >
void Eigen::SimplicialCholeskyBase< Derived >::analyzePattern_preordered ( const CholMatrixType a,
bool  doLDLT 
)
protected
280  {
281  using Helper = internal::simpl_chol_helper<Scalar, StorageIndex>;
282 
283  eigen_assert(ap.innerSize() == ap.outerSize());
284  const StorageIndex size = internal::convert_index<StorageIndex>(ap.outerSize());
285 
287 
288  m_isInitialized = true;
289  m_info = Success;
290  m_analysisIsOk = true;
291  m_factorizationIsOk = false;
292 }
VectorI m_parent
Definition: SimplicialCholesky.h:242
MatrixType::StorageIndex StorageIndex
Definition: SimplicialCholesky.h:62
bool m_isInitialized
Definition: SparseSolverBase.h:110
VectorI m_workSpace
Definition: SimplicialCholesky.h:243
Scalar * ap
Definition: level2_cplx_impl.h:161
void run(const string &dir_name, LinearSolver *linear_solver_pt, const unsigned nel_1d, bool mess_up_order)
Definition: two_d_poisson_compare_solvers.cc:317

References ap, eigen_assert, run(), size, and Eigen::Success.

Referenced by Eigen::SimplicialCholeskyBase< Derived >::analyzePattern(), and Eigen::SimplicialCholeskyBase< Derived >::compute().

◆ cols()

◆ compute()

template<typename Derived >
template<bool DoLDLT, bool NonHermitian>
void Eigen::SimplicialCholeskyBase< Derived >::compute ( const MatrixType matrix)
inlineprotected

Computes the sparse Cholesky decomposition of matrix

183  {
184  eigen_assert(matrix.rows() == matrix.cols());
185  Index size = matrix.cols();
187  ConstCholMatrixPtr pmat;
188  ordering<NonHermitian>(matrix, pmat, tmp);
189  analyzePattern_preordered(*pmat, DoLDLT);
190  factorize_preordered<DoLDLT, NonHermitian>(*pmat);
191  }

References Eigen::SimplicialCholeskyBase< Derived >::analyzePattern_preordered(), eigen_assert, matrix(), size, and tmp.

◆ derived() [1/4]

template<typename Derived >
Derived& Eigen::SparseSolverBase< Derived >::derived
inline
76 { return *static_cast<Derived*>(this); }

◆ derived() [2/4]

template<typename Derived >
Derived& Eigen::SimplicialCholeskyBase< Derived >::derived ( )
inline

◆ derived() [3/4]

template<typename Derived >
const Derived& Eigen::SparseSolverBase< Derived >::derived
inline
77 { return *static_cast<const Derived*>(this); }

◆ derived() [4/4]

template<typename Derived >
const Derived& Eigen::SimplicialCholeskyBase< Derived >::derived ( ) const
inline
85 { return *static_cast<const Derived*>(this); }

◆ dumpMemory()

template<typename Derived >
template<typename Stream >
void Eigen::SimplicialCholeskyBase< Derived >::dumpMemory ( Stream s)
inline
127  {
128  int total = 0;
129  s << " L: "
130  << ((total += (m_matrix.cols() + 1) * sizeof(int) + m_matrix.nonZeros() * (sizeof(int) + sizeof(Scalar))) >> 20)
131  << "Mb"
132  << "\n";
133  s << " diag: " << ((total += m_diag.size() * sizeof(Scalar)) >> 20) << "Mb"
134  << "\n";
135  s << " tree: " << ((total += m_parent.size() * sizeof(int)) >> 20) << "Mb"
136  << "\n";
137  s << " nonzeros: " << ((total += m_workSpace.size() * sizeof(int)) >> 20) << "Mb"
138  << "\n";
139  s << " perm: " << ((total += m_P.size() * sizeof(int)) >> 20) << "Mb"
140  << "\n";
141  s << " perm^-1: " << ((total += m_Pinv.size() * sizeof(int)) >> 20) << "Mb"
142  << "\n";
143  s << " TOTAL: " << (total >> 20) << "Mb"
144  << "\n";
145  }
SCALAR Scalar
Definition: bench_gemm.cpp:45
MatrixType::Scalar Scalar
Definition: SimplicialCholesky.h:59
RealScalar s
Definition: level1_cplx_impl.h:130
return int(ret)+1

References Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::cols(), int(), Eigen::SimplicialCholeskyBase< Derived >::m_diag, Eigen::SimplicialCholeskyBase< Derived >::m_matrix, Eigen::SimplicialCholeskyBase< Derived >::m_P, Eigen::SimplicialCholeskyBase< Derived >::m_parent, Eigen::SimplicialCholeskyBase< Derived >::m_Pinv, Eigen::SimplicialCholeskyBase< Derived >::m_workSpace, Eigen::SparseMatrix< Scalar_, Options_, StorageIndex_ >::nonZeros(), s, and Eigen::PermutationBase< Derived >::size().

◆ factorize()

template<typename Derived >
template<bool DoLDLT, bool NonHermitian>
void Eigen::SimplicialCholeskyBase< Derived >::factorize ( const MatrixType a)
inlineprotected
194  {
195  eigen_assert(a.rows() == a.cols());
196  Index size = a.cols();
198  ConstCholMatrixPtr pmat;
199 
200  if (m_P.size() == 0 && (int(UpLo) & int(Upper)) == Upper) {
201  // If there is no ordering, try to directly use the input matrix without any copy
203  } else {
204  internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, tmp, m_P.indices().data());
205  pmat = &tmp;
206  }
207 
208  factorize_preordered<DoLDLT, NonHermitian>(*pmat);
209  }
const IndicesType & indices() const
Definition: PermutationMatrix.h:334
@ Upper
Definition: Constants.h:213
static void run(const InputMatrixType &input, ConstCholMatrixPtr &pmat, CholMatrixType &tmp)
Definition: SimplicialCholesky.h:24

References a, eigen_assert, Eigen::PermutationMatrix< SizeAtCompileTime, MaxSizeAtCompileTime, StorageIndex_ >::indices(), Eigen::SimplicialCholeskyBase< Derived >::m_P, Eigen::internal::simplicial_cholesky_grab_input< CholMatrixType, InputMatrixType >::run(), size, Eigen::PermutationBase< Derived >::size(), tmp, Eigen::SimplicialCholeskyBase< Derived >::UpLo, and Eigen::Upper.

◆ factorize_preordered()

template<typename Derived >
template<bool DoLDLT, bool NonHermitian>
void Eigen::SimplicialCholeskyBase< Derived >::factorize_preordered ( const CholMatrixType a)
protected
296  {
297  using std::sqrt;
298  const StorageIndex size = StorageIndex(ap.rows());
299 
300  eigen_assert(m_analysisIsOk && "You must first call analyzePattern()");
301  eigen_assert(ap.rows() == ap.cols());
302  eigen_assert(m_parent.size() == size);
303  eigen_assert(m_workSpace.size() >= 3 * size);
304 
305  const StorageIndex* Lp = m_matrix.outerIndexPtr();
307  Scalar* Lx = m_matrix.valuePtr();
308 
310  StorageIndex* nonZerosPerCol = m_workSpace.data();
311  StorageIndex* pattern = m_workSpace.data() + size;
312  StorageIndex* tags = m_workSpace.data() + 2 * size;
313 
314  bool ok = true;
315  m_diag.resize(DoLDLT ? size : 0);
316 
317  for (StorageIndex k = 0; k < size; ++k) {
318  // compute nonzero pattern of kth row of L, in topological order
319  y[k] = Scalar(0); // Y(0:k) is now all zero
320  StorageIndex top = size; // stack for pattern is empty
321  tags[k] = k; // mark node k as visited
322  nonZerosPerCol[k] = 0; // count of nonzeros in column k of L
323  for (typename CholMatrixType::InnerIterator it(ap, k); it; ++it) {
324  StorageIndex i = it.index();
325  if (i <= k) {
326  y[i] += getSymm(it.value()); /* scatter A(i,k) into Y (sum duplicates) */
327  Index len;
328  for (len = 0; tags[i] != k; i = m_parent[i]) {
329  pattern[len++] = i; /* L(k,i) is nonzero */
330  tags[i] = k; /* mark i as visited */
331  }
332  while (len > 0) pattern[--top] = pattern[--len];
333  }
334  }
335 
336  /* compute numerical values kth row of L (a sparse triangular solve) */
337 
338  DiagonalScalar d =
339  getDiag(y[k]) * m_shiftScale + m_shiftOffset; // get D(k,k), apply the shift function, and clear Y(k)
340  y[k] = Scalar(0);
341  for (; top < size; ++top) {
342  Index i = pattern[top]; /* pattern[top:n-1] is pattern of L(:,k) */
343  Scalar yi = y[i]; /* get and clear Y(i) */
344  y[i] = Scalar(0);
345 
346  /* the nonzero entry L(k,i) */
347  Scalar l_ki;
348  if (DoLDLT)
349  l_ki = yi / getDiag(m_diag[i]);
350  else
351  yi = l_ki = yi / Lx[Lp[i]];
352 
353  Index p2 = Lp[i] + nonZerosPerCol[i];
354  Index p;
355  for (p = Lp[i] + (DoLDLT ? 0 : 1); p < p2; ++p) y[Li[p]] -= getSymm(Lx[p]) * yi;
356  d -= getDiag(l_ki * getSymm(yi));
357  Li[p] = k; /* store L(k,i) in column form of L */
358  Lx[p] = l_ki;
359  ++nonZerosPerCol[i]; /* increment count of nonzeros in col i */
360  }
361  if (DoLDLT) {
362  m_diag[k] = d;
363  if (d == RealScalar(0)) {
364  ok = false; /* failure, D(k,k) is zero */
365  break;
366  }
367  } else {
368  Index p = Lp[k] + nonZerosPerCol[k]++;
369  Li[p] = k; /* store L(k,k) = sqrt (d) in column k */
370  if (NonHermitian ? d == RealScalar(0) : numext::real(d) <= RealScalar(0)) {
371  ok = false; /* failure, matrix is not positive definite */
372  break;
373  }
374  Lx[p] = sqrt(d);
375  }
376  }
377 
378  m_info = ok ? Success : NumericalIssue;
379  m_factorizationIsOk = true;
380 }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define ei_declare_aligned_stack_constructed_variable(TYPE, NAME, SIZE, BUFFER)
Definition: Memory.h:806
float * p
Definition: Tutorial_Map_using.cpp:9
constexpr EIGEN_DEVICE_FUNC const Scalar * data() const
Definition: PlainObjectBase.h:273
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:294
MatrixType::RealScalar RealScalar
Definition: SimplicialCholesky.h:60
internal::traits< Derived >::DiagonalScalar DiagonalScalar
Definition: SimplicialCholesky.h:61
Scalar getSymm(Scalar x)
Definition: SimplicialCholesky.h:229
DiagonalScalar getDiag(Scalar x)
Definition: SimplicialCholesky.h:228
const Scalar * valuePtr() const
Definition: SparseMatrix.h:171
Base::InnerIterator InnerIterator
Definition: SparseMatrix.h:138
const StorageIndex * outerIndexPtr() const
Definition: SparseMatrix.h:189
const StorageIndex * innerIndexPtr() const
Definition: SparseMatrix.h:180
float real
Definition: datatypes.h:10
@ NumericalIssue
Definition: Constants.h:442
Scalar * y
Definition: level1_cplx_impl.h:128
char char char int int * k
Definition: level2_impl.h:374
double Lx
Length of domain in x direction.
Definition: periodic_load.cc:55

References ap, ei_declare_aligned_stack_constructed_variable, eigen_assert, i, k, Global_Parameters::Lx, Eigen::NumericalIssue, p, size, sqrt(), Eigen::Success, and y.

◆ getDiag()

template<typename Derived >
DiagonalScalar Eigen::SimplicialCholeskyBase< Derived >::getDiag ( Scalar  x)
inlineprotected
228 { return internal::traits<Derived>::getDiag(x); }
list x
Definition: plotDoE.py:28

References plotDoE::x.

◆ getSymm()

template<typename Derived >
Scalar Eigen::SimplicialCholeskyBase< Derived >::getSymm ( Scalar  x)
inlineprotected
229 { return internal::traits<Derived>::getSymm(x); }

References plotDoE::x.

◆ info()

template<typename Derived >
ComputationInfo Eigen::SimplicialCholeskyBase< Derived >::info ( ) const
inline

Reports whether previous computation was successful.

Returns
Success if computation was successful, NumericalIssue if the matrix.appears to be negative.
95  {
96  eigen_assert(m_isInitialized && "Decomposition is not initialized.");
97  return m_info;
98  }

References eigen_assert, Eigen::SimplicialCholeskyBase< Derived >::m_info, and Eigen::SimplicialCholeskyBase< Derived >::m_isInitialized.

◆ ordering()

template<typename Derived >
template<bool NonHermitian>
void Eigen::SimplicialCholeskyBase< Derived >::ordering ( const MatrixType a,
ConstCholMatrixPtr pmat,
CholMatrixType ap 
)
protected
828  {
829  eigen_assert(a.rows() == a.cols());
830  const Index size = a.rows();
831  pmat = &ap;
832  // Note that ordering methods compute the inverse permutation
833  if (!internal::is_same<OrderingType, NaturalOrdering<StorageIndex> >::value) {
834  {
836  internal::permute_symm_to_fullsymm<UpLo, NonHermitian>(a, C, NULL);
837 
839  ordering(C, m_Pinv);
840  }
841 
842  if (m_Pinv.size() > 0)
843  m_P = m_Pinv.inverse();
844  else
845  m_P.resize(0);
846 
847  ap.resize(size, size);
848  internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap, m_P.indices().data());
849  } else {
850  m_Pinv.resize(0);
851  m_P.resize(0);
852  if (int(UpLo) == int(Lower) || MatrixType::IsRowMajor) {
853  // we have to transpose the lower part to to the upper one
854  ap.resize(size, size);
855  internal::permute_symm_to_symm<UpLo, Upper, NonHermitian>(a, ap, NULL);
856  } else
858  }
859 }
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:49
void resize(Index newSize)
Definition: PermutationMatrix.h:119
InverseReturnType inverse() const
Definition: PermutationMatrix.h:172
void ordering(const MatrixType &a, ConstCholMatrixPtr &pmat, CholMatrixType &ap)
Definition: SimplicialCholesky.h:828
internal::traits< Derived >::OrderingType OrderingType
Definition: SimplicialCholesky.h:57
Definition: matrices.h:74
@ Lower
Definition: Constants.h:211
squared absolute value
Definition: GlobalFunctions.h:87

References a, ap, eigen_assert, Eigen::Lower, Eigen::internal::simplicial_cholesky_grab_input< CholMatrixType, InputMatrixType >::run(), size, and Eigen::value.

◆ permutationP()

template<typename Derived >
const PermutationMatrix<Dynamic, Dynamic, StorageIndex>& Eigen::SimplicialCholeskyBase< Derived >::permutationP ( ) const
inline
Returns
the permutation P
See also
permutationPinv()
102 { return m_P; }

References Eigen::SimplicialCholeskyBase< Derived >::m_P.

◆ permutationPinv()

template<typename Derived >
const PermutationMatrix<Dynamic, Dynamic, StorageIndex>& Eigen::SimplicialCholeskyBase< Derived >::permutationPinv ( ) const
inline
Returns
the inverse P^-1 of the permutation P
See also
permutationP()
106 { return m_Pinv; }

References Eigen::SimplicialCholeskyBase< Derived >::m_Pinv.

◆ rows()

◆ setShift()

template<typename Derived >
Derived& Eigen::SimplicialCholeskyBase< Derived >::setShift ( const DiagonalScalar offset,
const DiagonalScalar scale = 1 
)
inline

Sets the shift parameters that will be used to adjust the diagonal coefficients during the numerical factorization.

During the numerical factorization, the diagonal coefficients are transformed by the following linear model:
d_ii = offset + scale * d_ii

The default is the identity transformation with offset=0, and scale=1.

Returns
a reference to *this.
118  {
119  m_shiftOffset = offset;
120  m_shiftScale = scale;
121  return derived();
122  }

References Eigen::SimplicialCholeskyBase< Derived >::derived(), Eigen::SimplicialCholeskyBase< Derived >::m_shiftOffset, and Eigen::SimplicialCholeskyBase< Derived >::m_shiftScale.

Member Data Documentation

◆ m_analysisIsOk

template<typename Derived >
bool Eigen::SimplicialCholeskyBase< Derived >::m_analysisIsOk
protected

◆ m_diag

◆ m_factorizationIsOk

◆ m_info

◆ m_isInitialized

template<typename Derived >
bool Eigen::SparseSolverBase< Derived >::m_isInitialized
mutableprivate

◆ m_matrix

◆ m_P

◆ m_parent

template<typename Derived >
VectorI Eigen::SimplicialCholeskyBase< Derived >::m_parent
protected

◆ m_Pinv

◆ m_shiftOffset

template<typename Derived >
DiagonalScalar Eigen::SimplicialCholeskyBase< Derived >::m_shiftOffset
protected

◆ m_shiftScale

template<typename Derived >
DiagonalScalar Eigen::SimplicialCholeskyBase< Derived >::m_shiftScale
protected

◆ m_workSpace

template<typename Derived >
VectorI Eigen::SimplicialCholeskyBase< Derived >::m_workSpace
protected

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