aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
diff options
context:
space:
mode:
authorGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-05-14 17:15:23 +0200
committerGravatar Desire NUENTSA <desire.nuentsa_wakam@inria.fr>2013-05-14 17:15:23 +0200
commitf7bdbf69e1974cde4bbd57bdfc4691d42cb373c3 (patch)
tree974884bf502e0fb21bcb6d633bc68ed6ccc15256 /Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
parent83736e9c61d708634d26a56bac09e0d86c34d2b6 (diff)
Add support in SparseLU to solve with L and U factors independently
Diffstat (limited to 'Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h')
-rw-r--r--Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h b/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
index 3eae95479..3836d1096 100644
--- a/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
+++ b/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h
@@ -189,13 +189,14 @@ class MappedSuperNodalMatrix<Scalar,Index>::InnerIterator
m_idval(mat.colIndexPtr()[outer]),
m_startidval(m_idval),
m_endidval(mat.colIndexPtr()[outer+1]),
- m_idrow(mat.rowIndexPtr()[outer])
+ m_idrow(mat.rowIndexPtr()[outer]),
+ m_endidrow(mat.rowIndexPtr()[outer+1])
{}
inline InnerIterator& operator++()
{
m_idval++;
m_idrow++;
- return *this;
+ return *this;
}
inline Scalar value() const { return m_matrix.valuePtr()[m_idval]; }
@@ -209,7 +210,8 @@ class MappedSuperNodalMatrix<Scalar,Index>::InnerIterator
inline operator bool() const
{
- return ( (m_idval < m_endidval) && (m_idval >= m_startidval) );
+ return ( (m_idval < m_endidval) && (m_idval >= m_startidval)
+ && (m_idrow < m_endidrow) );
}
protected:
@@ -220,6 +222,7 @@ class MappedSuperNodalMatrix<Scalar,Index>::InnerIterator
const Index m_startidval; // Start of the column value
const Index m_endidval; // End of the column value
Index m_idrow; //Index to browse the row indices
+ Index m_endidrow; // End index of row indices of the current column
};
/**
@@ -248,16 +251,16 @@ void MappedSuperNodalMatrix<Scalar,Index>::solveInPlace( MatrixBase<Dest>&X) con
{
for (Index j = 0; j < nrhs; j++)
{
- InnerIterator it(*this, fsupc);
+ InnerIterator it(*this, fsupc);
++it; // Skip the diagonal element
for (; it; ++it)
{
irow = it.row();
- X(irow, j) -= X(fsupc, j) * it.value();
+ X(irow, j) -= X(fsupc, j) * it.value();
}
}
}
- else
+ else
{
// The supernode has more than one column
Index luptr = colIndexPtr()[fsupc];