V should be manifold, and then we can just use retract instead of advance
parent
4bbe66f106
commit
4c78ce32d4
|
@ -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 ¶ms, const bool gradientDescent) {
|
||||
|
||||
GTSAM_CONCEPT_MANIFOLD_TYPE(V);
|
||||
|
||||
// check if we're already close enough
|
||||
double currentError = system.error(initial);
|
||||
if(currentError <= params.errorTol) {
|
||||
|
|
Loading…
Reference in New Issue