21 if (Base::initIteration(rhs,x))
24 m_mat->apply(x,m_tmp);
27 m_error = m_res.norm() / m_rhs_norm;
28 return m_error < m_tol;
35 m_precond->apply(m_res,m_update);
36 m_mat->apply(m_update,m_tmp);
39 if (m_adapt_step_size)
40 step_size = m_tmp.col(0).dot(m_res.col(0)) / m_tmp.col(0).dot(m_tmp.col(0));
42 step_size = m_step_size;
44 x += step_size * m_update;
45 m_res -= step_size * m_tmp;
46 m_error = m_res.norm() / m_rhs_norm;
47 return m_error < m_tol;
bool step(VectorType &x)
Perform one step, requires initIteration.
Definition: gsGradientMethod.hpp:33
bool initIteration(const VectorType &rhs, VectorType &x)
Init the iteration.
Definition: gsGradientMethod.hpp:18