Hello,

what is the best / most efficient way to compute:

y = y - A * b

with vectors b, y and matrix A:

* VecAXPY: I need to compute A*b first

MatMult(A, b, r);
VecAXPY(y, -1, r);

* VecWAXPY: Same case, but I don't reuse y

MatMult(A, b, r);
VecWAXPY(w, -1, r, y);

* VecAYPX: Don't work, because I need to multiply r = A*b with -1

Is there anything else I have overseen, or should I just go with VecAXPY?

Best,
Florian

Reply via email to