From: Matthew Fernandez Date: Mon, 31 May 2021 16:42:47 +0000 (-0700) Subject: remove unused SparseMatrix_connectedQ X-Git-Tag: 2.47.3~10^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=219e17f864127cf2c85da7ee256ea306017a642e;p=graphviz remove unused SparseMatrix_connectedQ --- diff --git a/lib/sparse/SparseMatrix.c b/lib/sparse/SparseMatrix.c index 91c4de328..35a12dea0 100644 --- a/lib/sparse/SparseMatrix.c +++ b/lib/sparse/SparseMatrix.c @@ -2498,27 +2498,6 @@ real SparseMatrix_pseudo_diameter_unweighted(SparseMatrix A0, int root, int aggr return (real) nlevel0 - 1; } -int SparseMatrix_connectedQ(SparseMatrix A0){ - int root = 0, nlevel, *levelset_ptr = NULL, *levelset = NULL, *mask = NULL, connected; - SparseMatrix A = A0; - - if (!SparseMatrix_is_symmetric(A, TRUE)){ - if (A->m != A->n) return FALSE; - A = SparseMatrix_symmetrize(A, TRUE); - } - - SparseMatrix_level_sets(A, root, &nlevel, &levelset_ptr, &levelset, &mask, TRUE); - connected = (levelset_ptr[nlevel] == A->m); - - FREE(levelset_ptr); - FREE(levelset); - FREE(mask); - if (A != A0) SparseMatrix_delete(A); - - return connected; -} - - void SparseMatrix_decompose_to_supervariables(SparseMatrix A, int *ncluster, int **cluster, int **clusterp){ /* nodes for a super variable if they share exactly the same neighbors. This is know as modules in graph theory. We work on columns only and columns with the same pattern are grouped as a super variable diff --git a/lib/sparse/SparseMatrix.h b/lib/sparse/SparseMatrix.h index 1aae230b4..e98ecfecf 100644 --- a/lib/sparse/SparseMatrix.h +++ b/lib/sparse/SparseMatrix.h @@ -88,7 +88,6 @@ SparseMatrix SparseMatrix_copy(SparseMatrix A); int SparseMatrix_has_diagonal(SparseMatrix A); SparseMatrix SparseMatrix_scaled_by_vector(SparseMatrix A, real *v, int apply_to_row); SparseMatrix SparseMatrix_make_undirected(SparseMatrix A);/* make it strictly low diag only, and set flag to undirected */ -int SparseMatrix_connectedQ(SparseMatrix A); real SparseMatrix_pseudo_diameter_weighted(SparseMatrix A0, int root, int aggressive, int *end1, int *end2, int *connectedQ); /* assume real distances, unsymmetric matrix ill be symmetrized */ real SparseMatrix_pseudo_diameter_unweighted(SparseMatrix A0, int root, int aggressive, int *end1, int *end2, int *connectedQ); /* assume unit edge length, unsymmetric matrix ill be symmetrized */ void SparseMatrix_level_sets(SparseMatrix A, int root, int *nlevel, int **levelset_ptr, int **levelset, int **mask, int reintialize_mask);