remove unused SparseMatrix_largest_component
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 31 May 2021 16:46:45 +0000 (09:46 -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 ba6c57fb76deb960b90e5ae734e1e69190346874..73971cb75f876ff4ad70e6a14f2af449332f4f7e 100644 (file)
@@ -2818,36 +2818,6 @@ SparseMatrix SparseMatrix_get_submatrix(SparseMatrix A, int nrow, int ncol, int
 
 }
 
-SparseMatrix SparseMatrix_largest_component(SparseMatrix A){
-  SparseMatrix B;
-  int ncomp;
-  int *comps = NULL;
-  int *comps_ptr = NULL;
-  int i;
-  int nmax, imax = 0;
-
-  if (!A) return NULL;
-  A = SparseMatrix_to_square_matrix(A, BIPARTITE_RECT);
-  SparseMatrix_weakly_connected_components(A, &ncomp, &comps, &comps_ptr);
-  if (ncomp == 1) {
-    B = A;
-  } else {
-    nmax = 0;
-    for (i = 0; i < ncomp; i++){
-      if (nmax < comps_ptr[i+1] - comps_ptr[i]){
-       nmax = comps_ptr[i+1] - comps_ptr[i];
-       imax = i;
-      }
-    }
-    B = SparseMatrix_get_submatrix(A, nmax, nmax, &comps[comps_ptr[imax]], &comps[comps_ptr[imax]]);
-  }
-  FREE(comps);
-  FREE(comps_ptr);
-  return B;
-
-
-}
-
 SparseMatrix SparseMatrix_delete_sparse_columns(SparseMatrix A, int threshold, int **new2old, int *nnew, int inplace){
   /* delete sparse columns of threshold or less entries in A. After than number of columns will be nnew, and 
      the mapping from new matrix column to old matrix column is new2old.
index 999c08689b8a55009ad48a2c687d4ecdf90839e7..ba5a64fa9a5695b8db768d4e272c331023143adb 100644 (file)
@@ -106,8 +106,6 @@ SparseMatrix SparseMatrix_get_augmented(SparseMatrix A);
 */
 SparseMatrix SparseMatrix_to_square_matrix(SparseMatrix A, int bipartite_options);
 
-SparseMatrix SparseMatrix_largest_component(SparseMatrix A);
-
 /* columns with <= threhold entries are deleted */
 SparseMatrix SparseMatrix_delete_empty_columns(SparseMatrix A, int **new2old, int *nnew, int inplace);
 SparseMatrix SparseMatrix_delete_sparse_columns(SparseMatrix A, int threshold, int **new2old, int *nnew, int inplace);