add support for solving with sparse right hand side

This commit is contained in:
Desire NUENTSA
2013-01-25 18:17:17 +01:00
parent 7282a45a0a
commit 81d4bfa8d9
8 changed files with 50 additions and 91 deletions

View File

@@ -353,14 +353,14 @@ class SuperLUBase : internal::noncopyable
*
* \sa compute()
*/
// template<typename Rhs>
// inline const internal::sparse_solve_retval<SuperLU, Rhs> solve(const SparseMatrixBase<Rhs>& b) const
// {
// eigen_assert(m_isInitialized && "SuperLU is not initialized.");
// eigen_assert(rows()==b.rows()
// && "SuperLU::solve(): invalid number of rows of the right hand side matrix b");
// return internal::sparse_solve_retval<SuperLU, Rhs>(*this, b.derived());
// }
template<typename Rhs>
inline const internal::sparse_solve_retval<SuperLUBase, Rhs> solve(const SparseMatrixBase<Rhs>& b) const
{
eigen_assert(m_isInitialized && "SuperLU is not initialized.");
eigen_assert(rows()==b.rows()
&& "SuperLU::solve(): invalid number of rows of the right hand side matrix b");
return internal::sparse_solve_retval<SuperLUBase, Rhs>(*this, b.derived());
}
/** Performs a symbolic decomposition on the sparcity of \a matrix.
*
@@ -1015,7 +1015,7 @@ struct sparse_solve_retval<SuperLUBase<_MatrixType,Derived>, Rhs>
template<typename Dest> void evalTo(Dest& dst) const
{
dec().derived()._solve(rhs(),dst);
this->defaultEvalTo(dst);
}
};