release/4.3a0
Frank Dellaert 2011-10-22 19:53:44 +00:00
parent 661e8bd962
commit d3dd6f5fa2
25 changed files with 87 additions and 99 deletions

View File

@ -1,8 +1,7 @@
/** /**
* @file EliminationTree.cpp * @file EliminationTree.cpp
* @brief
* @author Frank Dellaert * @author Frank Dellaert
* @created Oct 13, 2010 * @date Oct 13, 2010
*/ */
#pragma once #pragma once

View File

@ -1,8 +1,7 @@
/** /**
* @file EliminationTree.h * @file EliminationTree.h
* @brief
* @author Frank Dellaert * @author Frank Dellaert
* @created Oct 13, 2010 * @date Oct 13, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file Factor-inl.h * @file Factor-inl.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Sep 1, 2010 * @date Sep 1, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file GenericMultifrontalSolver-inl.h * @file GenericMultifrontalSolver-inl.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 21, 2010 * @date Oct 21, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file GenericMultifrontalSolver.h * @file GenericMultifrontalSolver.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 21, 2010 * @date Oct 21, 2010
*/ */
#pragma once #pragma once
@ -25,74 +24,80 @@
namespace gtsam { namespace gtsam {
/** /**
* A Generic Multifrontal Solver class * A Generic Multifrontal Solver class
* Takes two template arguments: *
* FACTOR the factor type, e.g., GaussianFactor, DiscreteFactor * A solver is given a factor graph at construction, and implements
* JUNCTIONTREE annoyingly, you also have to supply a compatible JT type * a strategy to solve it (in this case, eliminate into a Bayes tree).
* i.e., one templated on a factor graph with the same factors * This generic one will create a Bayes tree when eliminate() is called.
* TODO: figure why this is so and possibly fix it *
*/ * Takes two template arguments:
template<class FACTOR, class JUNCTIONTREE> * FACTOR the factor type, e.g., GaussianFactor, DiscreteFactor
class GenericMultifrontalSolver { * 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 FACTOR, class JUNCTIONTREE>
class GenericMultifrontalSolver {
protected: protected:
// Column structure of the factor graph /// Column structure of the factor graph
VariableIndex::shared_ptr structure_; VariableIndex::shared_ptr structure_;
// Junction tree that performs elimination. /// Junction tree that performs elimination.
typename JUNCTIONTREE::shared_ptr junctionTree_; typename JUNCTIONTREE::shared_ptr junctionTree_;
public:
typedef typename FactorGraph<FACTOR>::shared_ptr sharedGraph; public:
typedef typename FactorGraph<FACTOR>::Eliminate Eliminate;
/** typedef typename FactorGraph<FACTOR>::shared_ptr sharedGraph;
* Construct the solver for a factor graph. This builds the junction typedef typename FactorGraph<FACTOR>::Eliminate Eliminate;
* tree, which does the symbolic elimination, identifies the cliques,
* and distributes all the factors to the right cliques.
*/
GenericMultifrontalSolver(const FactorGraph<FACTOR>& factorGraph);
/** /**
* Construct the solver with a shared pointer to a factor graph and to a * Construct the solver for a factor graph. This builds the junction
* VariableIndex. The solver will store these pointers, so this constructor * tree, which does the symbolic elimination, identifies the cliques,
* is the fastest. * and distributes all the factors to the right cliques.
*/ */
GenericMultifrontalSolver(const sharedGraph& factorGraph, GenericMultifrontalSolver(const FactorGraph<FACTOR>& 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); const VariableIndex::shared_ptr& variableIndex);
/** /**
* Replace the factor graph with a new one having the same structure. The * 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, * This function can be used if the numerical part of the factors changes,
* such as during relinearization or adjusting of noise models. * such as during relinearization or adjusting of noise models.
*/ */
void replaceFactors(const sharedGraph& factorGraph); void replaceFactors(const sharedGraph& factorGraph);
/** /**
* Eliminate the factor graph sequentially. Uses a column elimination tree * Eliminate the factor graph sequentially. Uses a column elimination tree
* to recursively eliminate. * to recursively eliminate.
*/ */
typename JUNCTIONTREE::BayesTree::shared_ptr typename JUNCTIONTREE::BayesTree::shared_ptr
eliminate(Eliminate function) const; eliminate(Eliminate function) const;
/** /**
* Compute the marginal joint over a set of variables, by integrating out * 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 * all of the other variables. This function returns the result as a factor
* graph. * graph.
*/ */
typename FactorGraph<FACTOR>::shared_ptr jointFactorGraph( typename FactorGraph<FACTOR>::shared_ptr jointFactorGraph(
const std::vector<Index>& js, Eliminate function) const; const std::vector<Index>& js, Eliminate function) const;
/** /**
* Compute the marginal density over a variable, by integrating out * Compute the marginal density over a variable, by integrating out
* all of the other variables. This function returns the result as a factor. * all of the other variables. This function returns the result as a factor.
*/ */
typename FACTOR::shared_ptr marginalFactor(Index j, Eliminate function) const; typename FACTOR::shared_ptr marginalFactor(Index j,
Eliminate function) const;
}; };
}
} // gtsam

View File

@ -13,7 +13,7 @@
* @file GenericSequentialSolver-inl.h * @file GenericSequentialSolver-inl.h
* @brief Implementation for generic sequential solver * @brief Implementation for generic sequential solver
* @author Richard Roberts * @author Richard Roberts
* @created Oct 21, 2010 * @date Oct 21, 2010
*/ */
#pragma once #pragma once

View File

@ -13,7 +13,7 @@
* @file GenericSequentialSolver.h * @file GenericSequentialSolver.h
* @brief generic sequential elimination * @brief generic sequential elimination
* @author Richard Roberts * @author Richard Roberts
* @created Oct 21, 2010 * @date Oct 21, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file IndexConditional.cpp * @file IndexConditional.cpp
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 17, 2010 * @date Oct 17, 2010
*/ */
#include <gtsam/base/FastSet.h> #include <gtsam/base/FastSet.h>

View File

@ -11,9 +11,8 @@
/** /**
* @file IndexConditional.h * @file IndexConditional.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 17, 2010 * @date Oct 17, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file IndexFactor.cpp * @file IndexFactor.cpp
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 17, 2010 * @date Oct 17, 2010
*/ */
#include <gtsam/inference/IndexFactor.h> #include <gtsam/inference/IndexFactor.h>

View File

@ -11,9 +11,8 @@
/** /**
* @file IndexFactor.h * @file IndexFactor.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 17, 2010 * @date Oct 17, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file Permutation.cpp * @file Permutation.cpp
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 9, 2010 * @date Oct 9, 2010
*/ */
#include <gtsam/inference/Permutation.h> #include <gtsam/inference/Permutation.h>

View File

@ -11,9 +11,8 @@
/** /**
* @file Permutation.h * @file Permutation.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Sep 12, 2010 * @date Sep 12, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file SymbolicMultifrontalSolver.cpp * @file SymbolicMultifrontalSolver.cpp
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 22, 2010 * @date Oct 22, 2010
*/ */
#include <gtsam/inference/SymbolicMultifrontalSolver.h> #include <gtsam/inference/SymbolicMultifrontalSolver.h>

View File

@ -11,9 +11,8 @@
/** /**
* @file SymbolicMultifrontalSolver.h * @file SymbolicMultifrontalSolver.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 22, 2010 * @date Oct 22, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file SymbolicSequentialSolver.cpp * @file SymbolicSequentialSolver.cpp
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 21, 2010 * @date Oct 21, 2010
*/ */
#include <gtsam/inference/SymbolicSequentialSolver.h> #include <gtsam/inference/SymbolicSequentialSolver.h>

View File

@ -11,9 +11,8 @@
/** /**
* @file SymbolicSequentialSolver.h * @file SymbolicSequentialSolver.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 21, 2010 * @date Oct 21, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file VariableIndex.cpp * @file VariableIndex.cpp
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 22, 2010 * @date Oct 22, 2010
*/ */
#include <iostream> #include <iostream>

View File

@ -11,9 +11,8 @@
/** /**
* @file VariableIndex.h * @file VariableIndex.h
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Sep 12, 2010 * @date Sep 12, 2010
*/ */
#pragma once #pragma once

View File

@ -11,9 +11,8 @@
/** /**
* @file VariableSlots.cpp * @file VariableSlots.cpp
* @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 5, 2010 * @date Oct 5, 2010
*/ */
#include <gtsam/inference/VariableSlots.h> #include <gtsam/inference/VariableSlots.h>

View File

@ -13,7 +13,7 @@
* @file VariableSlots.h * @file VariableSlots.h
* @brief VariableSlots describes the structure of a combined factor in terms of where each block comes from in the source factors. * @brief VariableSlots describes the structure of a combined factor in terms of where each block comes from in the source factors.
* @author Richard Roberts * @author Richard Roberts
* @created Oct 4, 2010 * @date Oct 4, 2010
*/ */
#pragma once #pragma once

View File

@ -13,7 +13,7 @@
* @file testEliminationTree.cpp * @file testEliminationTree.cpp
* @brief * @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 14, 2010 * @date Oct 14, 2010
*/ */
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>

View File

@ -13,7 +13,7 @@
* @file testInference.cpp * @file testInference.cpp
* @brief * @brief
* @author Richard Roberts * @author Richard Roberts
* @created Dec 6, 2010 * @date Dec 6, 2010
*/ */
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>

View File

@ -13,7 +13,7 @@
* @file testVariableIndex.cpp * @file testVariableIndex.cpp
* @brief * @brief
* @author Richard Roberts * @author Richard Roberts
* @created Sep 26, 2010 * @date Sep 26, 2010
*/ */
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>

View File

@ -13,7 +13,7 @@
* @file testVariableSlots.cpp * @file testVariableSlots.cpp
* @brief * @brief
* @author Richard Roberts * @author Richard Roberts
* @created Oct 5, 2010 * @date Oct 5, 2010
*/ */
#include <CppUnitLite/TestHarness.h> #include <CppUnitLite/TestHarness.h>