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
* @brief
* @author Frank Dellaert
* @created Oct 13, 2010
* @date Oct 13, 2010
*/
#pragma once

View File

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

View File

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

View File

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

View File

@ -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 FACTOR, class JUNCTIONTREE>
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 FACTOR, class JUNCTIONTREE>
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<FACTOR>::shared_ptr sharedGraph;
typedef typename FactorGraph<FACTOR>::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<FACTOR>& factorGraph);
typedef typename FactorGraph<FACTOR>::shared_ptr sharedGraph;
typedef typename FactorGraph<FACTOR>::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<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);
/**
* 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<FACTOR>::shared_ptr jointFactorGraph(
const std::vector<Index>& 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<FACTOR>::shared_ptr jointFactorGraph(
const std::vector<Index>& 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

View File

@ -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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -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

View File

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

View File

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

View File

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

View File

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