From 5ed0c6cc49a154cfa6ab89a8522e9097758293b0 Mon Sep 17 00:00:00 2001 From: dellaert Date: Wed, 18 Feb 2015 08:22:08 +0100 Subject: [PATCH] fixed *BUG* in Yong-Dian's (obsolete?) CG solver --- gtsam/nonlinear/NonlinearConjugateGradientOptimizer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/nonlinear/NonlinearConjugateGradientOptimizer.h b/gtsam/nonlinear/NonlinearConjugateGradientOptimizer.h index 9c4db5fd9..04d4734a4 100644 --- a/gtsam/nonlinear/NonlinearConjugateGradientOptimizer.h +++ b/gtsam/nonlinear/NonlinearConjugateGradientOptimizer.h @@ -193,7 +193,7 @@ boost::tuple nonlinearConjugateGradient(const S &system, // Polak-Ribiere: beta = g'*(g_n-g_n-1)/g_n-1'*g_n-1 const double beta = std::max(0.0, currentGradient.dot(currentGradient - prevGradient) - / currentGradient.dot(currentGradient)); + / prevGradient.dot(prevGradient)); direction = currentGradient + (beta * direction); }