28 if ((c = fgetc(f)) !=
'%') {
35 printf(
"Could not process Matrix Market banner.\n");
51 for (
size_t i = 0; i < nz; i++) {
52 int num = fscanf(f,
"%d %d %lg\n", &
I[i], &J[i], &val[i]);
63 const size_t nzold = nz;
64 for (
size_t i = 0; i < nzold; i++) {
75 const size_t nzold = nz;
76 for (
size_t i = 0; i < nzold; i++) {
97 A->is_symmetric =
true;
98 A->is_pattern_symmetric =
true;
SparseMatrix SparseMatrix_from_coordinate_arrays(size_t nz, int m, int n, int *irn, int *jcn, const void *val, int type, size_t sz)
Memory allocation wrappers that exit on failure.
static void * gv_recalloc(void *ptr, size_t old_nmemb, size_t new_nmemb, size_t size)
static void * gv_calloc(size_t nmemb, size_t size)
SparseMatrix SparseMatrix_import_matrix_market(FILE *f)
int mm_read_mtx_crd_size(FILE *f, int *M, int *N, size_t *nz)
int mm_read_banner(FILE *f, matrix_shape_t *shape)