25#include <boost/graph/graph_traits.hpp>
26#include <boost/graph/adjacency_list.hpp>
27#include <boost/shared_ptr.hpp>
38 class SDGraph:
public boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS,
39 boost::property<boost::vertex_name_t, KEY>, boost::property<
40 boost::edge_weight_t, double> > {
42 typedef typename boost::graph_traits<SDGraph<KEY> >::vertex_descriptor Vertex;
46 class SGraph :
public boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
47 boost::property<boost::vertex_name_t, KEY> > {
49 typedef typename boost::graph_traits<SGraph<KEY> >::vertex_descriptor Vertex;
61 inline void insert(
const KEY& key,
const KEY& parent) {
62 std::map<KEY, KEY>::insert(std::make_pair(key, parent));
78 template<
class G,
class F,
class KEY> SDGraph<KEY>
toBoostGraph(
const G& graph);
85 template<
class G,
class V,
class KEY>
91 template<
class G,
class Factor,
class POSE,
class KEY>
92 boost::shared_ptr<Values>
93 composePoses(
const G& graph,
const PredecessorMap<KEY>& tree,
const POSE& rootPose);
99 template<
class G,
class KEY,
class FACTOR2>
106 template<
class G,
class KEY,
class FACTOR2>
107 void split(
const G& g,
const PredecessorMap<KEY>& tree, G& Ab1, G& Ab2) ;
112#include <gtsam/inference/graph-inl.h>
A non-templated config holding any types of Manifold-group elements.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::list< KEY > predecessorMap2Keys(const PredecessorMap< KEY > &p_map)
Generate a list of keys from a spanning tree represented by its predecessor map.
Definition: graph-inl.h:50
void split(const G &g, const PredecessorMap< KEY > &tree, G &Ab1, G &Ab2)
Split the graph into two parts: one corresponds to the given spanning tree, and the other corresponds...
Definition: graph-inl.h:255
boost::shared_ptr< Values > composePoses(const G &graph, const PredecessorMap< KEY > &tree, const POSE &rootPose)
Compose the poses by following the chain specified by the spanning tree.
Definition: graph-inl.h:174
SDGraph< KEY > toBoostGraph(const G &graph)
Convert the factor graph to an SDGraph G = Graph type F = Factor type Key = Key type.
Definition: graph-inl.h:68
PredecessorMap< KEY > findMinimumSpanningTree(const G &fg)
find the minimum spanning tree using boost graph library
Definition: graph-inl.h:232
boost::tuple< G, V, std::map< KEY, V > > predecessorMap2Graph(const PredecessorMap< KEY > &p_map)
Build takes a predecessor map, and builds a directed graph corresponding to the tree.
Definition: graph-inl.h:118
SDGraph is undirected graph with variable keys and double edge weights.
Definition: graph.h:40
Map from variable key to parent key.
Definition: graph.h:58
void insert(const KEY &key, const KEY &parent)
convenience insert so we can pass ints for TypedSymbol keys
Definition: graph.h:61