@@ -106,7 +108,7 @@ In iterative solvers we often need to update a vector and compute the update nor
\bf u^{k+1} = \bf u^k + \tau \Delta \bf u.
\f]
Except the vector addition, we may want to compute \f$L_p\f$-norm of \f$\Delta \bf u\f$ which may indicate convergence. Computing first the addition and then the norm would be inefficient because we would have to fetch the vector \f$\Delta \bf u\f$ twice from the memory. The following example shows how to do the addition and norm computation at the same time.
Together with the vector addition, we may want to compute also \f$L_2\f$-norm of \f$\Delta \bf u\f$ which may indicate convergence. Computing first the addition and then the norm would be inefficient because we would have to fetch the vector \f$\Delta \bf u\f$ twice from the memory. The following example shows how to do the addition and norm computation at the same time.
\include UpdateAndResidueExample.cpp
@@ -114,4 +116,5 @@ The result reads as:
\include UpdateAndResidueExample.out
### Simple Mask and Reduce<a name="flexible_parallel_reduction_simple_mask_and_reduce"></a>