remove template class G and V from predecessorMap2Graph as Frank suggested
parent
3c66861790
commit
6c7dfabe5b
|
|
@ -21,9 +21,6 @@ namespace gtsam {
|
|||
|
||||
//typedef boost::graph_traits<SDGraph>::vertex_iterator BoostVertexIterator;
|
||||
|
||||
//typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
|
||||
// boost::property<boost::vertex_name_t, std::string> > SGraph;
|
||||
//typedef boost::graph_traits<SGraph>::vertex_descriptor SVertex;
|
||||
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
@ -64,10 +61,12 @@ SDGraph<Key> toBoostGraph(const G& graph) {
|
|||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
template<class G, class V, class Key>
|
||||
boost::tuple<G, V, map<Key, V> > predecessorMap2Graph(const PredecessorMap<Key>& p_map) {
|
||||
template<class Key>
|
||||
boost::tuple<SDGraph<Key>, typename SDGraph<Key>::Vertex, std::map<Key, typename SDGraph<Key>::Vertex> >
|
||||
predecessorMap2Graph(const PredecessorMap<Key>& p_map) {
|
||||
|
||||
G g(0);
|
||||
typedef typename SDGraph<Key>::Vertex V;
|
||||
SDGraph<Key> g;
|
||||
map<Key, V> key2vertex;
|
||||
V v1, v2, root;
|
||||
Key child, parent;
|
||||
|
|
@ -95,7 +94,7 @@ boost::tuple<G, V, map<Key, V> > predecessorMap2Graph(const PredecessorMap<Key>&
|
|||
if (!foundRoot)
|
||||
throw invalid_argument("predecessorMap2Graph: invalid predecessor map!");
|
||||
|
||||
return boost::tuple<G, V, map<Key, V> >(g, root, key2vertex);
|
||||
return boost::tuple<SDGraph<Key>, V, std::map<Key, V> >(g, root, key2vertex);
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
|||
12
cpp/graph.h
12
cpp/graph.h
|
|
@ -26,6 +26,14 @@ namespace gtsam {
|
|||
boost::edge_weight_t, double> > {
|
||||
};
|
||||
|
||||
template<class Key>
|
||||
class SGraph : public boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS,
|
||||
boost::property<boost::vertex_name_t, std::string> > {
|
||||
typedef typename boost::graph_traits<SDGraph<Key> >::vertex_descriptor Vertex;
|
||||
};
|
||||
|
||||
//typedef boost::graph_traits<SGraph>::vertex_descriptor SVertex;
|
||||
|
||||
/**
|
||||
* Map from variable key to parent key
|
||||
*/
|
||||
|
|
@ -45,8 +53,8 @@ namespace gtsam {
|
|||
* G = Graph type
|
||||
* V = Vertex type
|
||||
*/
|
||||
template<class G, class V, class Key>
|
||||
boost::tuple<G, V, std::map<Key, V> >
|
||||
template<class Key>
|
||||
boost::tuple<SDGraph<Key>, typename SDGraph<Key>::Vertex, std::map<Key, typename SDGraph<Key>::Vertex> >
|
||||
predecessorMap2Graph(const PredecessorMap<Key>& p_map);
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue