]> granicus.if.org Git - graphviz/commitdiff
remove unused SparseMatrix_distance_matrix_k_centers
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 9 Jun 2021 02:44:03 +0000 (19:44 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 19 Jun 2021 18:36:41 +0000 (11:36 -0700)
lib/sparse/SparseMatrix.c
lib/sparse/SparseMatrix.h

index 8e7b5c17e6d8e3ba8816fd61d61e0dce60a58da3..1884667d99e77f201e7136a22d01aa0906996be4 100644 (file)
@@ -3209,44 +3209,6 @@ int SparseMatrix_distance_matrix(SparseMatrix D0, int weighted, real **dist0){
 
 }
 
-SparseMatrix SparseMatrix_distance_matrix_k_centers(int K, SparseMatrix D, int weighted){
-  /* return a sparse matrix whichj represent the k-center and distance from every node to them.
-     The matrix will have k*n entries
-   */
-  int flag;
-  real *dist = NULL;
-  int m = D->m, n = D->n;
-  int root = 0;
-  int *centers = NULL;
-  real d;
-  int i, j, center;
-  SparseMatrix B, C;
-  int centering = FALSE;
-
-  assert(m == n);
-
-  B = SparseMatrix_new(n, n, 1, MATRIX_TYPE_REAL, FORMAT_COORD);
-
-  flag = SparseMatrix_k_centers(D, weighted, K, root, &centers, centering, &dist);
-  assert(!flag);
-
-  for (i = 0; i < K; i++){
-    center = centers[i];
-    for (j = 0; j < n; j++){
-      d = dist[i*n + j];
-      B = SparseMatrix_coordinate_form_add_entries(B, 1, &center, &j, &d);
-      B = SparseMatrix_coordinate_form_add_entries(B, 1, &j, &center, &d);
-    }
-  }
-
-  C = SparseMatrix_from_coordinate_format(B);
-  SparseMatrix_delete(B);
-
-  FREE(centers);
-  FREE(dist);
-  return C;
-}
-
 SparseMatrix SparseMatrix_distance_matrix_khops(int khops, SparseMatrix D0, int weighted){
   /*
     Input:
index e124a16b56709d454d746916fa1d5b574714c131..d3ffb9e6e5105389512048aa1b6a2aca9699c386 100644 (file)
@@ -120,7 +120,6 @@ int SparseMatrix_k_centers_user(SparseMatrix D, int weighted, int K,
 
 int SparseMatrix_distance_matrix(SparseMatrix A, int weighted,  real **dist_matrix);
 SparseMatrix SparseMatrix_distance_matrix_khops(int khops, SparseMatrix A, int weighted);
-SparseMatrix SparseMatrix_distance_matrix_k_centers(int K, SparseMatrix D, int weighted);
 
 SparseMatrix SparseMatrix_from_dense(int m, int n, real *x);