By making v
the result of some computations (e.g. a matvec A*x
) which you do not want to repeat.
For example, norm_normalize()
would allow you to reduce
v = A*x
n = norm(v)
v /= n
to
n,v = norm_normalize(A*x)
By making v
the result of some computations (e.g. a matvec A*x
) which you do not want to repeat.
For example, norm_normalize()
would allow you to reduce
v = A*x
n = norm(v)
v /= n
to
n,v = norm_normalize(A*x)