相关疑难解决方法(0)

D语言中的并行迭代器

我试图在D语言中实现图形数据结构,它支持节点和边集的并行迭代.

alias ulong index;
alias index node;
alias ulong count;

class Graph {
    index z;    // max node index
    count n;    // number of nodes
    count m;    // number of edges
    node[][] adja;  // adjacency list
    count[] deg;    // node degree

    this(count n = 0) {
        this.z = n;
        this.n = n;
        this.m = 0;
        this.adja = new node[][](this.z, 0);
        this.deg = new count[](this.z);
    }
Run Code Online (Sandbox Code Playgroud)

这是一个顺序节点迭代器方法:

/**
 * Iterate over all nodes of the graph and call handler (lambda closure). …
Run Code Online (Sandbox Code Playgroud)

parallel-processing iterator d graph

2
推荐指数
1
解决办法
365
查看次数

标签 统计

d ×1

graph ×1

iterator ×1

parallel-processing ×1