From: Matthew Fernandez Date: Wed, 9 Jun 2021 02:44:03 +0000 (-0700) Subject: remove unused SparseMatrix_distance_matrix_k_centers X-Git-Tag: 2.48.0~45^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b4ba2a3f0c50f7a105a0382107020b27df852a0e;p=graphviz remove unused SparseMatrix_distance_matrix_k_centers --- diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index 8e7b5c17e..1884667d9 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -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, ¢ers, 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, ¢er, &j, &d); - B = SparseMatrix_coordinate_form_add_entries(B, 1, &j, ¢er, &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: diff --git a/lib/sparse/SparseMatrix.h b/lib/sparse/SparseMatrix.h index e124a16b5..d3ffb9e6e 100644 --- a/lib/sparse/SparseMatrix.h +++ b/lib/sparse/SparseMatrix.h @@ -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);