]> granicus.if.org Git - graphviz/commitdiff
remove unused SparseMatrix_exclude_submatrix
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 31 May 2021 16:45:59 +0000 (09:45 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 6 Jun 2021 18:06:37 +0000 (11:06 -0700)
lib/sparse/SparseMatrix.c
lib/sparse/SparseMatrix.h

index 35a12dea0726869a0d7d7d32fc7756974ff6d2ec..ba6c57fb76deb960b90e5ae734e1e69190346874 100644 (file)
@@ -2818,45 +2818,6 @@ SparseMatrix SparseMatrix_get_submatrix(SparseMatrix A, int nrow, int ncol, int
 
 }
 
-SparseMatrix SparseMatrix_exclude_submatrix(SparseMatrix A, int nrow, int ncol, int *rindices, int *cindices){
-  /* get a submatrix by excluding rows and columns */
-  int *r, *c, nr, nc, i;
-  SparseMatrix B;
-
-  if (nrow <= 0 && ncol <= 0) return A;
-
-  r = MALLOC(sizeof(int)*((size_t)A->m));
-  c = MALLOC(sizeof(int)*((size_t)A->n));
-
-  for (i = 0; i < A->m; i++) r[i] = i;
-  for (i = 0; i < A->n; i++) c[i] = i;
-  for (i = 0; i < nrow; i++) {
-    if (rindices[i] >= 0 && rindices[i] < A->m){
-      r[rindices[i]] = -1;
-    }
-  }
-  for (i = 0; i < ncol; i++) {
-    if (cindices[i] >= 0 && cindices[i] < A->n){
-      c[cindices[i]] = -1;
-    }
-  }
-
-  nr = nc = 0;
-  for (i = 0; i < A->m; i++) {
-    if (r[i] > 0) r[nr++] = r[i];
-  }
-  for (i = 0; i < A->n; i++) {
-    if (c[i] > 0) c[nc++] = c[i];
-  }
-
-  B = SparseMatrix_get_submatrix(A, nr, nc, r, c);
-
-  FREE(r);
-  FREE(c);
-  return B;
-
-}
-
 SparseMatrix SparseMatrix_largest_component(SparseMatrix A){
   SparseMatrix B;
   int ncomp;
index e98ecfecfcf3076dd37a79fc706fe1675ddaa53b..999c08689b8a55009ad48a2c687d4ecdf90839e7 100644 (file)
@@ -95,7 +95,6 @@ void SparseMatrix_level_sets_khops(int khops, SparseMatrix A, int root, int *nle
 void SparseMatrix_weakly_connected_components(SparseMatrix A0, int *ncomp, int **comps, int **comps_ptr);
 void SparseMatrix_decompose_to_supervariables(SparseMatrix A, int *ncluster, int **cluster, int **clusterp);
 SparseMatrix SparseMatrix_get_submatrix(SparseMatrix A, int nrow, int ncol, int *rindices, int *cindices);
-SparseMatrix SparseMatrix_exclude_submatrix(SparseMatrix A, int nrow, int ncol, int *rindices, int *cindices);
 
 SparseMatrix SparseMatrix_get_augmented(SparseMatrix A);