Skip to content

Commit

Permalink
fix when rows and cols are removed from laplacian
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethmorton committed Oct 17, 2023
1 parent 59e8cee commit 7e65806
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ranker/shared/ranker_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,23 @@ def graph_laplacian(self, rgraph, probes):
removal_candidate[probe[0]] = False
removal_candidate[probe[1]] = False

removed_before = np.cumsum(np.int64(removal_candidate))

new_probes = []
for probe in probes:
new_probes.append((
probe[0] - removed_before[probe[0]],
probe[1] - removed_before[probe[1]]
))

keep = np.logical_not(removal_candidate)

laplacian_pruned = laplacian[keep, :][:, keep]

details['laplacian_pruned'] = laplacian_pruned
details['probes'] = new_probes

return laplacian_pruned, probes, details
return laplacian_pruned, new_probes, details


def get_rgraph(self, result):
Expand Down

0 comments on commit 7e65806

Please sign in to comment.