From: Matthew Fernandez Date: Thu, 1 Jul 2021 01:55:55 +0000 (-0700) Subject: remove configurability from SparseMatrix_from_coordinate_format_not_compacted X-Git-Tag: 2.48.0~11^2~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=376fb1d13bbe1de971dca0ec14151df61d7297a8;p=graphviz remove configurability from SparseMatrix_from_coordinate_format_not_compacted This function is only ever called with SUM_REPEATED_NONE. --- diff --git a/cmd/gvmap/make_map.c b/cmd/gvmap/make_map.c index a593e228b..53e9926df 100644 --- a/cmd/gvmap/make_map.c +++ b/cmd/gvmap/make_map.c @@ -396,7 +396,7 @@ static void get_tri(int n, int dim, real *x, int *nt, struct Triangle **T, Spars A = matrix_add_entry(A, i2, i0, i); } - B = SparseMatrix_from_coordinate_format_not_compacted(A, SUM_REPEATED_NONE); + B = SparseMatrix_from_coordinate_format_not_compacted(A); SparseMatrix_delete(A); B = SparseMatrix_sort(B); *E = B; @@ -624,7 +624,7 @@ static void get_poly_lines(int exclude_random, int nt, SparseMatrix graph, Spars }/* found poly_lines for this comp */ } - A = SparseMatrix_from_coordinate_format_not_compacted(*poly_lines, SUM_REPEATED_NONE); + A = SparseMatrix_from_coordinate_format_not_compacted(*poly_lines); SparseMatrix_delete(*poly_lines); *poly_lines = A; @@ -747,7 +747,7 @@ static void get_polygon_solids(int nt, SparseMatrix E, int ncomps, int *comps_pt assert(E->nz >= ne); cycle = MALLOC(sizeof(int)*ne*2); - B = SparseMatrix_from_coordinate_format_not_compacted(half_edges, SUM_REPEATED_NONE); + B = SparseMatrix_from_coordinate_format_not_compacted(half_edges); SparseMatrix_delete(half_edges);half_edges = B; edge_cycle_map = MALLOC(sizeof(int)*ne); @@ -927,7 +927,7 @@ static void get_polygon_solids(int nt, SparseMatrix E, int ncomps, int *comps_pt /* unset edge_map */ } - B = SparseMatrix_from_coordinate_format_not_compacted(*polys, SUM_REPEATED_NONE); + B = SparseMatrix_from_coordinate_format_not_compacted(*polys); SparseMatrix_delete(*polys); *polys = B; diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index e4eba916b..65b404f23 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -714,7 +714,7 @@ SparseMatrix SparseMatrix_from_coordinate_format(SparseMatrix A){ return SparseMatrix_from_coordinate_arrays(A->nz, A->m, A->n, irn, jcn, a, A->type, A->size); } -SparseMatrix SparseMatrix_from_coordinate_format_not_compacted(SparseMatrix A, int what_to_sum){ +SparseMatrix SparseMatrix_from_coordinate_format_not_compacted(SparseMatrix A){ /* convert a sparse matrix in coordinate form to one in compressed row form.*/ int *irn, *jcn; @@ -726,8 +726,7 @@ SparseMatrix SparseMatrix_from_coordinate_format_not_compacted(SparseMatrix A, i } irn = A->ia; jcn = A->ja; - return SparseMatrix_from_coordinate_arrays_not_compacted(A->nz, A->m, A->n, irn, jcn, a, A->type, A->size, what_to_sum); - + return SparseMatrix_from_coordinate_arrays_not_compacted(A->nz, A->m, A->n, irn, jcn, a, A->type, A->size, SUM_REPEATED_NONE); } static SparseMatrix SparseMatrix_from_coordinate_arrays_internal(int nz, int m, int n, int *irn, int *jcn, void *val0, int type, size_t sz, int sum_repeated){ diff --git a/lib/sparse/SparseMatrix.h b/lib/sparse/SparseMatrix.h index 847229614..c24c07bf8 100644 --- a/lib/sparse/SparseMatrix.h +++ b/lib/sparse/SparseMatrix.h @@ -45,10 +45,10 @@ SparseMatrix SparseMatrix_general_new(int m, int n, int nz, int type, size_t sz, /* this version sum repeated entries */ SparseMatrix SparseMatrix_from_coordinate_format(SparseMatrix A); -/* what_to_sum is SUM_REPEATED_NONE, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART, SUM_IMGINARY_KEEP_LAST_REAL*/ -SparseMatrix SparseMatrix_from_coordinate_format_not_compacted(SparseMatrix A, int what_to_sum); +SparseMatrix SparseMatrix_from_coordinate_format_not_compacted(SparseMatrix A); SparseMatrix SparseMatrix_from_coordinate_arrays(int nz, int m, int n, int *irn, int *jcn, void *val, int type, size_t sz); +/* what_to_sum is SUM_REPEATED_NONE, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART, SUM_IMGINARY_KEEP_LAST_REAL*/ SparseMatrix SparseMatrix_from_coordinate_arrays_not_compacted(int nz, int m, int n, int *irn, int *jcn, void *val, int type, size_t sz, int what_to_sum);