MCPcopy Create free account
hub / github.com/PKU-ASAL/Simulated-Data / GetSubset

Method GetSubset

src/Sysdig/real-time/ProvGraph.py:590–606  ·  view source on GitHub ↗
(self,mmap,x,y)

Source from the content-addressed store, hash-verified

588 return connected_graph
589
590 def GetSubset(self,mmap,x,y):
591 mmap[x][y] = 0
592 row = mmap[x]
593 col = mmap[:,y]
594 result = []
595 if np.all(row==0) and np.all(col==0):
596 return result
597 for i,v in enumerate(row):
598 if v == 1 :
599 result.append(i + mmap.shape[0])
600 result += self.GetSubset(mmap,x,i)
601 for i,v in enumerate(col):
602 if v == 1:
603 result.append(i)
604 result += self.GetSubset(mmap,i,y)
605
606 return result
607
608 def MergeGraph(self,graph_cache,graph_list):
609 connection_map = np.zeros((len(graph_cache), len(graph_list)), dtype=int)

Callers 1

MergeGraphMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected