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);
373 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
374 return diagonalProduct().abs();
388 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
389 EIGEN_IF_CONSTEXPR (internal::has_scaled_product<Scalar>::value)
return diagonalProduct().logAbs();
390 Scalar det = Scalar(0.);
391 for (Index j = 0; j < this->
cols(); ++j) {
393 if (it.row() < j)
continue;
395 det += numext::log(numext::abs(it.value()));
411 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
413 Scalar det = Scalar(1);
416 for (Index j = 0; j < this->
cols(); ++j) {
418 if (it.index() == j) {
419 const Scalar pivotSign = numext::sign(it.value());
420 if (pivotSign == Scalar(0))
return Scalar(0);
426 return det * Scalar(m_detPermR * m_detPermC);
436 eigen_assert(m_factorizationIsOk &&
"The matrix should be factorized first.");
437 const Scalar det = diagonalProduct().value();
438 return (m_detPermR * m_detPermC) > 0 ? det : -det;
443 Index
nnzL()
const {
return m_nnzL; }
446 Index
nnzU()
const {
return m_nnzU; }
452 internal::scaled_product<Scalar> diagonalProduct()
const {
453 internal::scaled_product<Scalar> product;
454 for (Index j = 0; j < this->
cols(); ++j) {
455 for (
typename SCMatrix::InnerIterator it(m_Lstore, j); it; ++it) {
456 if (it.index() == j) {
457 product.multiply(it.value());
465 void initperfvalues() {
466 m_perfv.panel_size = 16;
468 m_perfv.maxsuper = 128;
471 m_perfv.fillfactor = 20;
476 bool m_factorizationIsOk;
478 std::string m_lastError;
481 Map<SparseMatrix<Scalar, ColMajor, StorageIndex>> m_Ustore;
482 PermutationType m_perm_c;
483 PermutationType m_perm_r;
486 typename Base::GlobalLU_t m_glu;
489 bool m_symmetricmode;
491 internal::perfvalues m_perfv;
492 RealScalar m_diagpivotthresh;
493 Index m_nnzL, m_nnzU;
494 Index m_detPermR, m_detPermC;
516template <
typename MatrixType,
typename OrderingType>
525 ord(m_mat, m_perm_c);
528 if (m_perm_c.size()) {
536 const bool useInputOuterIndex = !MatrixType::IsRowMajor && mat.isCompressed();
537 ei_declare_aligned_stack_constructed_variable(
538 StorageIndex, outerIndexPtr, m_mat.cols() + 1,
539 useInputOuterIndex ?
const_cast<StorageIndex*
>(mat.outerIndexPtr()) : 0);
540 if (!useInputOuterIndex)
541 IndexVector::Map(outerIndexPtr, m_mat.cols() + 1) = IndexVector::Map(m_mat.outerIndexPtr(), m_mat.cols() + 1);
544 for (Index i = 0; i < mat.cols(); i++) {
545 m_mat.outerIndexPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i];
546 m_mat.innerNonZeroPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i + 1] - outerIndexPtr[i];
551 IndexVector firstRowElt;
552 internal::coletree(m_mat, m_etree, firstRowElt);
555 if (!m_symmetricmode) {
556 IndexVector post, iwork;
558 internal::treePostorder(StorageIndex(m_mat.cols()), m_etree, post);
561 Index m = m_mat.cols();
563 for (Index i = 0; i < m; ++i) iwork(post(i)) = post(m_etree(i));
567 PermutationType post_perm(m);
568 for (Index i = 0; i < m; i++) post_perm.
indices()(i) = post(i);
571 if (m_perm_c.size()) {
572 m_perm_c = post_perm * m_perm_c;
577 m_analysisIsOk =
true;
601template <
typename MatrixType,
typename OrderingType>
603 using internal::emptyIdxLU;
604 eigen_assert(m_analysisIsOk &&
"analyzePattern() should be called first");
605 EIGEN_INTERNAL_ASSERT_SQUARE_MSG(matrix,
"Only for squared matrices");
607 m_isInitialized =
true;
616 if (m_perm_c.size()) {
620 const bool useInputOuterIndex = !MatrixType::IsRowMajor && matrix.isCompressed();
621 ei_declare_aligned_stack_constructed_variable(
622 StorageIndex, outerIndexPtr, m_mat.cols() + 1,
623 useInputOuterIndex ?
const_cast<StorageIndex*
>(matrix.outerIndexPtr()) : 0);
624 if (!useInputOuterIndex)
625 IndexVector::Map(outerIndexPtr, m_mat.cols() + 1) = IndexVector::Map(m_mat.outerIndexPtr(), m_mat.cols() + 1);
626 for (Index i = 0; i < matrix.cols(); i++) {
627 m_mat.outerIndexPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i];
628 m_mat.innerNonZeroPtr()[m_perm_c.indices()(i)] = outerIndexPtr[i + 1] - outerIndexPtr[i];
631 m_perm_c.resize(matrix.cols());
632 for (StorageIndex i = 0; i < matrix.cols(); ++i) m_perm_c.indices()(i) = i;
635 Index m = m_mat.rows();
636 Index n = m_mat.cols();
637 Index nnz = m_mat.nonZeros();
638 Index maxpanel = m_perfv.panel_size * m;
643 Index
info =
Base::memInit(m, n, nnz, lwork, m_perfv.fillfactor, m_perfv.panel_size, m_glu);
645 m_lastError =
"UNABLE TO ALLOCATE WORKING MEMORY\n\n";
646 m_factorizationIsOk =
false;
651 IndexVector segrep(m);
653 IndexVector parent(m);
655 IndexVector xplore(m);
657 IndexVector repfnz(maxpanel);
658 IndexVector panel_lsub(maxpanel);
659 IndexVector xprune(n);
661 IndexVector marker(m * internal::LUNoMarker);
671 tempv.
setZero(internal::LUnumTempV(m, m_perfv.panel_size, m_perfv.maxsuper, m));
674 PermutationType iperm_c(m_perm_c.inverse());
677 IndexVector relax_end(n);
678 if (m_symmetricmode ==
true)
684 m_perm_r.indices().setConstant(-1);
688 m_glu.supno(0) = emptyIdxLU;
689 m_glu.xsup.setConstant(0);
690 m_glu.xsup(0) = m_glu.xlsub(0) = m_glu.xusub(0) = m_glu.xlusup(0) = Index(0);
701 for (jcol = 0; jcol < n;) {
703 Index panel_size = m_perfv.panel_size;
704 for (k = jcol + 1; k < (std::min)(jcol + panel_size, n); k++) {
705 if (relax_end(k) != emptyIdxLU) {
706 panel_size = k - jcol;
710 if (k == n) panel_size = n - jcol;
713 Base::panel_dfs(m, panel_size, jcol, m_mat, m_perm_r.indices(), nseg1, dense, panel_lsub, segrep, repfnz, xprune,
714 marker, parent, xplore, m_glu);
717 Base::panel_bmod(m, panel_size, jcol, nseg1, dense, tempv, segrep, repfnz, m_glu);
720 for (jj = jcol; jj < jcol + panel_size; jj++) {
728 info =
Base::column_dfs(m, jj, m_perm_r.indices(), m_perfv.maxsuper, nseg, panel_lsubk, segrep, repfnz_k, xprune,
729 marker, parent, xplore, m_glu);
731 m_lastError =
"UNABLE TO EXPAND MEMORY IN COLUMN_DFS() ";
733 m_factorizationIsOk =
false;
742 m_lastError =
"UNABLE TO EXPAND MEMORY IN COLUMN_BMOD() ";
744 m_factorizationIsOk =
false;
752 m_lastError =
"UNABLE TO EXPAND MEMORY IN COPY_TO_UCOL() ";
754 m_factorizationIsOk =
false;
762 m_lastError =
"THE MATRIX IS STRUCTURALLY SINGULAR";
764 std::ostringstream returnInfo;
765 returnInfo <<
" ... ZERO COLUMN AT ";
767 m_lastError += returnInfo.str();
770 m_factorizationIsOk =
false;
775 Base::pruneL(jj, m_perm_r.indices(), pivrow, nseg, segrep, repfnz_k, xprune, m_glu);
778 for (i = 0; i < nseg; i++) {
780 repfnz_k(irep) = emptyIdxLU;
786 m_detPermR = m_perm_r.determinant();
787 m_detPermC = m_perm_c.determinant();
795 m_Lstore.setInfos(m, n, m_glu.lusup, m_glu.xlusup, m_glu.lsub, m_glu.xlsub, m_glu.supno, m_glu.xsup);
801 m_factorizationIsOk =
true;
804template <
typename MappedSupernodalType>
805struct SparseLUMatrixLReturnType : internal::no_assignment_operator {
806 using Scalar =
typename MappedSupernodalType::Scalar;
807 explicit SparseLUMatrixLReturnType(
const MappedSupernodalType& mapL) : m_mapL(mapL) {}
808 Index rows()
const {
return m_mapL.rows(); }
809 Index cols()
const {
return m_mapL.cols(); }
810 template <
typename Dest>
811 void solveInPlace(MatrixBase<Dest>& X)
const {
812 m_mapL.solveInPlace(X);
814 template <
bool Conjugate,
typename Dest>
815 void solveTransposedInPlace(MatrixBase<Dest>& X)
const {
816 m_mapL.template solveTransposedInPlace<Conjugate>(X);
819 SparseMatrix<Scalar, ColMajor, Index> toSparse()
const {
820 ArrayXi colCount = ArrayXi::Ones(cols());
821 for (Index i = 0; i < cols(); i++) {
822 typename MappedSupernodalType::InnerIterator iter(m_mapL, i);
823 for (; iter; ++iter) {
824 if (iter.row() > iter.col()) {
825 colCount(iter.col())++;
829 SparseMatrix<Scalar, ColMajor, Index> sL(rows(), cols());
830 sL.reserve(colCount);
831 for (Index i = 0; i < cols(); i++) {
832 sL.insert(i, i) = 1.0;
833 typename MappedSupernodalType::InnerIterator iter(m_mapL, i);
834 for (; iter; ++iter) {
835 if (iter.row() > iter.col()) {
836 sL.insert(iter.row(), iter.col()) = iter.value();
844 const MappedSupernodalType& m_mapL;
847template <
typename MatrixLType,
typename MatrixUType>
848struct SparseLUMatrixUReturnType : internal::no_assignment_operator {
849 using Scalar =
typename MatrixLType::Scalar;
850 SparseLUMatrixUReturnType(
const MatrixLType& mapL,
const MatrixUType& mapU) : m_mapL(mapL), m_mapU(mapU) {}
851 Index rows()
const {
return m_mapL.rows(); }
852 Index cols()
const {
return m_mapL.cols(); }
854 template <
typename Dest>
855 void solveInPlace(MatrixBase<Dest>& X)
const {
856 Index nrhs = X.cols();
858 for (Index k = m_mapL.nsuper(); k >= 0; k--) {
859 Index fsupc = m_mapL.supToCol()[k];
860 Index lda = m_mapL.colIndexPtr()[fsupc + 1] - m_mapL.colIndexPtr()[fsupc];
861 Index nsupc = m_mapL.supToCol()[k + 1] - fsupc;
862 Index luptr = m_mapL.colIndexPtr()[fsupc];
865 for (Index j = 0; j < nrhs; j++) {
866 X(fsupc, j) /= m_mapL.valuePtr()[luptr];
870 Map<const Matrix<Scalar, Dynamic, Dynamic, ColMajor>, 0, OuterStride<>> A(&(m_mapL.valuePtr()[luptr]), nsupc,
871 nsupc, OuterStride<>(lda));
872 typename Dest::RowsBlockXpr U = X.derived().middleRows(fsupc, nsupc);
873 U = A.template triangularView<Upper>().solve(U);
876 for (Index j = 0; j < nrhs; ++j) {
877 for (Index jcol = fsupc; jcol < fsupc + nsupc; jcol++) {
878 typename MatrixUType::InnerIterator it(m_mapU, jcol);
880 Index irow = it.index();
881 X(irow, j) -= X(jcol, j) * it.value();
888 template <
bool Conjugate,
typename Dest>
889 void solveTransposedInPlace(MatrixBase<Dest>& X)
const {
890 Index nrhs = X.cols();
892 for (Index k = 0; k <= m_mapL.nsuper(); k++) {
893 Index fsupc = m_mapL.supToCol()[k];
894 Index lda = m_mapL.colIndexPtr()[fsupc + 1] - m_mapL.colIndexPtr()[fsupc];
895 Index nsupc = m_mapL.supToCol()[k + 1] - fsupc;
896 Index luptr = m_mapL.colIndexPtr()[fsupc];
898 for (Index j = 0; j < nrhs; ++j) {
899 for (Index jcol = fsupc; jcol < fsupc + nsupc; jcol++) {
900 typename MatrixUType::InnerIterator it(m_mapU, jcol);
902 Index irow = it.index();
903 X(jcol, j) -= X(irow, j) * (Conjugate ? numext::conj(it.value()) : it.value());
908 for (Index j = 0; j < nrhs; j++) {
909 X(fsupc, j) /= (Conjugate ? numext::conj(m_mapL.valuePtr()[luptr]) : m_mapL.valuePtr()[luptr]);
912 Map<const Matrix<Scalar, Dynamic, Dynamic, ColMajor>, 0, OuterStride<>> A(&(m_mapL.valuePtr()[luptr]), nsupc,
913 nsupc, OuterStride<>(lda));
914 typename Dest::RowsBlockXpr U = X.derived().middleRows(fsupc, nsupc);
915 EIGEN_IF_CONSTEXPR (Conjugate)
916 U = A.adjoint().template triangularView<Lower>().solve(U);
918 U = A.transpose().template triangularView<Lower>().solve(U);
923 SparseMatrix<Scalar, RowMajor, Index> toSparse() {
924 ArrayXi rowCount = ArrayXi::Zero(rows());
925 for (Index i = 0; i < cols(); i++) {
926 typename MatrixLType::InnerIterator iter(m_mapL, i);
927 for (; iter; ++iter) {
928 if (iter.row() <= iter.col()) {
929 rowCount(iter.row())++;
934 SparseMatrix<Scalar, RowMajor, Index> sU(rows(), cols());
935 sU.reserve(rowCount);
936 for (Index i = 0; i < cols(); i++) {
937 typename MatrixLType::InnerIterator iter(m_mapL, i);
938 for (; iter; ++iter) {
939 if (iter.row() <= iter.col()) {
940 sU.insert(iter.row(), iter.col()) = iter.value();
945 const SparseMatrix<Scalar, RowMajor, Index> u = m_mapU;
950 const MatrixLType& m_mapL;
951 const MatrixUType& m_mapU;
constexpr ColXpr col(Index i)
Definition DenseBase.h:1082
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:387
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:446
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:602
Scalar determinant() const
Give the determinant.
Definition SparseLU.h:435
Scalar signDeterminant() const
Give the sign of the determinant.
Definition SparseLU.h:410
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:517
Index nnzL() const
Give the number of non zero in matrix L.
Definition SparseLU.h:443
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:121
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