graph.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2 
3  * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4  * Atlanta, Georgia 30332-0415
5  * All Rights Reserved
6  * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7 
8  * See LICENSE for the license information
9 
10  * -------------------------------------------------------------------------- */
11 
19 #pragma once
20 
21 #include <map>
22 
23 #define BOOST_NO_HASH // to pacify the warnings about depricated headers in boost.graph
24 
25 #include <boost/graph/graph_traits.hpp>
26 #include <boost/graph/adjacency_list.hpp>
27 #include <memory>
28 #include <gtsam/nonlinear/Values.h>
29 
30 namespace gtsam {
31 
32  // type definitions :
33 
37  template<class KEY>
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> > {
41  public:
42  typedef typename boost::graph_traits<SDGraph<KEY> >::vertex_descriptor Vertex;
43  };
44 
45  template<class KEY>
46  class SGraph : public boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
47  boost::property<boost::vertex_name_t, KEY> > {
48  public:
49  typedef typename boost::graph_traits<SGraph<KEY> >::vertex_descriptor Vertex;
50  };
51 
52  //typedef boost::graph_traits<SGraph>::vertex_descriptor SVertex;
53 
57  template<class KEY>
58  class PredecessorMap: public std::map<KEY, KEY> {
59  public:
61  inline void insert(const KEY& key, const KEY& parent) {
62  std::map<KEY, KEY>::emplace(key, parent);
63  }
64  };
65 
69  template<class KEY>
70  std::list<KEY> predecessorMap2Keys(const PredecessorMap<KEY>& p_map);
71 
78  template<class G, class F, class KEY> SDGraph<KEY> toBoostGraph(const G& graph);
79 
85  template<class G, class V, class KEY>
86  std::tuple<G, V, std::map<KEY,V> > predecessorMap2Graph(const PredecessorMap<KEY>& p_map);
87 
91  template<class G, class Factor, class POSE, class KEY>
92  std::shared_ptr<Values>
93  composePoses(const G& graph, const PredecessorMap<KEY>& tree, const POSE& rootPose);
94 
95 
99  template<class G, class KEY, class FACTOR2>
100  PredecessorMap<KEY> findMinimumSpanningTree(const G& g) ;
101 
106  template<class G, class KEY, class FACTOR2>
107  void split(const G& g, const PredecessorMap<KEY>& tree, G& Ab1, G& Ab2) ;
108 
109 
110 } // namespace gtsam
111 
gtsam::PredecessorMap::insert
void insert(const KEY &key, const KEY &parent)
Definition: graph.h:61
tree
Definition: testExpression.cpp:212
graph-inl.h
gtsam::PredecessorMap
Definition: graph.h:58
gtsam::composePoses
std::shared_ptr< Values > composePoses(const G &graph, const PredecessorMap< KEY > &tree, const POSE &rootPose)
Definition: graph-inl.h:167
gtsam::toBoostGraph
SDGraph< KEY > toBoostGraph(const G &graph)
Definition: graph-inl.h:63
gtsam::SDGraph::Vertex
boost::graph_traits< SDGraph< KEY > >::vertex_descriptor Vertex
Definition: graph.h:42
gtsam::predecessorMap2Graph
std::tuple< G, V, std::map< KEY, V > > predecessorMap2Graph(const PredecessorMap< KEY > &p_map)
Definition: graph-inl.h:113
gtsam::predecessorMap2Keys
std::list< KEY > predecessorMap2Keys(const PredecessorMap< KEY > &p_map)
Definition: graph-inl.h:50
test_KarcherMeanFactor.KEY
int KEY
Definition: test_KarcherMeanFactor.py:22
g
void g(const string &key, int i)
Definition: testBTree.cpp:41
gtsam::SDGraph
Definition: graph.h:38
key
const gtsam::Symbol key('X', 0)
gtsam
traits
Definition: SFMdata.h:40
gtsam::SGraph
Definition: graph.h:46
gtsam::SGraph::Vertex
boost::graph_traits< SGraph< KEY > >::vertex_descriptor Vertex
Definition: graph.h:49
G
JacobiRotation< float > G
Definition: Jacobi_makeGivens.cpp:2
gtsam::split
void split(const G &g, const PredecessorMap< KEY > &tree, G &Ab1, G &Ab2)
Definition: graph-inl.h:245
graph
NonlinearFactorGraph graph
Definition: doc/Code/OdometryExample.cpp:2
gtsam::findMinimumSpanningTree
PredecessorMap< KEY > findMinimumSpanningTree(const G &fg)
Definition: graph-inl.h:222
Values.h
A non-templated config holding any types of Manifold-group elements.


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:38