diff --git a/gtsam/inference/EliminationTree-inl.h b/gtsam/inference/EliminationTree-inl.h index 13b305457..1d62e46fc 100644 --- a/gtsam/inference/EliminationTree-inl.h +++ b/gtsam/inference/EliminationTree-inl.h @@ -1,8 +1,7 @@ /** * @file EliminationTree.cpp - * @brief * @author Frank Dellaert - * @created Oct 13, 2010 + * @date Oct 13, 2010 */ #pragma once diff --git a/gtsam/inference/EliminationTree.h b/gtsam/inference/EliminationTree.h index 55fc47405..6e47983a0 100644 --- a/gtsam/inference/EliminationTree.h +++ b/gtsam/inference/EliminationTree.h @@ -1,8 +1,7 @@ /** * @file EliminationTree.h - * @brief * @author Frank Dellaert - * @created Oct 13, 2010 + * @date Oct 13, 2010 */ #pragma once diff --git a/gtsam/inference/Factor-inl.h b/gtsam/inference/Factor-inl.h index 82bb29cc8..822c6a0cd 100644 --- a/gtsam/inference/Factor-inl.h +++ b/gtsam/inference/Factor-inl.h @@ -11,9 +11,8 @@ /** * @file Factor-inl.h - * @brief * @author Richard Roberts - * @created Sep 1, 2010 + * @date Sep 1, 2010 */ #pragma once diff --git a/gtsam/inference/GenericMultifrontalSolver-inl.h b/gtsam/inference/GenericMultifrontalSolver-inl.h index a202a4700..30685a751 100644 --- a/gtsam/inference/GenericMultifrontalSolver-inl.h +++ b/gtsam/inference/GenericMultifrontalSolver-inl.h @@ -11,9 +11,8 @@ /** * @file GenericMultifrontalSolver-inl.h - * @brief * @author Richard Roberts - * @created Oct 21, 2010 + * @date Oct 21, 2010 */ #pragma once diff --git a/gtsam/inference/GenericMultifrontalSolver.h b/gtsam/inference/GenericMultifrontalSolver.h index e8d4a3023..4228a058b 100644 --- a/gtsam/inference/GenericMultifrontalSolver.h +++ b/gtsam/inference/GenericMultifrontalSolver.h @@ -11,9 +11,8 @@ /** * @file GenericMultifrontalSolver.h - * @brief * @author Richard Roberts - * @created Oct 21, 2010 + * @date Oct 21, 2010 */ #pragma once @@ -25,74 +24,80 @@ namespace gtsam { -/** - * A Generic Multifrontal Solver class - * Takes two template arguments: - * FACTOR the factor type, e.g., GaussianFactor, DiscreteFactor - * JUNCTIONTREE annoyingly, you also have to supply a compatible JT type - * i.e., one templated on a factor graph with the same factors - * TODO: figure why this is so and possibly fix it - */ -template -class GenericMultifrontalSolver { + /** + * A Generic Multifrontal Solver class + * + * A solver is given a factor graph at construction, and implements + * a strategy to solve it (in this case, eliminate into a Bayes tree). + * This generic one will create a Bayes tree when eliminate() is called. + * + * Takes two template arguments: + * FACTOR the factor type, e.g., GaussianFactor, DiscreteFactor + * JUNCTIONTREE annoyingly, you also have to supply a compatible JT type + * i.e., one templated on a factor graph with the same factors + * TODO: figure why this is so and possibly fix it + */ + template + class GenericMultifrontalSolver { -protected: + protected: - // Column structure of the factor graph - VariableIndex::shared_ptr structure_; + /// Column structure of the factor graph + VariableIndex::shared_ptr structure_; - // Junction tree that performs elimination. - typename JUNCTIONTREE::shared_ptr junctionTree_; -public: + /// Junction tree that performs elimination. + typename JUNCTIONTREE::shared_ptr junctionTree_; - typedef typename FactorGraph::shared_ptr sharedGraph; - typedef typename FactorGraph::Eliminate Eliminate; + public: - /** - * Construct the solver for a factor graph. This builds the junction - * tree, which does the symbolic elimination, identifies the cliques, - * and distributes all the factors to the right cliques. - */ - GenericMultifrontalSolver(const FactorGraph& factorGraph); + typedef typename FactorGraph::shared_ptr sharedGraph; + typedef typename FactorGraph::Eliminate Eliminate; - /** - * Construct the solver with a shared pointer to a factor graph and to a - * VariableIndex. The solver will store these pointers, so this constructor - * is the fastest. - */ - GenericMultifrontalSolver(const sharedGraph& factorGraph, + /** + * Construct the solver for a factor graph. This builds the junction + * tree, which does the symbolic elimination, identifies the cliques, + * and distributes all the factors to the right cliques. + */ + GenericMultifrontalSolver(const FactorGraph& factorGraph); + + /** + * Construct the solver with a shared pointer to a factor graph and to a + * VariableIndex. The solver will store these pointers, so this constructor + * is the fastest. + */ + GenericMultifrontalSolver(const sharedGraph& factorGraph, const VariableIndex::shared_ptr& variableIndex); - /** - * Replace the factor graph with a new one having the same structure. The - * This function can be used if the numerical part of the factors changes, - * such as during relinearization or adjusting of noise models. - */ - void replaceFactors(const sharedGraph& factorGraph); + /** + * Replace the factor graph with a new one having the same structure. The + * This function can be used if the numerical part of the factors changes, + * such as during relinearization or adjusting of noise models. + */ + void replaceFactors(const sharedGraph& factorGraph); - /** - * Eliminate the factor graph sequentially. Uses a column elimination tree - * to recursively eliminate. - */ - typename JUNCTIONTREE::BayesTree::shared_ptr + /** + * Eliminate the factor graph sequentially. Uses a column elimination tree + * to recursively eliminate. + */ + typename JUNCTIONTREE::BayesTree::shared_ptr eliminate(Eliminate function) const; - /** - * Compute the marginal joint over a set of variables, by integrating out - * all of the other variables. This function returns the result as a factor - * graph. - */ - typename FactorGraph::shared_ptr jointFactorGraph( - const std::vector& js, Eliminate function) const; + /** + * Compute the marginal joint over a set of variables, by integrating out + * all of the other variables. This function returns the result as a factor + * graph. + */ + typename FactorGraph::shared_ptr jointFactorGraph( + const std::vector& js, Eliminate function) const; - /** - * Compute the marginal density over a variable, by integrating out - * all of the other variables. This function returns the result as a factor. - */ - typename FACTOR::shared_ptr marginalFactor(Index j, Eliminate function) const; + /** + * Compute the marginal density over a variable, by integrating out + * all of the other variables. This function returns the result as a factor. + */ + typename FACTOR::shared_ptr marginalFactor(Index j, + Eliminate function) const; -}; - -} + }; +} // gtsam diff --git a/gtsam/inference/GenericSequentialSolver-inl.h b/gtsam/inference/GenericSequentialSolver-inl.h index 836168d15..b4bd22e67 100644 --- a/gtsam/inference/GenericSequentialSolver-inl.h +++ b/gtsam/inference/GenericSequentialSolver-inl.h @@ -13,7 +13,7 @@ * @file GenericSequentialSolver-inl.h * @brief Implementation for generic sequential solver * @author Richard Roberts - * @created Oct 21, 2010 + * @date Oct 21, 2010 */ #pragma once diff --git a/gtsam/inference/GenericSequentialSolver.h b/gtsam/inference/GenericSequentialSolver.h index 2df529203..16d47f8df 100644 --- a/gtsam/inference/GenericSequentialSolver.h +++ b/gtsam/inference/GenericSequentialSolver.h @@ -13,7 +13,7 @@ * @file GenericSequentialSolver.h * @brief generic sequential elimination * @author Richard Roberts - * @created Oct 21, 2010 + * @date Oct 21, 2010 */ #pragma once diff --git a/gtsam/inference/IndexConditional.cpp b/gtsam/inference/IndexConditional.cpp index 532e79248..eca7a220d 100644 --- a/gtsam/inference/IndexConditional.cpp +++ b/gtsam/inference/IndexConditional.cpp @@ -11,9 +11,8 @@ /** * @file IndexConditional.cpp - * @brief * @author Richard Roberts - * @created Oct 17, 2010 + * @date Oct 17, 2010 */ #include diff --git a/gtsam/inference/IndexConditional.h b/gtsam/inference/IndexConditional.h index a156f2bf0..6e0a700a0 100644 --- a/gtsam/inference/IndexConditional.h +++ b/gtsam/inference/IndexConditional.h @@ -11,9 +11,8 @@ /** * @file IndexConditional.h - * @brief * @author Richard Roberts - * @created Oct 17, 2010 + * @date Oct 17, 2010 */ #pragma once diff --git a/gtsam/inference/IndexFactor.cpp b/gtsam/inference/IndexFactor.cpp index c7fd753f6..f74aa4ff5 100644 --- a/gtsam/inference/IndexFactor.cpp +++ b/gtsam/inference/IndexFactor.cpp @@ -11,9 +11,8 @@ /** * @file IndexFactor.cpp - * @brief * @author Richard Roberts - * @created Oct 17, 2010 + * @date Oct 17, 2010 */ #include diff --git a/gtsam/inference/IndexFactor.h b/gtsam/inference/IndexFactor.h index 2f34969ee..2bea9998f 100644 --- a/gtsam/inference/IndexFactor.h +++ b/gtsam/inference/IndexFactor.h @@ -11,9 +11,8 @@ /** * @file IndexFactor.h - * @brief * @author Richard Roberts - * @created Oct 17, 2010 + * @date Oct 17, 2010 */ #pragma once diff --git a/gtsam/inference/Permutation.cpp b/gtsam/inference/Permutation.cpp index f162df712..5bcb1fef8 100644 --- a/gtsam/inference/Permutation.cpp +++ b/gtsam/inference/Permutation.cpp @@ -11,9 +11,8 @@ /** * @file Permutation.cpp - * @brief * @author Richard Roberts - * @created Oct 9, 2010 + * @date Oct 9, 2010 */ #include diff --git a/gtsam/inference/Permutation.h b/gtsam/inference/Permutation.h index 75149718f..43129e0d4 100644 --- a/gtsam/inference/Permutation.h +++ b/gtsam/inference/Permutation.h @@ -11,9 +11,8 @@ /** * @file Permutation.h - * @brief * @author Richard Roberts - * @created Sep 12, 2010 + * @date Sep 12, 2010 */ #pragma once diff --git a/gtsam/inference/SymbolicMultifrontalSolver.cpp b/gtsam/inference/SymbolicMultifrontalSolver.cpp index b849046f1..77df4e04d 100644 --- a/gtsam/inference/SymbolicMultifrontalSolver.cpp +++ b/gtsam/inference/SymbolicMultifrontalSolver.cpp @@ -11,9 +11,8 @@ /** * @file SymbolicMultifrontalSolver.cpp - * @brief * @author Richard Roberts - * @created Oct 22, 2010 + * @date Oct 22, 2010 */ #include diff --git a/gtsam/inference/SymbolicMultifrontalSolver.h b/gtsam/inference/SymbolicMultifrontalSolver.h index 2233cdd03..35b253c31 100644 --- a/gtsam/inference/SymbolicMultifrontalSolver.h +++ b/gtsam/inference/SymbolicMultifrontalSolver.h @@ -11,9 +11,8 @@ /** * @file SymbolicMultifrontalSolver.h - * @brief * @author Richard Roberts - * @created Oct 22, 2010 + * @date Oct 22, 2010 */ #pragma once diff --git a/gtsam/inference/SymbolicSequentialSolver.cpp b/gtsam/inference/SymbolicSequentialSolver.cpp index 17fc9cc4c..e202de6e5 100644 --- a/gtsam/inference/SymbolicSequentialSolver.cpp +++ b/gtsam/inference/SymbolicSequentialSolver.cpp @@ -11,9 +11,8 @@ /** * @file SymbolicSequentialSolver.cpp - * @brief * @author Richard Roberts - * @created Oct 21, 2010 + * @date Oct 21, 2010 */ #include diff --git a/gtsam/inference/SymbolicSequentialSolver.h b/gtsam/inference/SymbolicSequentialSolver.h index 84896d0db..d6e21e88e 100644 --- a/gtsam/inference/SymbolicSequentialSolver.h +++ b/gtsam/inference/SymbolicSequentialSolver.h @@ -11,9 +11,8 @@ /** * @file SymbolicSequentialSolver.h - * @brief * @author Richard Roberts - * @created Oct 21, 2010 + * @date Oct 21, 2010 */ #pragma once diff --git a/gtsam/inference/VariableIndex.cpp b/gtsam/inference/VariableIndex.cpp index 75194f2b9..88e037434 100644 --- a/gtsam/inference/VariableIndex.cpp +++ b/gtsam/inference/VariableIndex.cpp @@ -11,9 +11,8 @@ /** * @file VariableIndex.cpp - * @brief * @author Richard Roberts - * @created Oct 22, 2010 + * @date Oct 22, 2010 */ #include diff --git a/gtsam/inference/VariableIndex.h b/gtsam/inference/VariableIndex.h index 51501a077..0d4456718 100644 --- a/gtsam/inference/VariableIndex.h +++ b/gtsam/inference/VariableIndex.h @@ -11,9 +11,8 @@ /** * @file VariableIndex.h - * @brief * @author Richard Roberts - * @created Sep 12, 2010 + * @date Sep 12, 2010 */ #pragma once diff --git a/gtsam/inference/VariableSlots.cpp b/gtsam/inference/VariableSlots.cpp index d4bc03583..a06aad6cb 100644 --- a/gtsam/inference/VariableSlots.cpp +++ b/gtsam/inference/VariableSlots.cpp @@ -11,9 +11,8 @@ /** * @file VariableSlots.cpp - * @brief * @author Richard Roberts - * @created Oct 5, 2010 + * @date Oct 5, 2010 */ #include diff --git a/gtsam/inference/VariableSlots.h b/gtsam/inference/VariableSlots.h index 17ae4e7b7..996560179 100644 --- a/gtsam/inference/VariableSlots.h +++ b/gtsam/inference/VariableSlots.h @@ -13,7 +13,7 @@ * @file VariableSlots.h * @brief VariableSlots describes the structure of a combined factor in terms of where each block comes from in the source factors. * @author Richard Roberts - * @created Oct 4, 2010 + * @date Oct 4, 2010 */ #pragma once diff --git a/gtsam/inference/tests/testEliminationTree.cpp b/gtsam/inference/tests/testEliminationTree.cpp index 4d50e7583..b1efc26c8 100644 --- a/gtsam/inference/tests/testEliminationTree.cpp +++ b/gtsam/inference/tests/testEliminationTree.cpp @@ -13,7 +13,7 @@ * @file testEliminationTree.cpp * @brief * @author Richard Roberts - * @created Oct 14, 2010 + * @date Oct 14, 2010 */ #include diff --git a/gtsam/inference/tests/testInference.cpp b/gtsam/inference/tests/testInference.cpp index df9ec4173..697ee9ec2 100644 --- a/gtsam/inference/tests/testInference.cpp +++ b/gtsam/inference/tests/testInference.cpp @@ -13,7 +13,7 @@ * @file testInference.cpp * @brief * @author Richard Roberts - * @created Dec 6, 2010 + * @date Dec 6, 2010 */ #include diff --git a/gtsam/inference/tests/testVariableIndex.cpp b/gtsam/inference/tests/testVariableIndex.cpp index f5a6f03ef..8e52e2176 100644 --- a/gtsam/inference/tests/testVariableIndex.cpp +++ b/gtsam/inference/tests/testVariableIndex.cpp @@ -13,7 +13,7 @@ * @file testVariableIndex.cpp * @brief * @author Richard Roberts - * @created Sep 26, 2010 + * @date Sep 26, 2010 */ #include diff --git a/gtsam/inference/tests/testVariableSlots.cpp b/gtsam/inference/tests/testVariableSlots.cpp index 5dc8e1f57..1dd422908 100644 --- a/gtsam/inference/tests/testVariableSlots.cpp +++ b/gtsam/inference/tests/testVariableSlots.cpp @@ -13,7 +13,7 @@ * @file testVariableSlots.cpp * @brief * @author Richard Roberts - * @created Oct 5, 2010 + * @date Oct 5, 2010 */ #include