Usage looks like this:
ceres::Problem problem;
...
MarginalizeOutVariablesQR(MarginalizationOptionsQR(),
{&variable_to_marginalize},
&problem);
See https://evanlev.github.io/marginalization.pdf for more info.
Ceres Solver is an open source C++ library for modeling and solving large, complicated optimization problems. It is a feature rich, mature and performant library which has been used in production at Google since 2010. Ceres Solver can solve two kinds of problems.
- Non-linear Least Squares problems with bounds constraints.
- General unconstrained optimization problems.
Please see ceres-solver.org for more information.