From 81e9b5e14f95a03ea536b71a7c86034bd6389c4c Mon Sep 17 00:00:00 2001 From: Phil Ratzloff Date: Thu, 7 Dec 2023 14:23:03 -0500 Subject: [PATCH] Updates to reflect P1709 changes null_range --> null_predecessors in dijkstra_clrs Add neighbor_descriptor for consistency Tweak index_adjacency_list --- include/graph/algorithm/dijkstra_clrs.hpp | 2 +- include/graph/graph.hpp | 18 +++++++++++++----- include/graph/graph_descriptors.hpp | 9 +++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/include/graph/algorithm/dijkstra_clrs.hpp b/include/graph/algorithm/dijkstra_clrs.hpp index ccb94d3..e50039d 100644 --- a/include/graph/algorithm/dijkstra_clrs.hpp +++ b/include/graph/algorithm/dijkstra_clrs.hpp @@ -50,7 +50,7 @@ class null_range_type : public std::vector { null_range_type(std::initializer_list init, const Allocator& alloc = Allocator()) {} }; -inline static null_range_type null_range; +inline static null_range_type null_predecessors; template diff --git a/include/graph/graph.hpp b/include/graph/graph.hpp index 3393326..5e63849 100644 --- a/include/graph/graph.hpp +++ b/include/graph/graph.hpp @@ -104,13 +104,16 @@ inline constexpr bool is_undirected_edge_v = false; * @tparam G The graph type. */ template -concept vertex_range = ranges::forward_range> && ranges::sized_range> && // - requires(G&& g, vertex_iterator_t ui) { vertex_id(g, ui); }; +concept _common_vertex_range = ranges::sized_range> && // + requires(G&& g, vertex_iterator_t ui) { vertex_id(g, ui); }; template -concept index_vertex_range = ranges::random_access_range> && ranges::sized_range> && - integral> && // - requires(G&& g, vertex_iterator_t ui) { vertex_id(g, ui); }; +concept vertex_range = _common_vertex_range && ranges::forward_range>; + +template +concept index_vertex_range = _common_vertex_range && // + ranges::random_access_range> && integral>; + /** * @ingroup graph_concepts @@ -202,6 +205,11 @@ concept index_adjacency_list = basic_index_adjacency_list && requires(G&& g, { edges(g, u) } -> ranges::forward_range; }; +//template +//concept index_adjacency_list = adjacency_list && // +// ranges::random_access_range> && integral>; + + // !is_same_v, vertex_edge_range_t> // CSR fails this condition b/c row_index & col_index are both index_vectors; common? diff --git a/include/graph/graph_descriptors.hpp b/include/graph/graph_descriptors.hpp index 761d8cd..9c6cd20 100644 --- a/include/graph/graph_descriptors.hpp +++ b/include/graph/graph_descriptors.hpp @@ -268,6 +268,12 @@ struct neighbor_descriptor { target_id_type target_id; }; +// +// copyable_edge_t +// +template +using copyable_neighbor_t = neighbor_descriptor; // {source_id, target_id [, value]} + // // view concepts // @@ -277,6 +283,9 @@ concept copyable_vertex = convertible_to>; template concept copyable_edge = convertible_to>; +template +concept copyable_neighbor = convertible_to>; + // // is_sourced //