MCPcopy Create free account
hub / github.com/ShahjalalShohag/code-library / buildBetween

Method buildBetween

Data Structures/SQRT Tree.cpp:43–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 inline void buildBetween(int layer, int lBound, int rBound, int betweenOffs) {
44 int bSzLog = (layers[layer] + 1) >> 1;
45 int bCntLog = layers[layer] >> 1;
46 int bSz = 1 << bSzLog;
47 int bCnt = (rBound - lBound + bSz - 1) >> bSzLog;
48 for (int i = 0; i < bCnt; i++) {
49 SqrtTreeItem ans;
50 for (int j = i; j < bCnt; j++) {
51 SqrtTreeItem add = suf[layer][lBound + (j << bSzLog)];
52 ans = (i == j) ? add : op(ans, add);
53 between[layer - 1][betweenOffs + lBound + (i << bCntLog) + j] = ans;
54 }
55 }
56 }
57
58 inline void buildBetweenZero() {
59 int bSzLog = (llg + 1) >> 1;

Callers

nothing calls this directly

Calls 1

opFunction · 0.70

Tested by

no test coverage detected