Skip to content

Commit 0130928

Browse files
committed
Refactor: apply clang-format to code
1 parent e527672 commit 0130928

File tree

1 file changed

+45
-46
lines changed

1 file changed

+45
-46
lines changed

experimental/algorithm/LAGraph_CFL_reachability_advanced.c

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -59,56 +59,55 @@
5959
rule.count++; \
6060
}
6161

62-
// clang-format off
6362
#if BENCH_CFL_REACHBILITY
64-
#define IS_ISO(matrix, str) \
65-
{ \
66-
bool iso_flag; \
67-
GrB_Index nnz; \
68-
GxB_Matrix_iso(&iso_flag, matrix); \
69-
GrB_Matrix_nvals(&nnz, matrix); \
70-
if (!iso_flag && nnz) { \
71-
printf("-----ISO ALERT----- (%s)\n", str); \
72-
GxB_print(matrix, 1); \
73-
printf("-------------------\n"); \
74-
} \
75-
}
63+
#define IS_ISO(matrix, str) \
64+
{ \
65+
bool iso_flag; \
66+
GrB_Index nnz; \
67+
GxB_Matrix_iso(&iso_flag, matrix); \
68+
GrB_Matrix_nvals(&nnz, matrix); \
69+
if (!iso_flag && nnz) { \
70+
printf("-----ISO ALERT----- (%s)\n", str); \
71+
GxB_print(matrix, 1); \
72+
printf("-------------------\n"); \
73+
} \
74+
}
7675

77-
#define TIMER_START() \
78-
{ \
79-
start_time = LAGraph_WallClockTime(); \
80-
}
76+
#define TIMER_START() \
77+
{ \
78+
start_time = LAGraph_WallClockTime(); \
79+
}
8180

82-
#define TIMER_STOP(label, accumulator) \
83-
{ \
84-
end_time = LAGraph_WallClockTime(); \
85-
printf("%s %.3fs\n", label, end_time - start_time); \
86-
if (accumulator != NULL) { \
87-
*(accumulator) += (end_time - start_time); \
88-
} \
89-
}
81+
#define TIMER_STOP(label, accumulator) \
82+
{ \
83+
end_time = LAGraph_WallClockTime(); \
84+
printf("%s %.3fs\n", label, end_time - start_time); \
85+
if (accumulator != NULL) { \
86+
*(accumulator) += (end_time - start_time); \
87+
} \
88+
}
9089

91-
#define IS_ROW(matrix, str) \
92-
{ \
93-
int32_t orientation; \
94-
GrB_get(matrix, &orientation, GrB_STORAGE_ORIENTATION_HINT); \
95-
if (orientation != GrB_ROWMAJOR) { \
96-
printf("-----NOT A ROW----- (%s)\n", str); \
97-
GxB_print(matrix, 1); \
98-
printf("-------------------\n"); \
99-
} \
100-
}
90+
#define IS_ROW(matrix, str) \
91+
{ \
92+
int32_t orientation; \
93+
GrB_get(matrix, &orientation, GrB_STORAGE_ORIENTATION_HINT); \
94+
if (orientation != GrB_ROWMAJOR) { \
95+
printf("-----NOT A ROW----- (%s)\n", str); \
96+
GxB_print(matrix, 1); \
97+
printf("-------------------\n"); \
98+
} \
99+
}
101100

102-
#define IS_COL(matrix, str) \
103-
{ \
104-
int32_t orientation; \
105-
GrB_get(matrix, &orientation, GrB_STORAGE_ORIENTATION_HINT); \
106-
if (orientation != GrB_COLMAJOR) { \
107-
printf("-----NOT A COL----- (%s)\n", str); \
108-
GxB_print(matrix, 1); \
109-
printf("-------------------\n"); \
110-
} \
111-
}
101+
#define IS_COL(matrix, str) \
102+
{ \
103+
int32_t orientation; \
104+
GrB_get(matrix, &orientation, GrB_STORAGE_ORIENTATION_HINT); \
105+
if (orientation != GrB_COLMAJOR) { \
106+
printf("-----NOT A COL----- (%s)\n", str); \
107+
GxB_print(matrix, 1); \
108+
printf("-------------------\n"); \
109+
} \
110+
}
112111
#else
113112
#define IS_ISO(matrix, str)
114113
#define TIMER_START()
@@ -245,7 +244,6 @@ GrB_Info LAGraph_CFL_reachability_adv(
245244

246245
// Create nonterms matrices
247246
for (size_t i = 0; i < symbols_amount; i++) {
248-
GrB_Matrix matrix;
249247

250248
GrB_Index nrows;
251249
GrB_Matrix_nrows(&nrows, adj_matrices[i]);
@@ -256,6 +254,7 @@ GrB_Info LAGraph_CFL_reachability_adv(
256254
GrB_Matrix_dup(&new_adj_matrix, adj_matrices[i]);
257255
delta_matrices[i] = CFL_matrix_from_base(new_adj_matrix);
258256

257+
GrB_Matrix matrix;
259258
GRB_TRY(GrB_Matrix_new(&matrix, GrB_BOOL, nrows, ncols));
260259
matrices[i] = ((optimizations & OPT_LAZY) || (optimizations & OPT_BLOCK))
261260
? CFL_matrix_from_base_lazy(matrix)

0 commit comments

Comments
 (0)