Skip to content

Commit b485b4f

Browse files
suvorovraingsvgit
authored andcommitted
refactor: provide more comments
1 parent 6e42d88 commit b485b4f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ GrB_Info analyze_graph(GrB_Matrix tx_edge_mat, GrB_Matrix owns_edge_mat, GrB_Vec
260260
// build user filters
261261
// ------------------------------------------------------------------------
262262

263-
// vertex filter: we will take only prersons over 30
263+
// take persons over 30
264264
GrB_IndexUnaryOp user_age;
265265
TRY(GrB_IndexUnaryOp_new(&user_age, (GxB_index_unary_function)&check_user_age, GrB_BOOL, user, GrB_UINT8));
266266

@@ -314,6 +314,9 @@ GrB_Info analyze_graph(GrB_Matrix tx_edge_mat, GrB_Matrix owns_edge_mat, GrB_Vec
314314
// apply cards filter to tx matrix
315315
// ------------------------------------------------------------------------
316316

317+
// receive transactions between cards of the "MIR" payment system for users over 30 years old
318+
319+
// create semiring to process A x B where A has type Card and B has type EdgeTX
317320
GrB_BinaryOp tx_bool_add_op;
318321
TRY(GrB_BinaryOp_new(&tx_bool_add_op, (GxB_binary_function)&tx_bool_add, tx_edge, tx_edge, tx_edge));
319322

@@ -329,15 +332,20 @@ GrB_Info analyze_graph(GrB_Matrix tx_edge_mat, GrB_Matrix owns_edge_mat, GrB_Vec
329332

330333
GrB_Matrix tx_mat_filtered;
331334
TRY(GrB_Matrix_new(&tx_mat_filtered, tx_edge, VERTICES_NUMBER, VERTICES_NUMBER));
335+
336+
// filter rows of source transactions matrix
332337
TRY(GrB_mxm(tx_mat_filtered, NULL, NULL, tx_bool_semiring, ID, tx_edge_mat, NULL));
333338

339+
// create semiring to process A x B where A has type EdgeTX and B has type Card
334340
GrB_Matrix tx_mat_filtered2;
335341
GrB_BinaryOp tx_bool_mul_right_op;
336342
TRY(GrB_BinaryOp_new(&tx_bool_mul_right_op, (GxB_binary_function)&tx_bool_mult_right, tx_edge, tx_edge, card));
337343

338344
GrB_Semiring tx_bool_semiring_right;
339345
TRY(GrB_Semiring_new(&tx_bool_semiring_right, tx_bool_monoid, tx_bool_mul_right_op));
346+
340347
TRY(GrB_Matrix_new(&tx_mat_filtered2, tx_edge, VERTICES_NUMBER, VERTICES_NUMBER));
348+
// filter columns of source transactions matrix
341349
TRY(GrB_mxm(tx_mat_filtered2, NULL, NULL, tx_bool_semiring_right, tx_mat_filtered, ID, NULL));
342350

343351
GxB_print(tx_mat_filtered2, GxB_COMPLETE);

0 commit comments

Comments
 (0)