return MATRIX_TYPE_UNKNOWN;
}
-SparseMatrix SparseMatrix_import_matrix_market(FILE * f, int format)
+SparseMatrix SparseMatrix_import_matrix_market(FILE * f)
{
int ret_code, type;
MM_typecode matcode;
I = MALLOC(nz * sizeof(int));
J = MALLOC(nz * sizeof(int));
-
-
- switch (format) {
- case FORMAT_CSC:
- assert(0); /* not supported yet */
- break;
- case FORMAT_CSR:
- case FORMAT_COORD:
-
/* NOTE: when reading in doubles, ANSI C requires the use of the "l" */
/* specifier as in "%lg", "%lf", "%le", otherwise errors will occur */
/* (ANSI C X3.159-1989, Sec. 4.9.6.2, p. 136 lines 13-15) */
return 0;
}
- if (format == FORMAT_CSR) {
- A = SparseMatrix_from_coordinate_arrays(nz, m, n, I, J, vp,
+ A = SparseMatrix_from_coordinate_arrays(nz, m, n, I, J, vp,
type, sizeof(double));
- } else {
- A = SparseMatrix_new(m, n, 1, type, FORMAT_COORD);
- A = SparseMatrix_coordinate_form_add_entries(A, nz, I, J, vp);
- }
- break;
- default:
- A = NULL;
- }
free(I);
free(J);
free(val);
/* ======================= read graph ==================== */
- A = SparseMatrix_import_matrix_market(pv.inf, FORMAT_CSR);
+ A = SparseMatrix_import_matrix_market(pv.inf);
if (!A) {
fprintf (stderr, "Unable to read input file \"%s\"\n", pv.infile);
usage(1);