Skip to content

Commit

Permalink
Merge branch 'feature/approximate_hybrid' into feature/pruning_hybrid
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfFan committed Jan 21, 2022
2 parents 3956668 + 1c7e984 commit 060638f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions gtsam/hybrid/HybridFactorGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ pair<GaussianMixture::shared_ptr, boost::shared_ptr<Factor>> EliminateHybrid(
// STEP 1: ELIMINATE
// Eliminate each sum using conventional Cholesky:
// We can use this by creating a *new* decision tree:

// Each pair is a GaussianConditional and the factor generated after
// elimination.
using Pair = GaussianFactorGraph::EliminationResult;

KeyVector keysOfEliminated; // Not the ordering
Expand Down
7 changes: 5 additions & 2 deletions gtsam/hybrid/HybridFactorGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,11 @@ class HybridFactorGraph : protected FactorGraph<Factor>,
*/
DCGaussianMixtureFactor::Sum sum() const;

/// Convert the DecisionTree of (Key, GaussianFactorGraph) to (Key, Graph
/// Error).
/**
* @brief Convert the DecisionTree of (Key, GaussianFactorGraph) to
* (Key, Graph probability).
* @return DecisionTreeFactor::shared_ptr
*/
DecisionTreeFactor::shared_ptr toDecisionTreeFactor() const;

/// @}
Expand Down
3 changes: 2 additions & 1 deletion gtsam/hybrid/tests/testHybridFactorGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ GaussianFactorGraph::shared_ptr batchGFG(double between,
/* ****************************************************************************/
// Test elimination function by eliminating x1 and x2 in graph.
TEST(DCGaussianElimination, EliminateHybrid_2_Variable) {
Switching self(2);
Switching self(2, 1.0, 0.1);

auto factors = self.linearizedFactorGraph;

// Check that sum works:
Expand Down

0 comments on commit 060638f

Please sign in to comment.