span class="p">[</span><span class="n">actual_index</span><span class="p">]</span> <span class="o">=</span> <span class="mi">1</span>
            <span class="n">memoized_Ax</span> <span class="o">=</span> <span class="n">memoized_Ax</span> <span class="o">+</span> <span class="n">A</span><span class="p">[:,</span><span class="n">actual_index</span><span class="p">]</span>

            <span class="c1"># One condition for stopping is to check if the gain_norm is larger than the residual norm.</span>
       