Skip to content

Commit 42d5074

Browse files
authored
Update bsp2mtx to convert to COO if input is different format (#19)
1 parent 6c87e03 commit 42d5074

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/bsp2mtx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ int main(int argc, char** argv) {
2121
printf(" === Reading file... ===\n");
2222
bsp_matrix_t matrix = bsp_read_matrix(input_fname, NULL);
2323
printf(" === Done writing. ===\n");
24+
if (matrix.format != BSP_COO) {
25+
matrix = bsp_convert_matrix(matrix, BSP_COO);
26+
}
2427

2528
printf(" === Writing to %s... ===\n", output_fname);
2629
bsp_mmwrite(output_fname, matrix);

0 commit comments

Comments
 (0)