Added testable functions to GenericMultifrontalSolver and SymbolicMultifrontalSolver

release/4.3a0
Stephen Williams 2012-06-21 23:46:24 +00:00
parent 835d1d6b50
commit 6f58726a21
3 changed files with 33 additions and 1 deletions

View File

@ -39,6 +39,22 @@ namespace gtsam {
structure_(variableIndex), junctionTree_(new JT(*graph, *structure_)) {
}
/* ************************************************************************* */
template<class F, class JT>
void GenericMultifrontalSolver<F, JT>::print(const std::string& s) const {
this->structure_->print(s + " structure:\n");
this->junctionTree_->print(s + " jtree:");
}
/* ************************************************************************* */
template<class F, class JT>
bool GenericMultifrontalSolver<F, JT>::equals(
const GenericMultifrontalSolver& expected, double tol) const {
if (!this->structure_->equals(*expected.structure_, tol)) return false;
if (!this->junctionTree_->equals(*expected.junctionTree_, tol)) return false;
return true;
}
/* ************************************************************************* */
template<class F, class JT>
void GenericMultifrontalSolver<F, JT>::replaceFactors(const sharedGraph& graph) {

View File

@ -72,7 +72,17 @@ namespace gtsam {
GenericMultifrontalSolver(const sharedGraph& factorGraph,
const VariableIndex::shared_ptr& variableIndex);
/// @}
/// @}
/// @name Testable
/// @{
/** Print to cout */
void print(const std::string& name = "GenericMultifrontalSolver: ") const;
/** Test whether is equal to another */
bool equals(const GenericMultifrontalSolver& other, double tol = 1e-9) const;
/// @}
/// @name Standard Interface
/// @{

View File

@ -43,6 +43,12 @@ namespace gtsam {
SymbolicMultifrontalSolver(const SymbolicFactorGraph::shared_ptr& factorGraph,
const VariableIndex::shared_ptr& variableIndex) : Base(factorGraph, variableIndex) {};
/** Print to cout */
void print(const std::string& name = "SymbolicMultifrontalSolver: ") const { Base::print(name); };
/** Test whether is equal to another */
bool equals(const SymbolicMultifrontalSolver& other, double tol = 1e-9) const { return Base::equals(other, tol); };
/**
* Eliminate the factor graph sequentially. Uses a column elimination tree
* to recursively eliminate.