fixed *BUG* in Yong-Dian's (obsolete?) CG solver

release/4.3a0
dellaert 2015-02-18 08:22:08 +01:00
parent fad11c0f4b
commit 5ed0c6cc49
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ boost::tuple<V, int> 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);
}