Bonsoir,
J'ai écris un programme de graphes en utilisant boost library. (voila le code complet:http://pastebin.com/BpjZPcEi)
Mais j'ai un problème avec ces fonctions:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
bool edgeexist(Graph const& g, int const& fromid, int const& toid, unsigned const& elabel) {
    int bn = 0;
 
        if (num_edges(g) != 0) {
            edge_pair ep;
            for (ep = edges(g); ep.first != ep.second; ++ep.first) // ep edge number
            {
                vertex_t from = source(*ep.first, g);
                vertex_t to = target(*ep.first, g);
                edge_t edg = edge(from, to, g);
 
                if ((g[from].id == fromid) && (g[to].id == toid) && (g[edg.first].label == elabel)) {
                    return true;
                }
 
        }
    }
 
    return false;
}
 
 
std::unordered_set<std::array<int, 3>>  edgesdiff(Graph const& g1,Graph const& g2){
 
    std::unordered_set<edge_iter> v1,v2,diff;
    std::array<int, 3> t;
    std::unordered_set<std::array<int, 3>> res;
 
 
    for(auto x:edges(g1)){
 
            vertex_t from = source(*x, g1);
            t[0]=g1[from].id;
 
            vertex_t to = target(*x, g1);
            t[1]=g1[to].id;
 
            edge_t edg = edge(from, to, g1);
            t[2]=g1[edg.first].label;
 
        if(!edgeexist(g2,t[0],t[1],t[2])){res.insert(t);}
 
 
    }
 
return res;
}
lorsque j’exécute le programme ça me donne:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
/usr/include/c++/4.9/bits/hashtable_policy.h|85|error: no match for call to ‘(const hashedge) (const boost::detail::undirected_edge_iter<std::_List_iterator<boost::list_edge<unsigned int, EdgeProperties> >, boost::detail::edge_desc_impl<boost::undirected_tag, unsigned int>, int>&)’|
Je n'arrive pas a comprendre l'erreur, aidez moi svp!