combined update and pruning
parent
1b5a6ebba9
commit
d091a9d440
|
@ -258,7 +258,7 @@ TEST(HybridGaussianElimination, Approx_inference) {
|
||||||
|
|
||||||
/* ****************************************************************************/
|
/* ****************************************************************************/
|
||||||
// Test approximate inference with an additional pruning step.
|
// Test approximate inference with an additional pruning step.
|
||||||
TEST_DISABLED(HybridGaussianElimination, IncrementalApproximate) {
|
TEST(HybridGaussianElimination, IncrementalApproximate) {
|
||||||
Switching switching(5);
|
Switching switching(5);
|
||||||
HybridGaussianISAM incrementalHybrid;
|
HybridGaussianISAM incrementalHybrid;
|
||||||
HybridGaussianFactorGraph graph;
|
HybridGaussianFactorGraph graph;
|
||||||
|
@ -277,8 +277,7 @@ TEST_DISABLED(HybridGaussianElimination, IncrementalApproximate) {
|
||||||
|
|
||||||
// Run update with pruning
|
// Run update with pruning
|
||||||
size_t maxComponents = 5;
|
size_t maxComponents = 5;
|
||||||
incrementalHybrid.update(graph);
|
incrementalHybrid.update(graph, maxComponents);
|
||||||
incrementalHybrid.prune(maxComponents);
|
|
||||||
|
|
||||||
// Check if we have a bayes tree with 4 hybrid nodes,
|
// Check if we have a bayes tree with 4 hybrid nodes,
|
||||||
// each with 2, 4, 8, and 5 (pruned) leaves respectively.
|
// each with 2, 4, 8, and 5 (pruned) leaves respectively.
|
||||||
|
@ -298,8 +297,7 @@ TEST_DISABLED(HybridGaussianElimination, IncrementalApproximate) {
|
||||||
graph.push_back(switching.linearUnaryFactors.at(4)); // x4
|
graph.push_back(switching.linearUnaryFactors.at(4)); // x4
|
||||||
|
|
||||||
// Run update with pruning a second time.
|
// Run update with pruning a second time.
|
||||||
incrementalHybrid.update(graph);
|
incrementalHybrid.update(graph, maxComponents);
|
||||||
incrementalHybrid.prune(maxComponents);
|
|
||||||
|
|
||||||
// Check if we have a bayes tree with pruned hybrid nodes,
|
// Check if we have a bayes tree with pruned hybrid nodes,
|
||||||
// with 5 (pruned) leaves.
|
// with 5 (pruned) leaves.
|
||||||
|
@ -470,8 +468,7 @@ TEST(HybridGaussianISAM, NonTrivial) {
|
||||||
fg = HybridNonlinearFactorGraph();
|
fg = HybridNonlinearFactorGraph();
|
||||||
|
|
||||||
// Keep pruning!
|
// Keep pruning!
|
||||||
inc.update(gfg);
|
inc.update(gfg, 3);
|
||||||
inc.prune(3);
|
|
||||||
|
|
||||||
// The final discrete graph should not be empty since we have eliminated
|
// The final discrete graph should not be empty since we have eliminated
|
||||||
// all continuous variables.
|
// all continuous variables.
|
||||||
|
|
Loading…
Reference in New Issue