]> granicus.if.org Git - graphviz/commitdiff
remove SUM_REPEATED_IMAGINARY_PART option
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 1 Jul 2021 02:04:49 +0000 (19:04 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Jul 2021 14:30:16 +0000 (07:30 -0700)
This is a configuration option to
SparseMatrix_from_coordinate_arrays_not_compacted that is never used.

lib/sparse/SparseMatrix.c
lib/sparse/SparseMatrix.h

index 97411775f1cb2ccddcc2c593aae48541c6276b8c..e1c700b7e7fe5c81454c634c2d627d8c7be4c7fa 100644 (file)
@@ -1587,8 +1587,8 @@ SparseMatrix SparseMatrix_multiply3(SparseMatrix A, SparseMatrix B, SparseMatrix
    but unfortunately I do not have such object implemented yet.
    
 
-   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. In this implementation we assume that
+   For other matrix, what_to_sum = SUM_REPEATED_REAL_PART is the same as
+    what_to_sum = SUM_REPEATED_ALL. In this implementation we assume that
    the {j,y} pairs are dense, so we usea 2D array for hashing 
 */
 SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum){
@@ -1681,41 +1681,6 @@ SparseMatrix SparseMatrix_sum_repeat_entries(SparseMatrix A, int what_to_sum){
          ia[i+1] = nz;
        }
        
-      } else if (what_to_sum == SUM_REPEATED_IMAGINARY_PART){
-       int xmin, xmax, id;
-       xmax = xmin = a[1];
-       nz = 0;
-       for (i = 0; i < A->m; i++){
-         for (j = ia[i]; j < ia[i+1]; j++){
-           xmax = MAX(xmax, (int) a[2*nz]);
-           xmin = MAX(xmin, (int) a[2*nz]);
-           nz++;
-         }       
-       }
-       FREE(mask);
-       mask = MALLOC(sizeof(int)*((size_t)n)*((size_t)(xmax-xmin+1)));
-       for (i = 0; i < n*(xmax-xmin+1); i++) mask[i] = -1;
-
-       nz = 0;
-       sta = ia[0];
-       for (i = 0; i < A->m; i++){
-         for (j = sta; j < ia[i+1]; j++){
-           id = ja[j] + ((int)a[2*j] - xmin)*n;
-           if (mask[id] < ia[i]){
-             ja[nz] = ja[j];
-             a[2*nz] = a[2*j];
-             a[2*nz+1] = a[2*j+1];
-             mask[id] = nz++;
-           } else {
-             assert(ja[mask[id]] == ja[j]);
-             a[2*mask[id]] = a[2*j];
-             a[2*mask[id]+1] += a[2*j+1];
-           }
-         }
-         sta = ia[i+1];
-         ia[i+1] = nz;
-       }
-
       }
     }
     break;
index 79d2697571682b6de7ff0b257490bb3128ed4b10..7976010ab3f855a48f357e4b018293d54e063c36 100644 (file)
@@ -63,11 +63,10 @@ SparseMatrix SparseMatrix_multiply3(SparseMatrix A, SparseMatrix B, SparseMatrix
 
 /* For complex matrix:
    if what_to_sum = SUM_REPEATED_REAL_PART, we find entries {i,j,x + i y} and sum the x's if {i,j,Round(y)} are the same
-   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
+   For other matrix, what_to_sum = SUM_REPEATED_REAL_PART is the same as
+   what_to_sum = SUM_REPEATED_ALL
 */
-enum {SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, SUM_REPEATED_REAL_PART, SUM_REPEATED_IMAGINARY_PART, };
+enum {SUM_REPEATED_NONE = 0, SUM_REPEATED_ALL, SUM_REPEATED_REAL_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);