29 #ifndef DEF_GRAPHCHI_EDGEBUFFERS
30 #define DEF_GRAPHCHI_EDGEBUFFERS
42 template <
typename EdgeDataType>
47 bool accounted_for_outc;
48 bool accounted_for_inc;
49 created_edge(vid_t src, vid_t dst, EdgeDataType _data) : src(src), dst(dst), data(_data), accounted_for_outc(
false),
50 accounted_for_inc(
false) {}
53 #define EDGE_BUFFER_CHUNKSIZE 65536
59 template <
typename ET>
63 std::vector<created_edge<ET> *> bufs;
75 for(
int i=0; i< (int)bufs.size(); i++) {
87 return &bufs[i / EDGE_BUFFER_CHUNKSIZE][i % EDGE_BUFFER_CHUNKSIZE];
90 void add(vid_t src, vid_t dst, ET data) {
96 int bufidx = idx / EDGE_BUFFER_CHUNKSIZE;
97 if (bufidx == (
int) bufs.size()) {
100 bufs[bufidx][idx % EDGE_BUFFER_CHUNKSIZE] = cedge;