From 7b3ef381c1edf9773a924c9d7a273e4025f95282 Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Thu, 27 Jun 2013 23:03:38 +0000 Subject: [PATCH] Starting to add elimination traits class --- gtsam/inference/EliminateableFactorGraph.h | 15 +++++++++++++++ gtsam/symbolic/SymbolicFactorGraphUnordered.h | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/gtsam/inference/EliminateableFactorGraph.h b/gtsam/inference/EliminateableFactorGraph.h index 88176ad14..0ed6a375b 100644 --- a/gtsam/inference/EliminateableFactorGraph.h +++ b/gtsam/inference/EliminateableFactorGraph.h @@ -26,6 +26,21 @@ namespace gtsam { + /// Traits class for eliminateable factor graphs, specifies the types that result from + /// elimination, etc. This must be defined for each factor graph that inherits from + /// EliminateableFactorGraph. + template + class EliminationTraits + { + // Template for deriving: + // typedef MyFactor FactorType; // Type of factors in factor graph (e.g. GaussianFactor, SymbolicFactor) + // typedef MyBayesNet BayesNetType; // Type of Bayes net from sequential elimination (e.g. GaussianBayesNet) + // typedef MyEliminationTree EliminationTreeType; // Type of elimination tree (e.g. GaussianEliminationTree) + // typedef MyBayesTree BayesTreeType; // Type of Bayes tree (e.g. GaussianBayesTree) + // typedef MyJunctionTree JunctionTreeType; // Type of Junction tree (e.g. GaussianJunctionTree) + }; + + /** EliminateableFactorGraph is a base class for factor graphs that contains elimination * algorithms. Any factor graph holding eliminateable factors can derive from this class to * expose functions for computing marginals, conditional marginals, doing multifrontal and diff --git a/gtsam/symbolic/SymbolicFactorGraphUnordered.h b/gtsam/symbolic/SymbolicFactorGraphUnordered.h index e382e74bf..ae1bd755b 100644 --- a/gtsam/symbolic/SymbolicFactorGraphUnordered.h +++ b/gtsam/symbolic/SymbolicFactorGraphUnordered.h @@ -32,6 +32,13 @@ namespace gtsam { class SymbolicJunctionTreeUnordered; } namespace gtsam { + class SymbolicFactorGraphUnordered; + + template<> class EliminationTraits + { + + }; + /** Symbolic Factor Graph * \nosubgrouping */