From: Matthew Fernandez Date: Sat, 22 May 2021 01:17:08 +0000 (-0700) Subject: remove unused SparseMatrix_import_binary_fp X-Git-Tag: 2.47.3~27^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e42259c428d4a3a68dc34e6c85874e188c89077d;p=graphviz remove unused SparseMatrix_import_binary_fp --- diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index bafcc791a..ce532aaf1 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -618,50 +618,6 @@ static void SparseMatrix_export_csr(FILE *f, SparseMatrix A){ } -SparseMatrix SparseMatrix_import_binary_fp(FILE *f){ - SparseMatrix A = NULL; - int m, n, nz, nzmax, type, format, property; - size_t sz; - - size_t iread = fread(&m, sizeof(int), 1, f); - if (iread != 1) return NULL; - iread = fread(&n, sizeof(int), 1, f); - if (iread != 1) return NULL; - iread = fread(&nz, sizeof(int), 1, f); - if (iread != 1) return NULL; - iread = fread(&nzmax, sizeof(int), 1, f); - if (iread != 1) return NULL; - iread = fread(&type, sizeof(int), 1, f); - if (iread != 1) return NULL; - iread = fread(&format, sizeof(int), 1, f); - if (iread != 1) return NULL; - iread = fread(&property, sizeof(int), 1, f); - if (iread != 1) return NULL; - iread = fread(&sz, sizeof(size_t), 1, f); - if (iread != 1) return NULL; - - A = SparseMatrix_general_new(m, n, nz, type, sz, format); - A->nz = nz; - A->property = property; - - if (format == FORMAT_COORD){ - iread = fread(A->ia, sizeof(int), A->nz, f); - if (iread > (size_t)INT_MAX || (int)iread != A->nz) return NULL; - } else { - iread = fread(A->ia, sizeof(int), A->m + 1, f); - if (iread > (size_t)INT_MAX || (int)iread != A->m + 1) return NULL; - } - iread = fread(A->ja, sizeof(int), A->nz, f); - if (iread > (size_t)INT_MAX || (int)iread != A->nz) return NULL; - - if (A->size > 0) { - iread = fread(A->a, A->size, A->nz, f); - if (iread > (size_t)INT_MAX || (int)iread != A->nz) return NULL; - } - fclose(f); - return A; -} - static void SparseMatrix_export_coord(FILE *f, SparseMatrix A){ int *ia, *ja; real *a; diff --git a/lib/sparse/SparseMatrix.h b/lib/sparse/SparseMatrix.h index 7868f9050..1926e04ee 100644 --- a/lib/sparse/SparseMatrix.h +++ b/lib/sparse/SparseMatrix.h @@ -56,8 +56,6 @@ void SparseMatrix_print(char *, SparseMatrix A);/*print to stdout in Mathematica void SparseMatrix_export(FILE *f, SparseMatrix A);/* export into MM format except the header */ -SparseMatrix SparseMatrix_import_binary_fp(FILE *f);/* import into a preopenned file */ - void SparseMatrix_delete(SparseMatrix A); SparseMatrix SparseMatrix_add(SparseMatrix A, SparseMatrix B);