12#ifndef EIGEN_SPARSE_LU_H
13#define EIGEN_SPARSE_LU_H
16#include "./InternalHeaderCheck.h"
20template <
typename MatrixType_,
typename OrderingType_ = COLAMDOrdering<
typename MatrixType_::StorageIndex>>
22template <
typename MappedSparseMatrixType>
23struct SparseLUMatrixLReturnType;
24template <
typename MatrixLType,
typename MatrixUType>
25struct SparseLUMatrixUReturnType;
27template <
bool Conjugate,
class SparseLUType>
28class SparseLUTransposeView :
public SparseSolverBase<SparseLUTransposeView<Conjugate, SparseLUType>> {
31 using APIBase::m_isInitialized;
34 using Scalar =
typename SparseLUType::Scalar;
35 using StorageIndex =
typename SparseLUType::StorageIndex;
36 using MatrixType =
typename SparseLUType::MatrixType;
37 using OrderingType =
typename SparseLUType::OrderingType;
39 enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
41 SparseLUTransposeView() =
default;
42 SparseLUTransposeView(
const SparseLUTransposeView& view) : APIBase() {
43 this->m_sparseLU = view.m_sparseLU;
44 this->m_isInitialized = view.m_isInitialized;
46 void setIsInitialized(
const bool isInitialized) { this->m_isInitialized = isInitialized; }
47 void setSparseLU(SparseLUType* sparseLU) { m_sparseLU = sparseLU; }
48 using APIBase::_solve_impl;
49 template <
typename Rhs,
typename Dest>
50 bool _solve_impl(
const MatrixBase<Rhs>& B, MatrixBase<Dest>& X_base)
const {
51 Dest& X(X_base.derived());
52 eigen_assert(m_sparseLU->info() ==
Success &&
"The matrix should be factorized first");
53 EIGEN_STATIC_ASSERT((Dest::Flags &
RowMajorBit) == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
56 for (Index j = 0; j < B.cols(); ++j) {
57 X.col(j) = m_sparseLU->colsPermutation() * B.const_cast_derived().col(j);
60 m_sparseLU->matrixU().template solveTransposedInPlace<Conjugate>(X);
63 m_sparseLU->matrixL().template solveTransposedInPlace<Conjugate>(X);
66 for (Index j = 0; j < B.cols(); ++j) X.col(j) = m_sparseLU->rowsPermutation().transpose() * X.col(j);
69 inline Index rows()
const {
return m_sparseLU->rows(); }
70 inline Index cols()
const {
return m_sparseLU->cols(); }
73 SparseLUType* m_sparseLU =
nullptr;
74 SparseLUTransposeView& operator=(
const SparseLUTransposeView&) =
delete;
150template <
typename MatrixType_,
typename OrderingType_>
155 using APIBase::m_isInitialized;
158 using APIBase::_solve_impl;
160 using MatrixType = MatrixType_;
161 using OrderingType = OrderingType_;
162 using Scalar =
typename MatrixType::Scalar;
163 using RealScalar =
typename MatrixType::RealScalar;
164 using StorageIndex =
typename MatrixType::StorageIndex;
172 enum { ColsAtCompileTime = MatrixType::ColsAtCompileTime, MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime };
180 : m_lastError(
""), m_Ustore(0, 0, 0, 0, 0, 0), m_symmetricmode(false), m_diagpivotthresh(1.0), m_detPermR(1) {
188 : m_lastError(
""), m_Ustore(0, 0, 0, 0, 0, 0), m_symmetricmode(false), m_diagpivotthresh(1.0), m_detPermR(1) {
198 void factorize(
const MatrixType& matrix);
199 void simplicialfactorize(
const MatrixType& matrix);
230 const SparseLUTransposeView<false, SparseLU<MatrixType_, OrderingType_>>
transpose() {
231 SparseLUTransposeView<false, SparseLU<MatrixType_, OrderingType_>> transposeView;
232 transposeView.setSparseLU(
this);
233 transposeView.setIsInitialized(this->m_isInitialized);
234 return transposeView;
251 const SparseLUTransposeView<true, SparseLU<MatrixType_, OrderingType_>>
adjoint() {
252 SparseLUTransposeView<true, SparseLU<MatrixType_, OrderingType_>> adjointView;
253 adjointView.setSparseLU(
this);
254 adjointView.setIsInitialized(this->m_isInitialized);
260 inline Index
rows()
const {
return m_mat.rows(); }
263 inline Index
cols()
const {
return m_mat.cols(); }
276 SparseLUMatrixLReturnType<SCMatrix>
matrixL()
const {
return SparseLUMatrixLReturnType<SCMatrix>(m_Lstore); }
285 SparseLUMatrixUReturnType<SCMatrix, Map<SparseMatrix<Scalar, ColMajor, StorageIndex>>>
matrixU()
const {
286 return SparseLUMatrixUReturnType<SCMatrix, Map<SparseMatrix<Scalar, ColMajor, StorageIndex>>>(m_Lstore, m_Ustore);
304#ifdef EIGEN_PARSED_BY_DOXYGEN
313 template <
typename Rhs>
328 eigen_assert(m_isInitialized &&
"Decomposition is not initialized.");
338 template <
typename Rhs,
typename Dest>
340 Dest& X(X_base.derived());
341 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first");
342 EIGEN_STATIC_ASSERT((Dest::Flags &
RowMajorBit) == 0, THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES);
346 X.resize(B.rows(), B.cols());
349 for (Index j = 0; j < B.cols(); ++j) X.col(j) =
rowsPermutation() * B.const_cast_derived().
col(j);
352 this->
matrixL().solveInPlace(X);
353 this->
matrixU().solveInPlace(X);
374 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
376 Scalar det = Scalar(1.);
379 for (Index j = 0; j < this->
cols(); ++j) {
381 if (it.index() == j) {
382 det *= abs(it.value());
404 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
405 Scalar det = Scalar(0.);
406 for (Index j = 0; j < this->
cols(); ++j) {
408 if (it.row() < j)
continue;
410 det += log(abs(it.value()));
425 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
430 for (Index j = 0; j < this->
cols(); ++j) {
432 if (it.index() == j) {
435 else if (it.value() == 0)
441 return det * m_detPermR * m_detPermC;
451 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
453 Scalar det = Scalar(1.);
456 for (Index j = 0; j < this->
cols(); ++j) {
458 if (it.index() == j) {
464 return (m_detPermR * m_detPermC) > 0 ? det : -det;
469 Index
nnzL()
const {
return m_nnzL; }
472 Index
nnzU()
const {
return m_nnzU; }
476 void initperfvalues() {
477 m_perfv.panel_size = 16;
479 m_perfv.maxsuper = 128;
482 m_perfv.fillfactor = 20;
486 mutable ComputationInfo m_info;
487 bool m_factorizationIsOk;
489 std::string m_lastError;
492 Map<SparseMatrix<Scalar, ColMajor, StorageIndex>> m_Ustore;
493 PermutationType m_perm_c;
494 PermutationType m_perm_r;
497 typename Base::GlobalLU_t m_glu;
500 bool m_symmetricmode;
502 internal::perfvalues m_perfv;
503 RealScalar m_diagpivotthresh;
504 Index m_nnzL, m_nnzU;
505 Index m_detPermR, m_detPermC;
527template <
typename MatrixType,
typename OrderingType>
536 ord(m_mat, m_perm_c);
539 if (m_perm_c.size()) {
547 const bool useInputOuterIndex = !MatrixType::IsRowMajor && mat.isCompressed();
548 ei_declare_aligned_stack_constructed_variable(
549 StorageIndex, outerIndexPtr, m_mat.cols() + 1,
550 useInputOuterIndex ?
const_cast<StorageIndex*
>(mat.outerIndexPtr()) : 0);
551 if (!useInputOuterIndex)
552 IndexVector::Map(outerIndexPtr, m_mat.cols() + 1) = IndexVector::Map(m_mat.outerIndexPtr(), m_mat.cols() + 1);
555 for (Index i = 0; i < mat.cols(); i++) {
556 m_mat.outerIndexPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i];
557 m_mat.innerNonZeroPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i + 1] - outerIndexPtr[i];
562 IndexVector firstRowElt;
563 internal::coletree(m_mat, m_etree, firstRowElt);
566 if (!m_symmetricmode) {
567 IndexVector post, iwork;
569 internal::treePostorder(StorageIndex(m_mat.cols()), m_etree, post);
572 Index m = m_mat.cols();
574 for (Index i = 0; i < m; ++i) iwork(post(i)) = post(m_etree(i));
578 PermutationType post_perm(m);
579 for (Index i = 0; i < m; i++) post_perm.
indices()(i) = post(i);
582 if (m_perm_c.size()) {
583 m_perm_c = post_perm * m_perm_c;
588 m_analysisIsOk =
true;
612template <
typename MatrixType,
typename OrderingType>
614 using internal::emptyIdxLU;
615 eigen_assert(m_analysisIsOk &&
"analyzePattern() should be called first");
616 eigen_assert((matrix.rows() == matrix.cols()) &&
"Only for squared matrices");
618 m_isInitialized =
true;
627 if (m_perm_c.size()) {
631 const bool useInputOuterIndex = !MatrixType::IsRowMajor && matrix.isCompressed();
632 ei_declare_aligned_stack_constructed_variable(
633 StorageIndex, outerIndexPtr, m_mat.cols() + 1,
634 useInputOuterIndex ?
const_cast<StorageIndex*
>(matrix.outerIndexPtr()) : 0);
635 if (!useInputOuterIndex)
636 IndexVector::Map(outerIndexPtr, m_mat.cols() + 1) = IndexVector::Map(m_mat.outerIndexPtr(), m_mat.cols() + 1);
637 for (Index i = 0; i < matrix.cols(); i++) {
638 m_mat.outerIndexPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i];
639 m_mat.innerNonZeroPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i + 1] - outerIndexPtr[i];
642 m_perm_c.resize(matrix.cols());
643 for (StorageIndex i = 0; i < matrix.cols(); ++i) m_perm_c.indices()(i) = i;
646 Index m = m_mat.rows();
647 Index n = m_mat.cols();
648 Index nnz = m_mat.nonZeros();
649 Index maxpanel = m_perfv.panel_size * m;
654 Index
info =
Base::memInit(m, n, nnz, lwork, m_perfv.fillfactor, m_perfv.panel_size, m_glu);
656 m_lastError =
"UNABLE TO ALLOCATE WORKING MEMORY\n\n";
657 m_factorizationIsOk =
false;
662 IndexVector segrep(m);
664 IndexVector parent(m);
666 IndexVector xplore(m);
668 IndexVector repfnz(maxpanel);
669 IndexVector panel_lsub(maxpanel);
670 IndexVector xprune(n);
672 IndexVector marker(m * internal::LUNoMarker);
682 tempv.
setZero(internal::LUnumTempV(m, m_perfv.panel_size, m_perfv.maxsuper, m));
685 PermutationType iperm_c(m_perm_c.inverse());
688 IndexVector relax_end(n);
689 if (m_symmetricmode ==
true)
695 m_perm_r.indices().setConstant(-1);
699 m_glu.supno(0) = emptyIdxLU;
700 m_glu.xsup.setConstant(0);
701 m_glu.xsup(0) = m_glu.xlsub(0) = m_glu.xusub(0) = m_glu.xlusup(0) = Index(0);
712 for (jcol = 0; jcol < n;) {
714 Index panel_size = m_perfv.panel_size;
715 for (k = jcol + 1; k < (std::min)(jcol + panel_size, n); k++) {
716 if (relax_end(k) != emptyIdxLU) {
717 panel_size = k - jcol;
721 if (k == n) panel_size = n - jcol;
724 Base::panel_dfs(m, panel_size, jcol, m_mat, m_perm_r.indices(), nseg1, dense, panel_lsub, segrep, repfnz, xprune,
725 marker, parent, xplore, m_glu);
728 Base::panel_bmod(m, panel_size, jcol, nseg1, dense, tempv, segrep, repfnz, m_glu);
731 for (jj = jcol; jj < jcol + panel_size; jj++) {
739 info =
Base::column_dfs(m, jj, m_perm_r.indices(), m_perfv.maxsuper, nseg, panel_lsubk, segrep, repfnz_k, xprune,
740 marker, parent, xplore, m_glu);
742 m_lastError =
"UNABLE TO EXPAND MEMORY IN COLUMN_DFS() ";
744 m_factorizationIsOk =
false;
753 m_lastError =
"UNABLE TO EXPAND MEMORY IN COLUMN_BMOD() ";
755 m_factorizationIsOk =
false;
763 m_lastError =
"UNABLE TO EXPAND MEMORY IN COPY_TO_UCOL() ";
765 m_factorizationIsOk =
false;
773 m_lastError =
"THE MATRIX IS STRUCTURALLY SINGULAR";
775 std::ostringstream returnInfo;
776 returnInfo <<
" ... ZERO COLUMN AT ";
778 m_lastError += returnInfo.str();
781 m_factorizationIsOk =
false;
786 Base::pruneL(jj, m_perm_r.indices(), pivrow, nseg, segrep, repfnz_k, xprune, m_glu);
789 for (i = 0; i < nseg; i++) {
791 repfnz_k(irep) = emptyIdxLU;
797 m_detPermR = m_perm_r.determinant();
798 m_detPermC = m_perm_c.determinant();
806 m_Lstore.setInfos(m, n, m_glu.lusup, m_glu.xlusup, m_glu.lsub, m_glu.xlsub, m_glu.supno, m_glu.xsup);
812 m_factorizationIsOk =
true;
815template <
typename MappedSupernodalType>
816struct SparseLUMatrixLReturnType : internal::no_assignment_operator {
817 using Scalar =
typename MappedSupernodalType::Scalar;
818 explicit SparseLUMatrixLReturnType(
const MappedSupernodalType& mapL) : m_mapL(mapL) {}
819 Index rows()
const {
return m_mapL.rows(); }
820 Index cols()
const {
return m_mapL.cols(); }
821 template <
typename Dest>
822 void solveInPlace(MatrixBase<Dest>& X)
const {
823 m_mapL.solveInPlace(X);
825 template <
bool Conjugate,
typename Dest>
826 void solveTransposedInPlace(MatrixBase<Dest>& X)
const {
827 m_mapL.template solveTransposedInPlace<Conjugate>(X);
830 SparseMatrix<Scalar, ColMajor, Index> toSparse()
const {
831 ArrayXi colCount = ArrayXi::Ones(cols());
832 for (Index i = 0; i < cols(); i++) {
833 typename MappedSupernodalType::InnerIterator iter(m_mapL, i);
834 for (; iter; ++iter) {
835 if (iter.row() > iter.col()) {
836 colCount(iter.col())++;
840 SparseMatrix<Scalar, ColMajor, Index> sL(rows(), cols());
841 sL.reserve(colCount);
842 for (Index i = 0; i < cols(); i++) {
843 sL.insert(i, i) = 1.0;
844 typename MappedSupernodalType::InnerIterator iter(m_mapL, i);
845 for (; iter; ++iter) {
846 if (iter.row() > iter.col()) {
847 sL.insert(iter.row(), iter.col()) = iter.value();
855 const MappedSupernodalType& m_mapL;
858template <
typename MatrixLType,
typename MatrixUType>
859struct SparseLUMatrixUReturnType : internal::no_assignment_operator {
860 using Scalar =
typename MatrixLType::Scalar;
861 SparseLUMatrixUReturnType(
const MatrixLType& mapL,
const MatrixUType& mapU) : m_mapL(mapL), m_mapU(mapU) {}
862 Index rows()
const {
return m_mapL.rows(); }
863 Index cols()
const {
return m_mapL.cols(); }
865 template <
typename Dest>
866 void solveInPlace(MatrixBase<Dest>& X)
const {
867 Index nrhs = X.cols();
869 for (Index k = m_mapL.nsuper(); k >= 0; k--) {
870 Index fsupc = m_mapL.supToCol()[k];
871 Index lda = m_mapL.colIndexPtr()[fsupc + 1] - m_mapL.colIndexPtr()[fsupc];
872 Index nsupc = m_mapL.supToCol()[k + 1] - fsupc;
873 Index luptr = m_mapL.colIndexPtr()[fsupc];
876 for (Index j = 0; j < nrhs; j++) {
877 X(fsupc, j) /= m_mapL.valuePtr()[luptr];
881 Map<const Matrix<Scalar, Dynamic, Dynamic, ColMajor>, 0, OuterStride<>> A(&(m_mapL.valuePtr()[luptr]), nsupc,
882 nsupc, OuterStride<>(lda));
883 typename Dest::RowsBlockXpr U = X.derived().middleRows(fsupc, nsupc);
884 U = A.template triangularView<Upper>().solve(U);
887 for (Index j = 0; j < nrhs; ++j) {
888 for (Index jcol = fsupc; jcol < fsupc + nsupc; jcol++) {
889 typename MatrixUType::InnerIterator it(m_mapU, jcol);
891 Index irow = it.index();
892 X(irow, j) -= X(jcol, j) * it.value();
899 template <
bool Conjugate,
typename Dest>
900 void solveTransposedInPlace(MatrixBase<Dest>& X)
const {
902 Index nrhs = X.cols();
904 for (Index k = 0; k <= m_mapL.nsuper(); k++) {
905 Index fsupc = m_mapL.supToCol()[k];
906 Index lda = m_mapL.colIndexPtr()[fsupc + 1] - m_mapL.colIndexPtr()[fsupc];
907 Index nsupc = m_mapL.supToCol()[k + 1] - fsupc;
908 Index luptr = m_mapL.colIndexPtr()[fsupc];
910 for (Index j = 0; j < nrhs; ++j) {
911 for (Index jcol = fsupc; jcol < fsupc + nsupc; jcol++) {
912 typename MatrixUType::InnerIterator it(m_mapU, jcol);
914 Index irow = it.index();
915 X(jcol, j) -= X(irow, j) * (Conjugate ? conj(it.value()) : it.value());
920 for (Index j = 0; j < nrhs; j++) {
921 X(fsupc, j) /= (Conjugate ? conj(m_mapL.valuePtr()[luptr]) : m_mapL.valuePtr()[luptr]);
924 Map<const Matrix<Scalar, Dynamic, Dynamic, ColMajor>, 0, OuterStride<>> A(&(m_mapL.valuePtr()[luptr]), nsupc,
925 nsupc, OuterStride<>(lda));
926 typename Dest::RowsBlockXpr U = X.derived().middleRows(fsupc, nsupc);
927 EIGEN_IF_CONSTEXPR (Conjugate)
928 U = A.adjoint().template triangularView<Lower>().solve(U);
930 U = A.transpose().template triangularView<Lower>().solve(U);
935 SparseMatrix<Scalar, RowMajor, Index> toSparse() {
936 ArrayXi rowCount = ArrayXi::Zero(rows());
937 for (Index i = 0; i < cols(); i++) {
938 typename MatrixLType::InnerIterator iter(m_mapL, i);
939 for (; iter; ++iter) {
940 if (iter.row() <= iter.col()) {
941 rowCount(iter.row())++;
946 SparseMatrix<Scalar, RowMajor, Index> sU(rows(), cols());
947 sU.reserve(rowCount);
948 for (Index i = 0; i < cols(); i++) {
949 typename MatrixLType::InnerIterator iter(m_mapL, i);
950 for (; iter; ++iter) {
951 if (iter.row() <= iter.col()) {
952 sU.insert(iter.row(), iter.col()) = iter.value();
957 const SparseMatrix<Scalar, RowMajor, Index> u = m_mapU;
962 const MatrixLType& m_mapL;
963 const MatrixUType& m_mapU;
constexpr ColXpr col(Index i)
Definition DenseBase.h:1081
A matrix or vector expression mapping an existing array of data.
Definition Map.h:97
Base class for all dense matrices, vectors, and expressions.
Definition MatrixBase.h:53
The matrix class, also used for vectors and row-vectors.
Definition Matrix.h:188
InverseReturnType inverse() const
Definition PermutationMatrix.h:229
Permutation matrix.
Definition PermutationMatrix.h:346
constexpr const IndicesType & indices() const
Definition PermutationMatrix.h:400
Derived & setConstant(Index size, const Scalar &val)
Definition CwiseNullaryOp.h:349
Derived & setZero(Index size)
Definition CwiseNullaryOp.h:536
constexpr void resize(Index rows, Index cols)
Definition PlainObjectBase.h:282
Pseudo expression representing a solving operation.
Definition Solve.h:63
Sparse supernodal LU factorization for general matrices.
Definition SparseLU.h:152
SparseLUMatrixUReturnType< SCMatrix, Map< SparseMatrix< Scalar, ColMajor, StorageIndex > > > matrixU() const
Give the MatrixU.
Definition SparseLU.h:285
void setPivotThreshold(const RealScalar &thresh)
Definition SparseLU.h:302
Index cols() const
Give the number of columns.
Definition SparseLU.h:263
Scalar logAbsDeterminant() const
Give the natural log of the absolute determinant.
Definition SparseLU.h:400
Index rows() const
Give the number of rows.
Definition SparseLU.h:260
Index nnzU() const
Give the number of non zero in matrix U.
Definition SparseLU.h:472
const SparseLUTransposeView< true, SparseLU< MatrixType_, OrderingType_ > > adjoint()
Return a solver for the adjointed matrix.
Definition SparseLU.h:251
Solve< SparseLU, Rhs > solve(const MatrixBase< Rhs > &B) const
Solve a system .
void factorize(const MatrixType &matrix)
Factorize the matrix to get the solver ready.
Definition SparseLU.h:613
Scalar determinant() const
Give the determinant.
Definition SparseLU.h:450
Scalar signDeterminant() const
Give the sign of the determinant.
Definition SparseLU.h:424
std::string lastErrorMessage() const
Give a human readable error.
Definition SparseLU.h:336
SparseLUMatrixLReturnType< SCMatrix > matrixL() const
Give the matrixL.
Definition SparseLU.h:276
void compute(const MatrixType &matrix)
Analyze and factorize the matrix so the solver is ready to solve.
Definition SparseLU.h:211
ComputationInfo info() const
Reports whether previous computation was successful.
Definition SparseLU.h:327
const PermutationType & colsPermutation() const
Give the column matrix permutation.
Definition SparseLU.h:300
SparseLU()
Basic constructor of the solver.
Definition SparseLU.h:179
void analyzePattern(const MatrixType &matrix)
Compute the column permutation.
Definition SparseLU.h:528
Index nnzL() const
Give the number of non zero in matrix L.
Definition SparseLU.h:469
const PermutationType & rowsPermutation() const
Give the row matrix permutation.
Definition SparseLU.h:294
void isSymmetric(bool sym)
Let you set that the pattern of the input matrix is symmetric.
Definition SparseLU.h:266
Scalar absDeterminant() const
Give the absolute value of the determinant.
Definition SparseLU.h:372
SparseLU(const MatrixType &matrix)
Constructor of the solver already based on a specific matrix.
Definition SparseLU.h:187
const SparseLUTransposeView< false, SparseLU< MatrixType_, OrderingType_ > > transpose()
Return a solver for the transposed matrix.
Definition SparseLU.h:230
A versatile sparse matrix representation.
Definition SparseMatrix.h:122
A base class for sparse solvers.
Definition SparseSolverBase.h:68
SparseSolverBase()=default
Expression of a fixed-size or dynamic-size sub-vector.
Definition VectorBlock.h:59
a class to manipulate the L supernodal factor from the SparseLU factorization
Definition SparseLU_SupernodalMatrix.h:33
Definition SparseLUImpl.h:24
void relax_snode(const Index n, IndexVector &et, const Index relax_columns, IndexVector &descendants, IndexVector &relax_end)
Identify the initial relaxed supernodes.
Definition SparseLU_relax_snode.h:51
Index column_dfs(const Index m, const Index jcol, IndexVector &perm_r, Index maxsuper, Index &nseg, BlockIndexVector lsub_col, IndexVector &segrep, BlockIndexVector repfnz, IndexVector &xprune, IndexVector &marker, IndexVector &parent, IndexVector &xplore, GlobalLU_t &glu)
Performs a symbolic factorization on column jcol and decide the supernode boundary.
Definition SparseLU_column_dfs.h:91
void fixupL(const Index n, const IndexVector &perm_r, GlobalLU_t &glu)
Fix up the data storage lsub for L-subscripts.
Definition SparseLU_Utils.h:52
Index copy_to_ucol(const Index jcol, const Index nseg, IndexVector &segrep, BlockIndexVector repfnz, IndexVector &perm_r, BlockScalarVector dense, GlobalLU_t &glu)
Performs numeric block updates (sup-col) in topological order.
Definition SparseLU_copy_to_ucol.h:54
void heap_relax_snode(const Index n, IndexVector &et, const Index relax_columns, IndexVector &descendants, IndexVector &relax_end)
Identify the initial relaxed supernodes.
Definition SparseLU_heap_relax_snode.h:50
void panel_dfs(const Index m, const Index w, const Index jcol, MatrixType &A, IndexVector &perm_r, Index &nseg, ScalarVector &dense, IndexVector &panel_lsub, IndexVector &segrep, IndexVector &repfnz, IndexVector &xprune, IndexVector &marker, IndexVector &parent, IndexVector &xplore, GlobalLU_t &glu)
Performs a symbolic factorization on a panel of columns [jcol, jcol+w)
Definition SparseLU_panel_dfs.h:195
void countnz(const Index n, Index &nnzL, Index &nnzU, GlobalLU_t &glu)
Count Nonzero elements in the factors.
Definition SparseLU_Utils.h:24
Index column_bmod(const Index jcol, const Index nseg, BlockScalarVector dense, ScalarVector &tempv, BlockIndexVector segrep, BlockIndexVector repfnz, Index fpanelc, GlobalLU_t &glu)
Performs numeric block updates (sup-col) in topological order.
Definition SparseLU_column_bmod.h:57
Index pivotL(const Index jcol, const RealScalar &diagpivotthresh, IndexVector &perm_r, IndexVector &iperm_c, Index &pivrow, GlobalLU_t &glu)
Performs the numerical pivoting on the current column of L, and the CDIV operation.
Definition SparseLU_pivotL.h:64
Index memInit(Index m, Index n, Index annz, Index lwork, Index fillratio, Index panel_size, GlobalLU_t &glu)
Allocate various working space for the numerical factorization phase.
Definition SparseLU_Memory.h:135
void pruneL(const Index jcol, const IndexVector &perm_r, const Index pivrow, const Index nseg, const IndexVector &segrep, BlockIndexVector repfnz, IndexVector &xprune, GlobalLU_t &glu)
Prunes the L-structure.
Definition SparseLU_pruneL.h:57
void panel_bmod(const Index m, const Index w, const Index jcol, const Index nseg, ScalarVector &dense, ScalarVector &tempv, IndexVector &segrep, IndexVector &repfnz, GlobalLU_t &glu)
Performs numeric block updates (sup-panel) in topological order.
Definition SparseLU_panel_bmod.h:60
ComputationInfo
Definition Constants.h:455
@ NumericalIssue
Definition Constants.h:459
@ Success
Definition Constants.h:457
constexpr unsigned int RowMajorBit
Definition Constants.h:71