@@ -27,27 +27,30 @@ limitations under the License.
2727
2828namespace osp {
2929
30+ template <typename v_impl>
3031struct directed_edge_descriptor_impl {
3132
32- std:: size_t idx ;
33+ using vertex_idx = typename v_impl::vertex_idx_type ;
3334
34- std::size_t source;
35- std::size_t target;
35+ vertex_idx idx;
36+
37+ vertex_idx source;
38+ vertex_idx target;
3639
3740 directed_edge_descriptor_impl () : idx(0 ), source(0 ), target(0 ) {}
38- directed_edge_descriptor_impl (const directed_edge_descriptor_impl &other) = default ;
39- directed_edge_descriptor_impl (directed_edge_descriptor_impl &&other) = default ;
40- directed_edge_descriptor_impl &operator =(const directed_edge_descriptor_impl &other) = default ;
41- directed_edge_descriptor_impl &operator =(directed_edge_descriptor_impl &&other) = default ;
42- directed_edge_descriptor_impl (std:: size_t source_arg, std:: size_t target_arg, std:: size_t idx_arg)
41+ directed_edge_descriptor_impl (const directed_edge_descriptor_impl<v_impl> &other) = default ;
42+ directed_edge_descriptor_impl (directed_edge_descriptor_impl<v_impl> &&other) = default ;
43+ directed_edge_descriptor_impl &operator =(const directed_edge_descriptor_impl<v_impl> &other) = default ;
44+ directed_edge_descriptor_impl &operator =(directed_edge_descriptor_impl<v_impl> &&other) = default ;
45+ directed_edge_descriptor_impl (vertex_idx source_arg, vertex_idx target_arg, vertex_idx idx_arg)
4346 : idx(idx_arg), source(source_arg), target(target_arg) {}
4447 ~directed_edge_descriptor_impl () = default ;
4548
46- bool operator ==(const directed_edge_descriptor_impl &other) const {
49+ bool operator ==(const directed_edge_descriptor_impl<v_impl> &other) const {
4750 return idx == other.idx && source == other.source && target == other.target ;
4851 }
4952
50- bool operator !=(const directed_edge_descriptor_impl &other) const { return !(*this == other); }
53+ bool operator !=(const directed_edge_descriptor_impl<v_impl> &other) const { return !(*this == other); }
5154};
5255
5356template <typename edge_comm_weight_t >
@@ -66,11 +69,11 @@ template<typename v_impl, typename e_impl>
6669class computational_dag_edge_idx_vector_impl {
6770 public:
6871 // graph_traits specialization
69- using vertex_idx = std:: size_t ;
70- using directed_edge_descriptor = directed_edge_descriptor_impl;
72+ using vertex_idx = typename v_impl::vertex_idx_type ;
73+ using directed_edge_descriptor = directed_edge_descriptor_impl<v_impl> ;
7174
72- using out_edges_iterator_t = std::vector<directed_edge_descriptor>::const_iterator;
73- using in_edges_iterator_t = std::vector<directed_edge_descriptor>::const_iterator;
75+ using out_edges_iterator_t = typename std::vector<directed_edge_descriptor>::const_iterator;
76+ using in_edges_iterator_t = typename std::vector<directed_edge_descriptor>::const_iterator;
7477
7578 // cdag_traits specialization
7679 using vertex_work_weight_type = typename v_impl::work_weight_type;
@@ -287,10 +290,12 @@ static_assert(
287290
288291} // namespace osp
289292
290- template <>
291- struct std ::hash<osp::directed_edge_descriptor_impl> {
292- std::size_t operator ()(const osp::directed_edge_descriptor_impl &p) const noexcept {
293- auto h1 = std::hash<std::size_t >{}(p.source );
293+ template <typename v_impl>
294+ struct std ::hash<osp::directed_edge_descriptor_impl<v_impl>> {
295+ using vertex_idx = typename v_impl::vertex_idx_type;
296+
297+ std::size_t operator ()(const osp::directed_edge_descriptor_impl<v_impl> &p) const noexcept {
298+ auto h1 = std::hash<vertex_idx>{}(p.source );
294299 osp::hash_combine (h1, p.target );
295300
296301 return h1;
0 commit comments