MOAB
4.9.3pre
|
a class to manipulate the L supernodal factor from the SparseLU factorization More...
#include <SparseLU_SupernodalMatrix.h>
a class to manipulate the L supernodal factor from the SparseLU factorization
This class contain the data to easily store and manipulate the supernodes during the factorization and solution phase of Sparse LU. Only the lower triangular matrix has supernodes.
NOTE : This class corresponds to the SCformat structure in SuperLU
Definition at line 33 of file SparseLU_SupernodalMatrix.h.
typedef Matrix<StorageIndex,Dynamic,1> Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::IndexVector |
Definition at line 38 of file SparseLU_SupernodalMatrix.h.
typedef _Scalar Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::Scalar |
Definition at line 36 of file SparseLU_SupernodalMatrix.h.
typedef Matrix<Scalar,Dynamic,1> Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::ScalarVector |
Definition at line 39 of file SparseLU_SupernodalMatrix.h.
typedef _StorageIndex Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::StorageIndex |
Definition at line 37 of file SparseLU_SupernodalMatrix.h.
Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::MappedSuperNodalMatrix | ( | ) | [inline] |
Definition at line 41 of file SparseLU_SupernodalMatrix.h.
{ }
Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::MappedSuperNodalMatrix | ( | Index | m, |
Index | n, | ||
ScalarVector & | nzval, | ||
IndexVector & | nzval_colptr, | ||
IndexVector & | rowind, | ||
IndexVector & | rowind_colptr, | ||
IndexVector & | col_to_sup, | ||
IndexVector & | sup_to_col | ||
) | [inline] |
Definition at line 45 of file SparseLU_SupernodalMatrix.h.
{ setInfos(m, n, nzval, nzval_colptr, rowind, rowind_colptr, col_to_sup, sup_to_col); }
Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::~MappedSuperNodalMatrix | ( | ) | [inline] |
Definition at line 51 of file SparseLU_SupernodalMatrix.h.
{ }
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::colIndexPtr | ( | ) | [inline] |
Return the pointers to the beginning of each column in valuePtr()
Definition at line 99 of file SparseLU_SupernodalMatrix.h.
{ return m_nzval_colptr; }
const StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::colIndexPtr | ( | ) | const [inline] |
Definition at line 104 of file SparseLU_SupernodalMatrix.h.
{ return m_nzval_colptr; }
Index Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::cols | ( | void | ) | [inline] |
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::colToSup | ( | ) | [inline] |
Return the array of column-to-supernode mapping
Definition at line 132 of file SparseLU_SupernodalMatrix.h.
{ return m_col_to_sup; }
const StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::colToSup | ( | ) | const [inline] |
Definition at line 134 of file SparseLU_SupernodalMatrix.h.
{ return m_col_to_sup; }
Index Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::nsuper | ( | ) | const [inline] |
Return the number of supernodes
Definition at line 151 of file SparseLU_SupernodalMatrix.h.
{ return m_nsuper; }
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::rowIndex | ( | ) | [inline] |
Return the array of compressed row indices of all supernodes
Definition at line 112 of file SparseLU_SupernodalMatrix.h.
{ return m_rowind; }
const StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::rowIndex | ( | ) | const [inline] |
Definition at line 114 of file SparseLU_SupernodalMatrix.h.
{ return m_rowind; }
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::rowIndexPtr | ( | ) | [inline] |
Return the location in rowvaluePtr() which starts each column
Definition at line 122 of file SparseLU_SupernodalMatrix.h.
{ return m_rowind_colptr; }
const StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::rowIndexPtr | ( | ) | const [inline] |
Definition at line 124 of file SparseLU_SupernodalMatrix.h.
{ return m_rowind_colptr; }
Index Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::rows | ( | void | ) | [inline] |
void Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::setInfos | ( | Index | m, |
Index | n, | ||
ScalarVector & | nzval, | ||
IndexVector & | nzval_colptr, | ||
IndexVector & | rowind, | ||
IndexVector & | rowind_colptr, | ||
IndexVector & | col_to_sup, | ||
IndexVector & | sup_to_col | ||
) | [inline] |
Set appropriate pointers for the lower triangular supernodal matrix These infos are available at the end of the numerical factorization FIXME This class will be modified such that it can be use in the course of the factorization.
Definition at line 61 of file SparseLU_SupernodalMatrix.h.
{ m_row = m; m_col = n; m_nzval = nzval.data(); m_nzval_colptr = nzval_colptr.data(); m_rowind = rowind.data(); m_rowind_colptr = rowind_colptr.data(); m_nsuper = col_to_sup(n); m_col_to_sup = col_to_sup.data(); m_sup_to_col = sup_to_col.data(); }
void Eigen::internal::MappedSuperNodalMatrix< Scalar, Index_ >::solveInPlace | ( | MatrixBase< Dest > & | X | ) | const |
Solve with the supernode triangular matrix.
Definition at line 234 of file SparseLU_SupernodalMatrix.h.
{ /* Explicit type conversion as the Index type of MatrixBase<Dest> may be wider than Index */ // eigen_assert(X.rows() <= NumTraits<Index>::highest()); // eigen_assert(X.cols() <= NumTraits<Index>::highest()); Index n = int(X.rows()); Index nrhs = Index(X.cols()); const Scalar * Lval = valuePtr(); // Nonzero values Matrix<Scalar,Dynamic,Dynamic, ColMajor> work(n, nrhs); // working vector work.setZero(); for (Index k = 0; k <= nsuper(); k ++) { Index fsupc = supToCol()[k]; // First column of the current supernode Index istart = rowIndexPtr()[fsupc]; // Pointer index to the subscript of the current column Index nsupr = rowIndexPtr()[fsupc+1] - istart; // Number of rows in the current supernode Index nsupc = supToCol()[k+1] - fsupc; // Number of columns in the current supernode Index nrow = nsupr - nsupc; // Number of rows in the non-diagonal part of the supernode Index irow; //Current index row if (nsupc == 1 ) { for (Index j = 0; j < nrhs; j++) { InnerIterator it(*this, fsupc); ++it; // Skip the diagonal element for (; it; ++it) { irow = it.row(); X(irow, j) -= X(fsupc, j) * it.value(); } } } else { // The supernode has more than one column Index luptr = colIndexPtr()[fsupc]; Index lda = colIndexPtr()[fsupc+1] - luptr; // Triangular solve Map<const Matrix<Scalar,Dynamic,Dynamic, ColMajor>, 0, OuterStride<> > A( &(Lval[luptr]), nsupc, nsupc, OuterStride<>(lda) ); Map< Matrix<Scalar,Dynamic,Dynamic, ColMajor>, 0, OuterStride<> > U (&(X(fsupc,0)), nsupc, nrhs, OuterStride<>(n) ); U = A.template triangularView<UnitLower>().solve(U); // Matrix-vector product new (&A) Map<const Matrix<Scalar,Dynamic,Dynamic, ColMajor>, 0, OuterStride<> > ( &(Lval[luptr+nsupc]), nrow, nsupc, OuterStride<>(lda) ); work.block(0, 0, nrow, nrhs) = A * U; //Begin Scatter for (Index j = 0; j < nrhs; j++) { Index iptr = istart + nsupc; for (Index i = 0; i < nrow; i++) { irow = rowIndex()[iptr]; X(irow, j) -= work(i, j); // Scatter operation work(i, j) = Scalar(0); iptr++; } } } } }
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::supToCol | ( | ) | [inline] |
Return the array of supernode-to-column mapping
Definition at line 141 of file SparseLU_SupernodalMatrix.h.
{ return m_sup_to_col; }
const StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::supToCol | ( | ) | const [inline] |
Definition at line 143 of file SparseLU_SupernodalMatrix.h.
{ return m_sup_to_col; }
Scalar* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::valuePtr | ( | ) | [inline] |
Return the array of nonzero values packed by column
The size is nnz
Definition at line 90 of file SparseLU_SupernodalMatrix.h.
{ return m_nzval; }
const Scalar* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::valuePtr | ( | ) | const [inline] |
Definition at line 92 of file SparseLU_SupernodalMatrix.h.
{ return m_nzval; }
Index Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_col [protected] |
Definition at line 165 of file SparseLU_SupernodalMatrix.h.
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_col_to_sup [protected] |
Definition at line 171 of file SparseLU_SupernodalMatrix.h.
Index Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_nsuper [protected] |
Definition at line 166 of file SparseLU_SupernodalMatrix.h.
Scalar* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_nzval [protected] |
Definition at line 167 of file SparseLU_SupernodalMatrix.h.
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_nzval_colptr [protected] |
Definition at line 168 of file SparseLU_SupernodalMatrix.h.
Index Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_row [protected] |
Definition at line 164 of file SparseLU_SupernodalMatrix.h.
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_rowind [protected] |
Definition at line 169 of file SparseLU_SupernodalMatrix.h.
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_rowind_colptr [protected] |
Definition at line 170 of file SparseLU_SupernodalMatrix.h.
StorageIndex* Eigen::internal::MappedSuperNodalMatrix< _Scalar, _StorageIndex >::m_sup_to_col [protected] |
Definition at line 172 of file SparseLU_SupernodalMatrix.h.