The above algorithm gives the most straightforward explanation of the conjugate gradient method. Seemingly, the algorithm as stated requires storage of all previous searching directions and residue vectors, as well as many matrix-vector multiplications, and thus can be computationally expensive. However, a closer analysis of the algorithm shows that r"i" is orthogonal to r"j" , i.e. formula_29 , for i ≠ j. And p"i" is A-orthogonal to p"j" , i.e. formula_30 , for i ≠ j. This can be regarded that as the algorithm progresses, p"i" and r"i" span the same Krylov subspace. Where r"i" form the orthogonal basis with respect to standard inner product, and p"i" form the orthogonal basis with respect to inner product induced by A. Therefore, x"k" can be regarded as the projection of x on the Krylov subspace.