11#ifndef EIGEN_SPARSELU_SUPERNODAL_MATRIX_H
12#define EIGEN_SPARSELU_SUPERNODAL_MATRIX_H
32template <
typename _Scalar,
typename _StorageIndex>
36 typedef _Scalar Scalar;
37 typedef _StorageIndex StorageIndex;
66 m_nzval =
nzval.data();
78 Index
rows() {
return m_row; }
83 Index
cols() {
return m_col; }
101 return m_nzval_colptr;
106 return m_nzval_colptr;
114 const StorageIndex*
rowIndex()
const
126 return m_rowind_colptr;
134 const StorageIndex*
colToSup()
const
143 const StorageIndex*
supToCol()
const
157 template<
typename Dest>
168 StorageIndex* m_nzval_colptr;
169 StorageIndex* m_rowind;
170 StorageIndex* m_rowind_colptr;
171 StorageIndex* m_col_to_sup;
172 StorageIndex* m_sup_to_col;
181template<
typename Scalar,
typename StorageIndex>
188 m_supno(
mat.colToSup()[outer]),
189 m_idval(
mat.colIndexPtr()[outer]),
190 m_startidval(m_idval),
191 m_endidval(
mat.colIndexPtr()[outer+1]),
192 m_idrow(
mat.rowIndexPtr()[
mat.supToCol()[
mat.colToSup()[outer]]]),
193 m_endidrow(
mat.rowIndexPtr()[
mat.supToCol()[
mat.colToSup()[outer]]+1])
201 inline Scalar value()
const {
return m_matrix.valuePtr()[m_idval]; }
203 inline Scalar& valueRef() {
return const_cast<Scalar&
>(m_matrix.valuePtr()[m_idval]); }
205 inline Index index()
const {
return m_matrix.rowIndex()[m_idrow]; }
206 inline Index row()
const {
return index(); }
207 inline Index col()
const {
return m_outer; }
209 inline Index supIndex()
const {
return m_supno; }
211 inline operator bool()
const
213 return ( (m_idval < m_endidval) && (m_idval >= m_startidval)
214 && (m_idrow < m_endidrow) );
222 const Index m_startidval;
223 const Index m_endidval;
232template<
typename Scalar,
typename Index_>
233template<
typename Dest>
239 Index n = int(X.rows());
240 Index
nrhs = Index(X.cols());
241 const Scalar *
Lval = valuePtr();
244 for (Index k = 0; k <= nsuper(); k ++)
246 Index
fsupc = supToCol()[k];
255 for (Index
j = 0;
j <
nrhs;
j++)
282 for (Index
j = 0;
j <
nrhs;
j++)
285 for (Index i = 0; i < nrow; i++)
289 work(i,
j) = Scalar(0);
An InnerIterator allows to loop over the element of any matrix expression.
Definition CoreIterators.h:34
A matrix or vector expression mapping an existing array of data.
Definition Map.h:91
Pseudo expression representing a solving operation.
Definition Solve.h:63
InnerIterator class to iterate over nonzero values of the current column in the supernodal matrix L.
Definition SparseLU_SupernodalMatrix.h:183
a class to manipulate the L supernodal factor from the SparseLU factorization
Definition SparseLU_SupernodalMatrix.h:34
StorageIndex * supToCol()
Return the array of supernode-to-column mapping.
Definition SparseLU_SupernodalMatrix.h:141
StorageIndex * rowIndex()
Return the array of compressed row indices of all supernodes.
Definition SparseLU_SupernodalMatrix.h:112
StorageIndex * rowIndexPtr()
Return the location in rowvaluePtr() which starts each column.
Definition SparseLU_SupernodalMatrix.h:122
Index cols()
Number of columns.
Definition SparseLU_SupernodalMatrix.h:83
StorageIndex * colToSup()
Return the array of column-to-supernode mapping.
Definition SparseLU_SupernodalMatrix.h:132
Index rows()
Number of rows.
Definition SparseLU_SupernodalMatrix.h:78
StorageIndex * colIndexPtr()
Return the pointers to the beginning of each column in valuePtr()
Definition SparseLU_SupernodalMatrix.h:99
Index nsuper() const
Return the number of supernodes.
Definition SparseLU_SupernodalMatrix.h:151
void solveInPlace(MatrixBase< Dest > &X) const
Solve with the supernode triangular matrix.
Definition SparseLU_SupernodalMatrix.h:234
Scalar * valuePtr()
Return the array of nonzero values packed by column.
Definition SparseLU_SupernodalMatrix.h:90
void setInfos(Index m, Index n, ScalarVector &nzval, IndexVector &nzval_colptr, IndexVector &rowind, IndexVector &rowind_colptr, IndexVector &col_to_sup, IndexVector &sup_to_col)
Set appropriate pointers for the lower triangular supernodal matrix These infos are available at the ...
Definition SparseLU_SupernodalMatrix.h:61