Skip to content

Commit 83aa68c

Browse files
committed
Fix: wise_block
1 parent 7a73ba0 commit 83aa68c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

experimental/algorithm/LAGraph_CFL_reachability_advanced.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ void block_matrix_hyper_rotate_i(Matrix *matrix, enum Matrix_block format) {
312312
GrB_Scalar_new(&scalar_true, GrB_BOOL);
313313
GrB_Scalar_setElement_BOOL(scalar_true, true);
314314

315-
if (matrix->format == VEC_VERT) {
315+
if (matrix->block_type == VEC_VERT) {
316316
GrB_Index *nrows = malloc(matrix->nvals * sizeof(GrB_Index));
317317
GrB_Index *ncols = malloc(matrix->nvals * sizeof(GrB_Index));
318318

@@ -330,7 +330,7 @@ void block_matrix_hyper_rotate_i(Matrix *matrix, enum Matrix_block format) {
330330
return;
331331
}
332332

333-
if (matrix->format == VEC_HORIZ) {
333+
if (matrix->block_type == VEC_HORIZ) {
334334
GrB_Index *nrows = malloc(matrix->nvals * sizeof(GrB_Index));
335335
GrB_Index *ncols = malloc(matrix->nvals * sizeof(GrB_Index));
336336

@@ -396,13 +396,13 @@ void block_matrix_reduce(Matrix *matrix, Matrix *input) {
396396
GrB_Index *cols = malloc(input->nvals * sizeof(GrB_Index));
397397
GrB_Matrix_extractTuples_BOOL(rows, cols, NULL, &input->nvals, input->base);
398398

399-
if (input->format == VEC_VERT) {
399+
if (input->block_type == VEC_VERT) {
400400
for (size_t i = 0; i < input->nvals; i++) {
401401
rows[i] = rows[i] % input->ncols;
402402
}
403403
}
404404

405-
if (input->format == VEC_HORIZ) {
405+
if (input->block_type == VEC_HORIZ) {
406406
for (size_t i = 0; i < input->nvals; i++) {
407407
cols[i] = cols[i] % input->nrows;
408408
}
@@ -779,7 +779,7 @@ GrB_Info matrix_wise_block(Matrix *output, Matrix *first, Matrix *second, bool a
779779
}
780780

781781
if (first->block_type == CELL && second->block_type == CELL) {
782-
matrix_wise_lazy(output, first, second, accum);
782+
return matrix_wise_lazy(output, first, second, accum);
783783
}
784784

785785
// second is vector
@@ -794,18 +794,20 @@ GrB_Info matrix_wise_block(Matrix *output, Matrix *first, Matrix *second, bool a
794794

795795
// first is vector
796796
if (second->block_type == CELL) {
797+
// LG_SET_BURBLE(true);
797798
Matrix temp_vector = matrix_create(first->nrows, first->ncols);
798799
GrB_Index block_count = first->nrows > first->ncols ? first->nrows : first->ncols;
799800
block_matrix_repeat_into_vector(&temp_vector, second, block_count);
800801

802+
block_matrix_hyper_rotate_i(&temp_vector, first->block_type);
801803
GrB_Info info = matrix_wise_lazy(output, first, &temp_vector, accum);
802804
matrix_free(&temp_vector);
803805
return info;
804806
}
805807

806808
// both are vector
807809
block_matrix_hyper_rotate_i(second, first->block_type);
808-
return matrix_wise_block(output, first, second, accum);
810+
return matrix_wise_lazy(output, first, second, accum);
809811
}
810812

811813
GrB_Info matrix_rsub(Matrix *output, Matrix *mask) {

0 commit comments

Comments
 (0)