Allows Lower|Upper as a template argument of CG and MINRES: in this case the full matrix will be considered.

This commit is contained in:
Gael Guennebaud
2015-02-10 18:57:41 +01:00
parent f9931a0392
commit 7b35b4cacc
5 changed files with 43 additions and 13 deletions

View File

@@ -250,6 +250,11 @@ namespace Eigen {
template<typename Rhs,typename Dest>
void _solveWithGuess(const Rhs& b, Dest& x) const
{
typedef typename internal::conditional<UpLo==(Lower|Upper),
const MatrixType&,
SparseSelfAdjointView<const MatrixType, UpLo>
>::type MatrixWrapperType;
m_iterations = Base::maxIterations();
m_error = Base::m_tolerance;
@@ -259,7 +264,7 @@ namespace Eigen {
m_error = Base::m_tolerance;
typename Dest::ColXpr xj(x,j);
internal::minres(mp_matrix->template selfadjointView<UpLo>(), b.col(j), xj,
internal::minres(MatrixWrapperType(*mp_matrix), b.col(j), xj,
Base::m_preconditioner, m_iterations, m_error);
}