Add full elimination
parent
53551e051d
commit
095f6ad7cc
|
@ -70,17 +70,19 @@ class HybridFactorGraph : public FactorGraph<HybridFactor>, public Eliminateable
|
|||
public:
|
||||
HybridFactorGraph() = default;
|
||||
|
||||
/** Construct from container of factors (shared_ptr or plain objects) */
|
||||
template <class CONTAINER>
|
||||
explicit HybridFactorGraph(const CONTAINER& factors) : Base(factors) {}
|
||||
// /** Construct from container of factors (shared_ptr or plain objects) */
|
||||
// template <class CONTAINER>
|
||||
// explicit HybridFactorGraph(const CONTAINER& factors) : Base(factors) {}
|
||||
|
||||
/** Implicit copy/downcast constructor to override explicit template container
|
||||
* constructor */
|
||||
* constructor. In BayesTree this is used for:
|
||||
* `cachedSeparatorMarginal_.reset(*separatorMarginal)`
|
||||
* */
|
||||
template <class DERIVEDFACTOR>
|
||||
HybridFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||
|
||||
using FactorGraph::add;
|
||||
|
||||
|
||||
/// Add a factor directly using a shared_ptr.
|
||||
void add(JacobianFactor &&factor);
|
||||
};
|
||||
|
|
|
@ -73,6 +73,19 @@ TEST(HybridFactorGraph, eliminateMultifrontal) {
|
|||
GTSAM_PRINT(*result.second);
|
||||
}
|
||||
|
||||
TEST(HybridFactorGraph, eliminateFullMultifrontal) {
|
||||
HybridFactorGraph hfg;
|
||||
|
||||
DiscreteKey x(X(1), 2);
|
||||
|
||||
hfg.add(JacobianFactor(X(0), I_3x3, Z_3x1));
|
||||
hfg.add(HybridDiscreteFactor(DecisionTreeFactor(x, {2, 8})));
|
||||
|
||||
auto result = hfg.eliminateMultifrontal();
|
||||
|
||||
GTSAM_PRINT(*result);
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
int main() {
|
||||
TestResult tr;
|
||||
|
|
Loading…
Reference in New Issue