Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

degree(g, u) no matching function. #46

Open
neoblizz opened this issue Dec 11, 2022 · 0 comments
Open

degree(g, u) no matching function. #46

neoblizz opened this issue Dec 11, 2022 · 0 comments
Labels
api API related issues bug Something isn't working

Comments

@neoblizz
Copy link
Member

Simple Example

for (auto&& [uid, u] : views::vertexlist(g)) {
      auto deg = degree(g, u);
}

or

for (auto&& u : vertices(g)) {
    auto deg = degree(g, u);
}

Error

error: no matching function for call to 'degree(std::graph::container::dynamic_graph<double, std::__cxx11::basic_string<char>, void, false, unsigned int, std::graph::container::vofl_graph_traits<double, std::__cxx11::basic_string<char> > >&, std::graph::container::dynamic_vertex<double, std::__cxx11::basic_string<char>, void, false, unsigned int, std::graph::container::vofl_graph_traits<double, std::__cxx11::basic_string<char> > >&)'
   72 |     auto deg = degree(g, u);

Specifically, in this piece of code:

for (auto&& [uid, u] : views::vertexlist(g)) {
// Calculate the degree of each vertex.
size_t edge_cnt = 0;
for (auto&& uv : edges(g, u)) {
++edge_cnt;
}
degrees[uid] = edge_cnt;
(this is the work around)

@neoblizz neoblizz added bug Something isn't working api API related issues labels Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api API related issues bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant