Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/nwgraph/adjacency.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class index_adjacency : public unipartite_graph_base, public indexed_struct_of_a
* @brief Constructor of index_adjacency. Require the type of the graph to be unipartite.
* Create an empty index_adjacency.
*/
index_adjacency(std::array<size_t, 1> N, size_t M = 0) requires(std::is_same<unipartite_graph_base, unipartite_graph_base>::value) : unipartite_graph_base(N), base(N[0], M) {}
index_adjacency(std::array<size_t, 1> N, size_t M = 0) requires(std::is_same<unipartite_graph_base, unipartite_graph_base>::value) : unipartite_graph_base(N[0]), base(N[0], M) {}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lums658 , should unipartite_graph_base be accepting N[0] here instead of an array? I don't see a constructor that accepts a range, only an integer.


template <class ExecutionPolicy = std::execution::parallel_unsequenced_policy>
index_adjacency(index_edge_list<vertex_id_type, unipartite_graph_base, directedness::directed, Attributes...>& A,
Expand Down
2 changes: 1 addition & 1 deletion include/nwgraph/edge_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class index_edge_list : public graph_base_t, public struct_of_arrays<vertex_id,
using vertex_id_type = vertex_id;
using base = struct_of_arrays<vertex_id_type, vertex_id_type, Attributes...>;
using element = std::tuple<vertex_id_type, vertex_id_type, Attributes...>;
using reference = base::reference;
using reference = typename base::reference;


static const directedness edge_directedness = direct;
Expand Down
7 changes: 4 additions & 3 deletions include/nwgraph/graph_concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,10 @@ DECL_TAG_INVOKE(target);
*
*/
template <typename G>
concept graph = std::copyable<G> && requires(G g) {
typename vertex_id_t<G>;
{ num_vertices(g) } -> std::convertible_to<std::ranges::range_difference_t<G>>;
concept graph = std::copyable<std::remove_cvref_t<G>>
&& has_vertex_id<G>
&& requires(G g) {
{ num_vertices(g) } -> std::convertible_to<std::ranges::range_difference_t<G>>;
};

template <typename G>
Expand Down
7 changes: 6 additions & 1 deletion include/nwgraph/graph_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ struct graph_traits {
};

template <typename G>
using vertex_id_t = typename graph_traits<G>::vertex_id_type;
using vertex_id_t = typename graph_traits<std::remove_cvref_t<G>>::vertex_id_type;

template <typename G>
concept has_vertex_id = requires {
typename graph_traits<std::remove_cvref_t<G>>;
};

// template <typename G>
// using vertex_size_t = typename graph_traits<G>::vertex_size_type;
Expand Down