gtsam
Loading...
Searching...
No Matches
gtsam::NonlinearMultifrontalSolver Class Reference

Detailed Description

Multifrontal solver for nonlinear factor graphs.

This class extends MultifrontalSolver to solve nonlinear problems. The linearization is provided externally via load(), or via eliminateInPlace() which combines loading and elimination.

Inheritance diagram for gtsam::NonlinearMultifrontalSolver:

Public Member Functions

 NonlinearMultifrontalSolver (const NonlinearFactorGraph &graph, const Values &values, const Ordering &ordering, MultifrontalSolver::Parameters params={}, DampingParams dampingParams=DampingParams())
 Construct the solver from a nonlinear factor graph and linearization point.
void load (const GaussianFactorGraph &graph)
 Load new numerical values from the factor graph.
void eliminateInPlace (double lambda=0.0)
 Eliminate with optional LM-style damping.
void eliminateInPlace (const GaussianFactorGraph &graph, double lambda=0.0)
 Load and eliminate the graph in a single traversal with optional damping.
Public Member Functions inherited from gtsam::MultifrontalSolver
 MultifrontalSolver (const GaussianFactorGraph &graph, const Ordering &ordering, const Parameters &params=Parameters{})
 Construct the solver from a factor graph and an ordering.
 MultifrontalSolver (const GaussianFactorGraph &graph, const Ordering &ordering, size_t firstPhaseSize, const Parameters &params=Parameters{})
 Construct a solver configured for partial multifrontal elimination.
 MultifrontalSolver (PrecomputedData data, const Ordering &ordering, const Parameters &params=Parameters{})
 Construct the solver from precomputed symbolic data.
 MultifrontalSolver (PrecomputedData data, const Ordering &ordering, size_t firstPhaseSize, const Parameters &params=Parameters{})
 Construct a partial solver from precomputed symbolic data.
void load (const GaussianFactorGraph &graph)
 Load new numerical values from the factor graph.
void eliminateInPlace ()
 Eliminate the graph using Cholesky factorization.
void eliminateInPlace (const GaussianFactorGraph &graph)
 Load and eliminate the graph in a single traversal.
void eliminatePartialInPlace ()
 Eliminate the configured ordering prefix and assemble the retained clique factors without factorizing the retained variables.
void eliminatePartialInPlace (const GaussianFactorGraph &graph)
 Load a graph and partially eliminate it in one bottom-up traversal.
GaussianFactorGraph remainingFactorGraph () const
 Materialize one Hessian factor per retained clique after partial elimination.
GaussianBayesTree computeBayesTree () const
 Compute a Bayes tree from the in-place Cholesky factorization.
const VectorValuesupdateSolution ()
 Solve for the update vector.
const VectorValuesupdateSolution (const VectorValues &retainedSolution)
 Seed retained variables and back-substitute through eliminated cliques.
double deltaError (double *oldError=nullptr, double *newError=nullptr) const
 Return the linearized delta error from the last updateSolution() call.
const std::vector< CliquePtr > & roots () const
 Accessor for the roots of the elimination tree.
size_t cliqueCount () const
 Get the total number of cliques in the solver.
void print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const
 Print the solver state.
Public Member Functions inherited from gtsam::ForestTraversal< MultifrontalSolver, MultifrontalClique >
 ForestTraversal (size_t numThreads=std::thread::hardware_concurrency())
 Construct a helper with a fixed thread budget (used by TBB when enabled).
void runTopDown (Fn fn, int parallelThreshold=10)
 Scheduler-based top-down traversal.
void runBottomUp (Fn fn, int parallelThreshold=10, size_t leafAggregationProblemSize=0)
 Scheduler-based bottom-up traversal.

Static Public Member Functions

static MultifrontalSolver::PrecomputedData Precompute (const NonlinearFactorGraph &graph, const Values &values, const Ordering &ordering)
 Precompute symbolic structure from a nonlinear factor graph and values.
Static Public Member Functions inherited from gtsam::MultifrontalSolver
static PrecomputedData Precompute (const GaussianFactorGraph &graph, const Ordering &ordering)
 Precompute symbolic structure and sizing data from a factor graph.

Public Types

using DampingParams = LMDampingParams
Public Types inherited from gtsam::MultifrontalSolver
using Parameters = MultifrontalParameters
 Tuning parameters for traversal and reporting.
using CliquePtr = std::shared_ptr<MultifrontalClique>
 Shared pointer to a MultifrontalClique.
using Node = MultifrontalClique
 Node type for tree traversal utilities.

Additional Inherited Members

Protected Attributes inherited from gtsam::MultifrontalSolver
std::vector< CliquePtrroots_
 Roots of the elimination tree.
std::vector< CliquePtrcliques_
 All cliques in the solver.
std::map< Key, size_t > dims_
 Map from variable key to dimension.
VectorValues solution_
 Cached solution vector.
std::unordered_set< KeyfixedKeys_
 Keys fixed by constrained factors.
bool loaded_ = false
 Whether load() has been called.
bool eliminated_ = false
 Whether eliminateInPlace() ran.
bool partiallyEliminated_ = false
 Whether partial elimination ran.
Ordering ordering_
 Complete variable ordering.
size_t firstPhaseSize_ = 0
 Prefix eliminated in partial mode.
Parameters params_
 Tunable solver parameters.
double lastOldError_ = 0.0
 Cached old linearized error.
double lastNewError_ = 0.0
 Cached new linearized error.
bool hasDeltaError_ = false
 Whether updateSolution computed it.

Constructor & Destructor Documentation

◆ NonlinearMultifrontalSolver()

gtsam::NonlinearMultifrontalSolver::NonlinearMultifrontalSolver ( const NonlinearFactorGraph & graph,
const Values & values,
const Ordering & ordering,
MultifrontalSolver::Parameters params = {},
DampingParams dampingParams = DampingParams() )

Construct the solver from a nonlinear factor graph and linearization point.

This computes the symbolic structure (including fixed keys) from the nonlinear graph and uses the values to determine variable dimensions. Call load() with a linearized graph before eliminating.

Parameters
graphThe nonlinear factor graph to build structure from.
valuesThe linearization point used to determine variable dims.
orderingThe variable ordering to use.
paramsTunable parameters for traversal and reporting.

Member Function Documentation

◆ eliminateInPlace() [1/2]

void gtsam::NonlinearMultifrontalSolver::eliminateInPlace ( const GaussianFactorGraph & graph,
double lambda = 0.0 )

Load and eliminate the graph in a single traversal with optional damping.

This calls fillAb() and factorization per clique in post-order.

Parameters
graphThe linearized factor graph (structure must match).
lambdaOptional damping value; non-positive disables damping.

◆ eliminateInPlace() [2/2]

void gtsam::NonlinearMultifrontalSolver::eliminateInPlace ( double lambda = 0.0)

Eliminate with optional LM-style damping.

When lambda is provided, adds damping on frontal blocks before factorization.

◆ load()

void gtsam::NonlinearMultifrontalSolver::load ( const GaussianFactorGraph & graph)

Load new numerical values from the factor graph.

This overrides the base load() to optionally cache diag(J^T J) for exact diagonal damping when enabled.

◆ Precompute()

MultifrontalSolver::PrecomputedData gtsam::NonlinearMultifrontalSolver::Precompute ( const NonlinearFactorGraph & graph,
const Values & values,
const Ordering & ordering )
static

Precompute symbolic structure from a nonlinear factor graph and values.

This avoids linearization; call load() with a linearized graph before eliminating.


The documentation for this class was generated from the following files: