2013-06-06 23:36:02 +08:00
|
|
|
/* ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
|
|
|
|
|
* Atlanta, Georgia 30332-0415
|
|
|
|
|
* All Rights Reserved
|
|
|
|
|
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
|
|
|
|
|
|
|
|
|
|
* See LICENSE for the license information
|
|
|
|
|
|
|
|
|
|
* -------------------------------------------------------------------------- */
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @file SymbolicFactor.cpp
|
|
|
|
|
* @author Richard Roberts
|
|
|
|
|
* @date Oct 17, 2010
|
|
|
|
|
*/
|
|
|
|
|
|
2013-08-16 01:21:20 +08:00
|
|
|
#include <gtsam/base/FastVector.h>
|
2013-07-30 07:55:40 +08:00
|
|
|
#include <gtsam/inference/Ordering.h>
|
|
|
|
|
#include <gtsam/symbolic/SymbolicFactor.h>
|
|
|
|
|
#include <gtsam/symbolic/SymbolicConditional.h>
|
|
|
|
|
#include <gtsam/symbolic/SymbolicFactorGraph.h>
|
2013-11-19 03:23:13 +08:00
|
|
|
#include <gtsam/symbolic/SymbolicFactor-inst.h>
|
2013-06-06 23:36:02 +08:00
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
namespace gtsam {
|
|
|
|
|
|
|
|
|
|
/* ************************************************************************* */
|
2013-07-30 07:55:40 +08:00
|
|
|
std::pair<boost::shared_ptr<SymbolicConditional>, boost::shared_ptr<SymbolicFactor> >
|
|
|
|
|
EliminateSymbolic(const SymbolicFactorGraph& factors, const Ordering& keys)
|
2013-06-06 23:36:02 +08:00
|
|
|
{
|
2013-11-19 03:23:13 +08:00
|
|
|
return internal::EliminateSymbolic(factors, keys);
|
2013-06-06 23:36:02 +08:00
|
|
|
}
|
|
|
|
|
|
2013-07-10 01:50:38 +08:00
|
|
|
/* ************************************************************************* */
|
2013-07-30 07:55:40 +08:00
|
|
|
bool SymbolicFactor::equals(const This& other, double tol) const
|
2013-07-10 01:50:38 +08:00
|
|
|
{
|
|
|
|
|
return Base::equals(other, tol);
|
|
|
|
|
}
|
|
|
|
|
|
2013-07-08 09:33:43 +08:00
|
|
|
/* ************************************************************************* */
|
2013-07-30 07:55:40 +08:00
|
|
|
std::pair<boost::shared_ptr<SymbolicConditional>, boost::shared_ptr<SymbolicFactor> >
|
|
|
|
|
SymbolicFactor::eliminate(const Ordering& keys) const
|
2013-07-08 09:33:43 +08:00
|
|
|
{
|
2013-07-30 07:55:40 +08:00
|
|
|
SymbolicFactorGraph graph;
|
2013-07-23 10:17:09 +08:00
|
|
|
graph += *this; // TODO: Is there a way to avoid copying this factor?
|
2013-07-30 07:55:40 +08:00
|
|
|
return EliminateSymbolic(graph, keys);
|
2013-07-08 09:33:43 +08:00
|
|
|
}
|
|
|
|
|
|
2013-06-06 23:36:02 +08:00
|
|
|
} // gtsam
|