diff options
author | Desire NUENTSA <desire.nuentsa_wakam@inria.fr> | 2013-01-25 18:17:17 +0100 |
---|---|---|
committer | Desire NUENTSA <desire.nuentsa_wakam@inria.fr> | 2013-01-25 18:17:17 +0100 |
commit | 81d4bfa8d9c9f17a58d827956f7d529085151afe (patch) | |
tree | 5eb0170dfcf48ad9b9a5aa3ebd3d5ffe134e5935 /Eigen/src/UmfPackSupport | |
parent | 7282a45a0aacf6ba08062d12a7111feeff2484df (diff) |
add support for solving with sparse right hand side
Diffstat (limited to 'Eigen/src/UmfPackSupport')
-rw-r--r-- | Eigen/src/UmfPackSupport/UmfPackSupport.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/Eigen/src/UmfPackSupport/UmfPackSupport.h b/Eigen/src/UmfPackSupport/UmfPackSupport.h index 22d049089..d85b8be85 100644 --- a/Eigen/src/UmfPackSupport/UmfPackSupport.h +++ b/Eigen/src/UmfPackSupport/UmfPackSupport.h @@ -215,14 +215,14 @@ class UmfPackLU : internal::noncopyable * * \sa compute() */ -// template<typename Rhs> -// inline const internal::sparse_solve_retval<UmfPAckLU, Rhs> solve(const SparseMatrixBase<Rhs>& b) const -// { -// eigen_assert(m_isInitialized && "UmfPAckLU is not initialized."); -// eigen_assert(rows()==b.rows() -// && "UmfPAckLU::solve(): invalid number of rows of the right hand side matrix b"); -// return internal::sparse_solve_retval<UmfPAckLU, Rhs>(*this, b.derived()); -// } + template<typename Rhs> + inline const internal::sparse_solve_retval<UmfPackLU, Rhs> solve(const SparseMatrixBase<Rhs>& b) const + { + eigen_assert(m_isInitialized && "UmfPackLU is not initialized."); + eigen_assert(rows()==b.rows() + && "UmfPackLU::solve(): invalid number of rows of the right hand side matrix b"); + return internal::sparse_solve_retval<UmfPackLU, Rhs>(*this, b.derived()); + } /** Performs a symbolic decomposition on the sparcity of \a matrix. * @@ -381,7 +381,8 @@ bool UmfPackLU<MatrixType>::_solve(const MatrixBase<BDerived> &b, MatrixBase<XDe const int rhsCols = b.cols(); eigen_assert((BDerived::Flags&RowMajorBit)==0 && "UmfPackLU backend does not support non col-major rhs yet"); eigen_assert((XDerived::Flags&RowMajorBit)==0 && "UmfPackLU backend does not support non col-major result yet"); - + eigen_assert(b.derived().data() != x.derived().data() && " Umfpack does not support inplace solve"); + int errorCode; for (int j=0; j<rhsCols; ++j) { @@ -420,7 +421,7 @@ struct sparse_solve_retval<UmfPackLU<_MatrixType>, Rhs> template<typename Dest> void evalTo(Dest& dst) const { - dec()._solve(rhs(),dst); + this->defaultEvalTo(dst); } }; |