24 for (
const Key key : keys) {
25 std::vector<NonlinearFactor::shared_ptr>
factors;
26 for (
auto i : variableIndex[
key])
28 factors.push_back(graph->
at(
i));
31 Cluster::addFactors(key, factors);
36 return factors.linearize(values);
40 auto nonlinearCluster = boost::dynamic_pointer_cast<
NonlinearCluster>(cluster);
41 if (!nonlinearCluster)
42 throw std::runtime_error(
"Expected NonlinearCluster");
43 return nonlinearCluster.get();
53 return factors.linearizeToHessianFactor(values, ordering, dampen);
61 return factors.linearizeToHessianFactor(values, ordering, dampen);
71 for (
const auto& child : children) {
73 message->updateHessian(localFactor.get());
75 auto gaussianConditional = localFactor->eliminateCholesky(orderedFrontalKeys);
76 bayesNet.
add(gaussianConditional);
77 return {bayesNet, localFactor};
108 bayesNet->
push_back(bayesNet_newFactor_pair.first);
110 return bayesNet_newFactor_pair.second;
122 bayesNet->
push_back(bayesNet_newFactor_pair.first);
124 return bayesNet_newFactor_pair.second;
GaussianFactorGraph::shared_ptr linearize(const Values &values)
HessianFactor::shared_ptr linearizeAndEliminate(const Values &values, GaussianBayesNet *bayesNet, const Ordering &ordering, const NonlinearFactorGraph::Dampen &dampen=nullptr) const
FastVector< sharedNode > roots_
Factor Graph consisting of non-linear factors.
static enum @843 ordering
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
VectorValues optimize() const
Solve the GaussianBayesNet, i.e. return , by back-substitution.
Values updateCholesky(const Values &values)
GaussianFactorGraph factors(list_of(factor1)(factor2)(factor3))
Values retract(const VectorValues &delta) const
IsDerived< DERIVEDFACTOR > push_back(boost::shared_ptr< DERIVEDFACTOR > factor)
Add a factor directly using a shared_ptr.
IsDerived< DERIVEDFACTOR > add(boost::shared_ptr< DERIVEDFACTOR > factor)
add is a synonym for push_back.
const mpreal root(const mpreal &x, unsigned long int k, mp_rnd_t r=mpreal::get_default_rnd())
NonlinearFactorGraph graph
HessianFactor::shared_ptr linearizeToHessianFactor(const Values &values, const NonlinearFactorGraph::Dampen &dampen=nullptr) const
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
std::function< void(const boost::shared_ptr< HessianFactor > &hessianFactor)> Dampen
typdef for dampen functions used below
boost::shared_ptr< This > shared_ptr
A shared_ptr to this class.
NonlinearCluster(const VariableIndex &variableIndex, const KeyVector &keys, NonlinearFactorGraph *graph)
std::pair< GaussianBayesNet, HessianFactor::shared_ptr > linearizeAndEliminate(const Values &values, const NonlinearFactorGraph::Dampen &dampen=nullptr) const
static Ordering ColamdConstrainedFirst(const FACTOR_GRAPH &graph, const KeyVector &constrainFirst, bool forceOrder=false)
static NonlinearCluster * DownCast(const boost::shared_ptr< Cluster > &cluster)
std::pair< GaussianBayesNet, HessianFactor::shared_ptr > linearizeAndEliminate(const Values &values, const HessianFactor::shared_ptr &localFactor) const
const sharedFactor at(size_t i) const
HessianFactor::shared_ptr linearizeAndEliminate(const Values &values, GaussianBayesNet *bayesNet, const NonlinearFactorGraph::Dampen &dampen=nullptr) const
HessianFactor::shared_ptr linearizeToHessianFactor(const Values &values, const Ordering &ordering, const NonlinearFactorGraph::Dampen &dampen=nullptr) const
Gaussian Bayes Tree, the result of eliminating a GaussianJunctionTree.
std::uint64_t Key
Integer nonlinear key type.
std::pair< GaussianBayesNet, HessianFactor::shared_ptr > linearizeAndEliminate(const Values &values, const Ordering &ordering, const NonlinearFactorGraph::Dampen &dampen=nullptr) const