Skip to content

Commit e31704c

Browse files
committed
feat: provide more detailed information about errors
1 parent d168c56 commit e31704c

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/main.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
#include "../vendor/LAGraph/include/LAGraph.h"
55
#include "../vendor/LAGraph/include/LAGraphX.h"
66

7-
#define TRY(method) \
8-
{ \
9-
GrB_Info _info = (method); \
10-
if (_info != GrB_SUCCESS) \
11-
{ \
12-
fprintf(stderr, \
13-
#method " : GraphBLAS error %d \n", \
14-
_info); \
15-
return _info; \
16-
} \
7+
#define TRY(method) \
8+
{ \
9+
GrB_Info _info = (method); \
10+
if (_info != GrB_SUCCESS) \
11+
{ \
12+
fprintf(stderr, \
13+
#method " : GraphBLAS error %d in file %s at line %d\n", \
14+
_info,__FILE__, __LINE__); \
15+
return _info; \
16+
} \
1717
}
1818

1919
#define VERTICES_NUMBER 12
@@ -83,7 +83,7 @@ void owns_bool_add(bool *z, const bool *x, const bool *y)
8383

8484
void tx_bool_mult(EdgeTX *z, const bool *x, const EdgeTX *y)
8585
{
86-
if (*x)
86+
if (*x) // вот этот иф не нужен в идеале, потому что мы проходимся только по значащим значениям
8787
*z = *y;
8888
else
8989
z->sum = 0, z->count = 0;
@@ -303,7 +303,7 @@ int main()
303303
// ------------------------------------------------------------------------
304304
// build filter for tx matrix
305305
// ------------------------------------------------------------------------
306-
306+
307307
// get cards with MIR payment system only
308308
TRY(GrB_Matrix_free(&ID));
309309
TRY(GrB_Vector_free(&v));

0 commit comments

Comments
 (0)