Heavy-ball residual recurrence (source code)

= Heavy-ball residual recurrence

For $F(x)=x^TAx/2-b^Tx$ and $r_k=b-Ax_k$,
$$
r_{k+1}=((1+\beta)I-\alpha A)r_k-\beta r_{k-1}.
$$
Thus $r_k$ is a polynomial in $A$ applied to the initial residual and lies in the corresponding <Krylov subspace>.