ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
graphAlgs.DepthFirstOrder Class Reference
Collaboration diagram for graphAlgs.DepthFirstOrder:

Public Member Functions

def __init__ (self, G, roots=[])
 
def pre (self)
 
def post (self)
 
def reversePost (self)
 
def dfs_ (self, G, v)
 

Public Attributes

 marked
 
 pre_
 
 post_
 
 reversePost_
 

Detailed Description

Carry out a depth first traversal of a graph, noting the order
nodes are processed.

Definition at line 45 of file graphAlgs.py.

Constructor & Destructor Documentation

◆ __init__()

def graphAlgs.DepthFirstOrder.__init__ (   self,
  G,
  roots = [] 
)

Definition at line 49 of file graphAlgs.py.

49  def __init__(self, G, roots = []):
50  self.marked = [False for v in range(G.V)]
51  self.pre_ = []
52  self.post_ = []
53  self.reversePost_ = []
54 
55  if not roots:
56  for v in range(G.V):
57  if not self.marked[v]:
58  self.dfs_(G, v)
59  else:
60  for v in roots:
61  if not self.marked[v]:
62  self.dfs_(G, v)
63 
64  self.reversePost_ = self.post_[:]
65  self.reversePost_.reverse()
66 

Member Function Documentation

◆ dfs_()

def graphAlgs.DepthFirstOrder.dfs_ (   self,
  G,
  v 
)

Definition at line 71 of file graphAlgs.py.

71  def dfs_(self, G, v):
72  self.pre_.append(v)
73  self.marked[v] = True
74 
75  for w in G.adj(v):
76  if not self.marked[w]:
77  self.dfs_(G, w)
78 
79 
80  self.post_.append(v)
81 
82 

◆ post()

def graphAlgs.DepthFirstOrder.post (   self)

Definition at line 68 of file graphAlgs.py.

68  def post(self): return self.post_

◆ pre()

def graphAlgs.DepthFirstOrder.pre (   self)

Definition at line 67 of file graphAlgs.py.

67  def pre(self): return self.pre_

◆ reversePost()

def graphAlgs.DepthFirstOrder.reversePost (   self)

Definition at line 69 of file graphAlgs.py.

69  def reversePost(self): return self.reversePost_
70 

Member Data Documentation

◆ marked

graphAlgs.DepthFirstOrder.marked

Definition at line 50 of file graphAlgs.py.

◆ post_

graphAlgs.DepthFirstOrder.post_

Definition at line 52 of file graphAlgs.py.

◆ pre_

graphAlgs.DepthFirstOrder.pre_

Definition at line 51 of file graphAlgs.py.

◆ reversePost_

graphAlgs.DepthFirstOrder.reversePost_

Definition at line 53 of file graphAlgs.py.


The documentation for this class was generated from the following file:
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18