diff --git a/src/samplefunctional.hh b/src/samplefunctional.hh index 70d92c71f01a7353e9cb26405e0d4f26942252da..a2f413d94a5934a83ba1003fe6bd480b9613ac0c 100644 --- a/src/samplefunctional.hh +++ b/src/samplefunctional.hh @@ -155,8 +155,9 @@ void minimise(Functional const J, typename Functional::SmallVector &x, J.A.mv(descDir, tmp); // Av double const JRestA = tmp * descDir; // <Av,v> - J.A.mv(x, tmp); // Au - double const JRestb = (J.b - tmp) * descDir; // <b-Au,v> + tmp = J.b; + J.A.mmv(x, tmp); // b-Au + double const JRestb = tmp * descDir; // <b-Au,v> typedef typename Functional::NonlinearityType MyNonlinearityType; MyNonlinearityType phi = J.phi;