src/benchmark/bfs-bench.cc
changeset 1308 0274efa2222f
parent 921 818510fa3d99
equal deleted inserted replaced
4:fe294ea5a5cf 5:6c4726290571
    44   do {
    44   do {
    45     Node n(Q.front());
    45     Node n(Q.front());
    46     Node m;
    46     Node m;
    47     Q.pop();
    47     Q.pop();
    48     for(OutEdgeIt e(G,n);e!=INVALID;++e)
    48     for(OutEdgeIt e(G,n);e!=INVALID;++e)
    49       if(!visited[m=G.head(e)]) {
    49       if(!visited[m=G.target(e)]) {
    50 	Q.push(m);
    50 	Q.push(m);
    51 	visited.set(m,true);
    51 	visited.set(m,true);
    52       }
    52       }
    53   } while(!Q.empty());
    53   } while(!Q.empty());
    54 }
    54 }
    72   visited.set(source,true);
    72   visited.set(source,true);
    73   do {
    73   do {
    74     Node m;
    74     Node m;
    75     Node n=Q[Qt++];
    75     Node n=Q[Qt++];
    76     for(OutEdgeIt e(G,n);e!=INVALID;++e)
    76     for(OutEdgeIt e(G,n);e!=INVALID;++e)
    77       if(!visited[m=G.head(e)]) {
    77       if(!visited[m=G.target(e)]) {
    78 	Q[Qh++]=m;
    78 	Q[Qh++]=m;
    79 	visited.set(m,true);
    79 	visited.set(m,true);
    80       }
    80       }
    81   } while(Qt!=Qh);
    81   } while(Qt!=Qh);
    82 }
    82 }