@@ -49,43 +49,39 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
4949#include " cpp_common/messages.hpp"
5050
5151namespace pgrouting {
52- namespace functions {
5352
5453template <class G >
55- class sloanOrdering : public Pgr_messages {
56- public:
57- typedef typename G::V V;
58- typedef typename G::E E;
59-
60- std::vector<int64_t >
54+ std::vector<int64_t >
6155 sloanOrdering (G &graph) {
62- using namespace boost ;
63- typedef adjacency_list< vecS, vecS, undirectedS, property< vertex_color_t , default_color_type, property< vertex_degree_t , int , property< vertex_priority_t , int > > > > Graph;
64- typedef graph_traits< Graph >::vertex_descriptor Vertex;
56+ typedef boost::adjacency_list<
57+ boost::vecS,
58+ boost::vecS,
59+ boost::undirectedS,
60+ boost::property<boost::vertex_color_t , boost::default_color_type,
61+ boost::property<boost::vertex_degree_t , int ,
62+ boost::property<boost::vertex_priority_t , int >>>> GraphType;
63+ typedef typename boost::graph_traits<typename G::graph_t >::vertex_descriptor Vertex;
6564 std::vector<int64_t >results;
6665
6766 auto i_map = boost::get (boost::vertex_index, graph.graph );
68-
69- auto color_map = get (boost::vertex_color, graph.graph );
70-
71- auto degree_map = make_degree_map (graph.graph );
72-
73- auto priority_map = get (boost::vertex_priority, graph.graph );
67+ auto color_map = boost::get (boost::vertex_color, graph.graph );
68+ auto degree_map = boost::make_degree_map (graph.graph );
69+ auto priority_map = boost::get (boost::vertex_priority, graph.graph );
7470
75- std::vector<Vertex> inv_perm (num_vertices (graph.graph ));
71+ std::vector<Vertex> inv_perm (boost:: num_vertices (graph.graph ));
7672
7773 CHECK_FOR_INTERRUPTS ();
7874
79- boost::sloan_ordering (graph.graph , inv_perm.rbegin (), color_map, degree_map, priority_map);
80- for (std::vector<Vertex>::const_iterator i = inv_perm.begin (); i != inv_perm.end (); ++i) {
75+ boost::sloan_ordering (graph.graph , inv_perm.rbegin (), color_map, degree_map, priority_map, i_map);
76+
77+ for (typename std::vector<Vertex>::const_iterator i = inv_perm.begin (); i != inv_perm.end (); ++i) {
8178 auto seq = graph[*i].id ;
8279 results.push_back (static_cast <int64_t >(graph[*i].id ));
8380 seq++;}
8481
8582 return results;
8683 }
87- };
88- } // namespace functions
84+
8985} // namespace pgrouting
9086
9187#endif // INCLUDE_ORDERING_SLOANORDERING_HPP_
0 commit comments