982812930b16bd22b6b887c9b7bc4f7754458bc5,pygsp/graphs/gutils.py,,check_connectivity,#Any#,13
Before Change
if not hasattr(G, "directed"):
G.directed = is_directed(G)
// Removing the diagonal
A = G.W - np.diag(G.W.diagonal() )
if G.directed:
return _check_connectivity_directed(A, **kwargs)
After Change
if not hasattr(G, "directed"):
G.directed = is_directed(G)
for adj_matrix in [G.A, G.A.T] if G.directed else [G.A]:
visited = np.zeros(G.N, dtype=bool)
stack = [0]
while len(stack):
v = stack.pop()
if not visited[v]:
visited[v] = True
// Add indices of nodes not visited yet and accessible from v
stack.extend(filter(lambda idx: not visited[idx] and idx not in stack, adj_matrix[v, :].nonzero()[1]))
if not visited.all():
return False
return True
def check_weights(W):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: epfl-lts2/pygsp
Commit Name: 982812930b16bd22b6b887c9b7bc4f7754458bc5
Time: 2015-10-01
Author: lionel.martin@epfl.ch
File Name: pygsp/graphs/gutils.py
Class Name:
Method Name: check_connectivity
Project Name: geomstats/geomstats
Commit Name: fe5998ffdba2a6369a064b1edd036a451c1ff09d
Time: 2020-02-29
Author: nicolas.guigui@inria.fr
File Name: geomstats/geometry/connection.py
Class Name: Connection
Method Name: _pole_ladder_step
Project Name: geomstats/geomstats
Commit Name: acc1040a3cb4d60949c9b9873604906dcd8a4568
Time: 2020-02-25
Author: nicolas.guigui@inria.fr
File Name: geomstats/geometry/connection.py
Class Name: Connection
Method Name: _pole_ladder_step