MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / edgeCompute

Method edgeCompute

src/function/gds/wsp_paths.cpp:25–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23 }
24
25 std::vector<nodeID_t> edgeCompute(nodeID_t boundNodeID, graph::NbrScanState::Chunk& chunk,
26 bool fwdEdge) override {
27 std::vector<nodeID_t> result;
28 chunk.forEach([&](auto neighbors, auto propertyVectors, auto i) {
29 auto nbrNodeID = neighbors[i];
30 auto edgeID = propertyVectors[0]->template getValue<relID_t>(i);
31 auto weight = propertyVectors[1]->template getValue<T>(i);
32 WeightUtils::checkWeight(WeightedSPPathsFunction::name, weight);
33 if (!block->hasSpace()) {
34 block = bfsGraphManager->getCurrentGraph()->addNewBlock();
35 }
36 if (bfsGraphManager->getCurrentGraph()->tryAddSingleParentWithWeight(boundNodeID,
37 edgeID, nbrNodeID, fwdEdge, static_cast<double>(weight), block)) {
38 result.push_back(nbrNodeID);
39 }
40 });
41 return result;
42 }
43
44 std::unique_ptr<EdgeCompute> copy() override {
45 return std::make_unique<WSPPathsEdgeCompute<T>>(bfsGraphManager);

Callers

nothing calls this directly

Calls 6

hasSpaceMethod · 0.80
addNewBlockMethod · 0.80
getCurrentGraphMethod · 0.80
forEachMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected