MCPcopy Create free account
hub / github.com/alibaba/euler / SampleNeighbor

Function SampleNeighbor

euler/core/api/api.cc:223–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223IdWeightPairVec SampleNeighbor(const NodeIdVec& node_ids,
224 const std::vector<int>& edge_types, int count) {
225 IdWeightPairVec neighbor(node_ids.size());
226 #ifdef OPENMP
227 #pragma omp parallel for
228 #endif
229 for (int32_t i = 0 ; i < static_cast<int32_t>(node_ids.size()); ++i) {
230 auto node = EulerGraph()->GetNodeByID(node_ids[i]);
231 if (node != nullptr) {
232 neighbor[i] = node->SampleNeighbor(edge_types, count);
233 }
234 }
235 return neighbor;
236}
237
238bool GetNodeType(const std::vector<std::string*> node_types,
239 std::vector<int>* type_ids) {

Callers 2

ComputeMethod · 0.50
ComputeMethod · 0.50

Calls 4

GetNodeByIDMethod · 0.80
EulerGraphFunction · 0.70
sizeMethod · 0.45
SampleNeighborMethod · 0.45

Tested by

no test coverage detected