29 typedef internal::NonlinearOptimizerState
State;
41 return linear->gradientAtZero();
46 :
Base(graph,
std::unique_ptr<State>(new State(initialValues, graph.
error(initialValues)))),
54 const State &
state)
const {
59 const State ¤t,
const double alpha,
const Gradient &
g)
const {
66 const auto [newValues,
dummy] = nonlinearConjugateGradient<System, Values>(
def step(data, isam, result, truth, currPoseIndex)
double error(const State &state) const
A non-templated config holding any types of Manifold-group elements.
const Values & optimize() override
size_t iterations() const
return number of iterations in current optimizer state
NonlinearFactorGraph graph
void g(const string &key, int i)
static const SmartProjectionParams params
Values retract(const VectorValues &delta) const
std::shared_ptr< GaussianFactorGraph > linearize(const Values &linearizationPoint) const
Linearize a nonlinear factor graph.
std::unique_ptr< internal::NonlinearOptimizerState > state_
PIMPL'd state.
GaussianFactorGraph::shared_ptr iterate() override
std::tuple< V, int > nonlinearConjugateGradient(const S &system, const V &initial, const NonlinearOptimizerParams ¶ms, const bool singleIteration, const bool gradientDescent=false)
Gradient gradient(const State &state) const
Linear Factor Graph where all factors are Gaussians.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
double error(const Values &values) const
internal::DoglegState State
NonlinearConjugateGradientOptimizer(const NonlinearFactorGraph &graph, const Values &initialValues, const Parameters ¶ms=Parameters())
Constructor.
static VectorValues gradientInPlace(const NonlinearFactorGraph &nfg, const Values &values)
Return the gradient vector of a nonlinear factor graph.
State advance(const State ¤t, const double alpha, const Gradient &g) const
NonlinearFactorGraph graph_
The graph with nonlinear factors.
Private class for NonlinearOptimizer state.
Simple non-linear optimizer that solves using non-preconditioned CG.