Eigen  3.4.90 (git rev 5a9f66fb35d03a4da9ef8976e67a61b30aa16dcf)
 
Loading...
Searching...
No Matches
SparseLUImpl.h
1// This file is part of Eigen, a lightweight C++ template library
2// for linear algebra.
3//
4// Copyright (C) 2012 Désiré Nuentsa-Wakam <[email protected]>
5//
6// This Source Code Form is subject to the terms of the Mozilla
7// Public License v. 2.0. If a copy of the MPL was not distributed
8// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9#ifndef SPARSELU_IMPL_H
10#define SPARSELU_IMPL_H
11
12// IWYU pragma: private
13#include "./InternalHeaderCheck.h"
14
15namespace Eigen {
16namespace internal {
17
22template <typename Scalar, typename StorageIndex>
23class SparseLUImpl {
24 public:
25 typedef Matrix<Scalar, Dynamic, 1> ScalarVector;
26 typedef Matrix<StorageIndex, Dynamic, 1> IndexVector;
27 typedef Matrix<Scalar, Dynamic, Dynamic, ColMajor> ScalarMatrix;
28 typedef Map<ScalarMatrix, 0, OuterStride<> > MappedMatrixBlock;
29 typedef typename ScalarVector::RealScalar RealScalar;
30 typedef Ref<Matrix<Scalar, Dynamic, 1> > BlockScalarVector;
31 typedef Ref<Matrix<StorageIndex, Dynamic, 1> > BlockIndexVector;
32 typedef LU_GlobalLU_t<IndexVector, ScalarVector> GlobalLU_t;
33 typedef SparseMatrix<Scalar, ColMajor, StorageIndex> MatrixType;
34
35 protected:
36 template <typename VectorType>
37 Index expand(VectorType& vec, Index& length, Index nbElts, Index keep_prev, Index& num_expansions);
38 Index memInit(Index m, Index n, Index annz, Index lwork, Index fillratio, Index panel_size, GlobalLU_t& glu);
39 template <typename VectorType>
40 Index memXpand(VectorType& vec, Index& maxlen, Index nbElts, MemType memtype, Index& num_expansions);
41 void heap_relax_snode(const Index n, IndexVector& et, const Index relax_columns, IndexVector& descendants,
42 IndexVector& relax_end);
43 void relax_snode(const Index n, IndexVector& et, const Index relax_columns, IndexVector& descendants,
44 IndexVector& relax_end);
45 Index snode_dfs(const Index jcol, const Index kcol, const MatrixType& mat, IndexVector& xprune, IndexVector& marker,
46 GlobalLU_t& glu);
47 Index snode_bmod(const Index jcol, const Index fsupc, ScalarVector& dense, GlobalLU_t& glu);
48 Index pivotL(const Index jcol, const RealScalar& diagpivotthresh, IndexVector& perm_r, IndexVector& iperm_c,
49 Index& pivrow, GlobalLU_t& glu);
50 template <typename Traits>
51 void dfs_kernel(const StorageIndex jj, IndexVector& perm_r, Index& nseg, IndexVector& panel_lsub, IndexVector& segrep,
52 Ref<IndexVector> repfnz_col, IndexVector& xprune, Ref<IndexVector> marker, IndexVector& parent,
53 IndexVector& xplore, GlobalLU_t& glu, Index& nextl_col, Index krow, Traits& traits);
54 void panel_dfs(const Index m, const Index w, const Index jcol, MatrixType& A, IndexVector& perm_r, Index& nseg,
55 ScalarVector& dense, IndexVector& panel_lsub, IndexVector& segrep, IndexVector& repfnz,
56 IndexVector& xprune, IndexVector& marker, IndexVector& parent, IndexVector& xplore, GlobalLU_t& glu);
57
58 void panel_bmod(const Index m, const Index w, const Index jcol, const Index nseg, ScalarVector& dense,
59 ScalarVector& tempv, IndexVector& segrep, IndexVector& repfnz, GlobalLU_t& glu);
60 Index column_dfs(const Index m, const Index jcol, IndexVector& perm_r, Index maxsuper, Index& nseg,
61 BlockIndexVector lsub_col, IndexVector& segrep, BlockIndexVector repfnz, IndexVector& xprune,
62 IndexVector& marker, IndexVector& parent, IndexVector& xplore, GlobalLU_t& glu);
63 Index column_bmod(const Index jcol, const Index nseg, BlockScalarVector dense, ScalarVector& tempv,
64 BlockIndexVector segrep, BlockIndexVector repfnz, Index fpanelc, GlobalLU_t& glu);
65 Index copy_to_ucol(const Index jcol, const Index nseg, IndexVector& segrep, BlockIndexVector repfnz,
66 IndexVector& perm_r, BlockScalarVector dense, GlobalLU_t& glu);
67 void pruneL(const Index jcol, const IndexVector& perm_r, const Index pivrow, const Index nseg,
68 const IndexVector& segrep, BlockIndexVector repfnz, IndexVector& xprune, GlobalLU_t& glu);
69 void countnz(const Index n, Index& nnzL, Index& nnzU, GlobalLU_t& glu);
70 void fixupL(const Index n, const IndexVector& perm_r, GlobalLU_t& glu);
71
72 template <typename, typename>
73 friend struct column_dfs_traits;
74};
75
76} // end namespace internal
77} // namespace Eigen
78
79#endif
Namespace containing all symbols from the Eigen library.
Definition Core:137