Skip to content

Commit bd09ca8

Browse files
committed
Simplfy results normalization
1 parent c1dbf81 commit bd09ca8

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

cfpq_add_context/add_contexts.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def to_label_decomposed_graph(graph, automata_size, initial_graph_size):
7676
entrypoints << graph.reduce_columnwise(op.lor)
7777
#mask_v(op.lor) << Vector.from_coo(list(set(range(0,graph.nrows)).difference(entrypoints.to_coo(values=False)[0])), values=True, dtype = BOOL)
7878

79-
mask_v(op.lor) << Vector.from_coo([i * automata_size for i in range(0, initial_graph_size)], values=True, dtype = BOOL, size= graph.ncols)
79+
mask_v("any") << Vector.from_coo([i * automata_size for i in range(0, initial_graph_size)], values=True, dtype = BOOL, size = graph.ncols)
8080

8181
load_i = Matrix(UINT64, graph.ncols, graph.nrows, name = "load_i_after_intersection")
8282
load_i << graph.select(graphblas.select.select_load).apply(graphblas.unary.decode_load)
@@ -201,11 +201,12 @@ def normalize(solver_result, initial_graph_nvertices):
201201

202202
normalization_start = time.perf_counter()
203203

204-
c = solver_result.ncols // initial_graph_nvertices
205-
start_vertices = set([i * c for i in range(0,initial_graph_nvertices)])
204+
atm_size = solver_result.ncols // initial_graph_nvertices
205+
# start_vertices = set([i * atm_size for i in range(0,initial_graph_nvertices)])
206206
edges = solver_result.to_edgelist()
207207
edges = zip(edges[0], edges[1])
208-
new_edges = set([(_edg[0] // c, _edg[1] // c) for (_edg, _lbl) in edges if _edg[0] in start_vertices])
208+
#new_edges = set([(_edg[0] // atm_size, _edg[1] // atm_size) for (_edg, _lbl) in edges if _edg[0] in start_vertices])
209+
new_edges = set([(_edg[0] // atm_size, _edg[1] // atm_size) for (_edg, _lbl) in edges])
209210
result = Matrix.from_edgelist(new_edges, values=True, dtype=BOOL, nrows = initial_graph_nvertices,
210211
ncols=initial_graph_nvertices, name = "normalized_solver_result")
211212
normalization_end = time.perf_counter()

0 commit comments

Comments
 (0)