diff --git a/examples/bsp2mtx.c b/examples/bsp2mtx.c index 44116b2..6e3f483 100644 --- a/examples/bsp2mtx.c +++ b/examples/bsp2mtx.c @@ -21,6 +21,9 @@ int main(int argc, char** argv) { printf(" === Reading file... ===\n"); bsp_matrix_t matrix = bsp_read_matrix(input_fname, NULL); printf(" === Done writing. ===\n"); + if (matrix.format != BSP_COO) { + matrix = bsp_convert_matrix(matrix, BSP_COO); + } printf(" === Writing to %s... ===\n", output_fname); bsp_mmwrite(output_fname, matrix);