From: Matthew Fernandez Date: Thu, 1 Jul 2021 02:00:40 +0000 (-0700) Subject: remove SUM_IMGINARY_KEEP_LAST_REAL option X-Git-Tag: 2.48.0~11^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1ced6ff78f7a1ab1540288fda7df9fb0d0ad68cf;p=graphviz remove SUM_IMGINARY_KEEP_LAST_REAL option This is a configuration option to SparseMatrix_from_coordinate_arrays_not_compacted that is never used. Curiously it also seems misspelled. --- diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index 50bac4e4b..97411775f 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -1645,26 +1645,6 @@ SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum){ sta = ia[i+1]; ia[i+1] = nz; } - } else if (what_to_sum == SUM_IMGINARY_KEEP_LAST_REAL){ - /* merge {i,j,R1,I1} and {i,j,R2,I2} into {i,j,R1+R2,I2}*/ - nz = 0; - sta = ia[0]; - for (i = 0; i < A->m; i++){ - for (j = sta; j < ia[i+1]; j++){ - if (mask[ja[j]] < ia[i]){ - ja[nz] = ja[j]; - a[2*nz] = a[2*j]; - a[2*nz+1] = a[2*j+1]; - mask[ja[j]] = nz++; - } else { - assert(ja[mask[ja[j]]] == ja[j]); - a[2*mask[ja[j]]] += a[2*j]; - a[2*mask[ja[j]]+1] = a[2*j+1]; - } - } - sta = ia[i+1]; - ia[i+1] = nz; - } } else if (what_to_sum == SUM_REPEATED_REAL_PART){ int ymin, ymax, id; ymax = ymin = a[1]; diff --git a/lib/sparse/SparseMatrix.h b/lib/sparse/SparseMatrix.h index 821cdd2c9..79d269757 100644 --- a/lib/sparse/SparseMatrix.h +++ b/lib/sparse/SparseMatrix.h @@ -66,10 +66,8 @@ SparseMatrix SparseMatrix_multiply3(SparseMatrix A, SparseMatrix B, SparseMatrix if what_to_sum = SUM_REPEATED_IMAGINARY_PART, we find entries {i,j,x + i y} and sum the y's if {i,j,Round(x)} are the same For other matrix, what_to_sum = SUM_REPEATED_REAL_PART is the same as what_to_sum = SUM_REPEATED_IMAGINARY_PART or what_to_sum = SUM_REPEATED_ALL - if what_to_sum = SUM_IMGINARY_KEEP_LAST_REAL, we merge {i,j,R1,I1} and {i,j,R2,I2} into {i,j,R1+R2,I2}. Useful if I1 and I2 are time stamps, - . and we use this to indicate that a user watched R1+R2 seconds, last watch is I2. */ -enum {SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART, SUM_IMGINARY_KEEP_LAST_REAL}; +enum {SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART, }; SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum); SparseMatrix SparseMatrix_coordinate_form_add_entries(SparseMatrix A, int nentries, int *irn, int *jcn, void *val); int SparseMatrix_is_symmetric(SparseMatrix A, int test_pattern_symmetry_only);