V should be manifold, and then we can just use retract instead of advance

release/4.3a0
Frank Dellaert 2012-06-13 18:04:33 +00:00
parent 4bbe66f106
commit 4c78ce32d4
1 changed files with 3 additions and 0 deletions

View File

@ -7,6 +7,7 @@
#pragma once
#include <gtsam/base/manifold.h>
#include <gtsam/nonlinear/NonlinearOptimizer.h>
namespace gtsam {
@ -175,6 +176,8 @@ double lineSearch(const S &system, const V currentValues, const W &gradient) {
template <class S, class V>
V conjugateGradient(const S &system, const V &initial, const NonlinearOptimizerParams &params, const bool gradientDescent) {
GTSAM_CONCEPT_MANIFOLD_TYPE(V);
// check if we're already close enough
double currentError = system.error(initial);
if(currentError <= params.errorTol) {