Skip to content

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

@neoblizz

Description

@neoblizz

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiAPI related issuesbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions