V should be manifold, and then we can just use retract instead of advance
parent
4bbe66f106
commit
4c78ce32d4
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <gtsam/base/manifold.h>
|
||||||
#include <gtsam/nonlinear/NonlinearOptimizer.h>
|
#include <gtsam/nonlinear/NonlinearOptimizer.h>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
@ -175,6 +176,8 @@ double lineSearch(const S &system, const V currentValues, const W &gradient) {
|
||||||
template <class S, class V>
|
template <class S, class V>
|
||||||
V conjugateGradient(const S &system, const V &initial, const NonlinearOptimizerParams ¶ms, const bool gradientDescent) {
|
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
|
// check if we're already close enough
|
||||||
double currentError = system.error(initial);
|
double currentError = system.error(initial);
|
||||||
if(currentError <= params.errorTol) {
|
if(currentError <= params.errorTol) {
|
||||||
|
|
Loading…
Reference in New Issue