Skip to content

Commit

Permalink
namespace fidling
Browse files Browse the repository at this point in the history
  • Loading branch information
gblelloch committed Feb 25, 2024
1 parent ca07799 commit 0661148
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/helper/graph_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <parlay/sequence.h>
#include <parlay/io.h>

namespace delayed = parlay::delayed;
namespace delay = parlay::delayed;

template <typename vertex>
struct graph_utils {
Expand All @@ -30,10 +30,10 @@ struct graph_utils {
// transpose a directed graph
// i.e. generate the backward edges for every forward edges
static graph transpose(const graph& G) {
auto pairs = delayed::flatten(parlay::tabulate(G.size(), [&] (vertex i) {
return delayed::map(G[i], [=] (auto ngh) {
auto pairs = parlay::delayed::flatten(parlay::tabulate(G.size(), [&] (vertex i) {
return parlay::delayed::map(G[i], [=] (auto ngh) {
return std::pair(ngh, i);});}));
return group_by_index(delayed::to_sequence(pairs), G.size());
return group_by_index(parlay::delayed::to_sequence(pairs), G.size());
}

// symmetrize and remove self edges from a graph
Expand All @@ -55,8 +55,9 @@ struct graph_utils {
}

static edges to_edges(const graph& G) {
return delayed::to_sequence(delayed::flatten(parlay::tabulate(G.size(), [&] (vertex u) {
return delayed::map(G[u], [=] (vertex v) {return std::pair(u,v);});})));
return parlay::delayed::to_sequence(
parlay::delayed::flatten(parlay::tabulate(G.size(), [&] (vertex u) {
return parlay::delayed::map(G[u], [=] (vertex v) {return std::pair(u,v);});})));
}

// adds random weights so (u,v) and (v,u) have same weight
Expand Down

0 comments on commit 0661148

Please sign in to comment.