]> granicus.if.org Git - graphviz/commitdiff
remove pattern_symmetric_only parameter to SparseMatrix_symmetrize_nodiag
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 26 Jun 2021 04:33:21 +0000 (21:33 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Jun 2021 03:24:10 +0000 (20:24 -0700)
This function is only called with FALSE for this argument, so we can propagate
it through and remove the parameter.

lib/sfdpgen/Multilevel.c
lib/sfdpgen/sfdpinit.c
lib/sfdpgen/spring_electrical.c
lib/sparse/SparseMatrix.c
lib/sparse/SparseMatrix.h

index 8d66004cefddff51d9d570d17d971d29d9ed2768..f510935920053bde12ee5ee076fda3a6755f0276 100644 (file)
@@ -1187,7 +1187,7 @@ Multilevel Multilevel_new(SparseMatrix A0, SparseMatrix D0, real *node_weights,
     A = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
   }
   if (D && (!SparseMatrix_is_symmetric(D, FALSE) || D->type != MATRIX_TYPE_REAL)){
-    D = SparseMatrix_symmetrize_nodiag(D, FALSE);
+    D = SparseMatrix_symmetrize_nodiag(D);
   }
   grid = Multilevel_init(A, D, node_weights);
   grid = Multilevel_establish(grid, ctrl);
index 9df8bf87a23c22d1b2695c003ec76c0641d4b1f1..9be0123837b34e7b2d81f189d00c2a89d9a40594 100644 (file)
@@ -121,7 +121,7 @@ static void sfdpLayout(graph_t * g, spring_electrical_control ctrl,
            D = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);/* all distance 1 */
            weighted = FALSE;
        } else {
-           D = SparseMatrix_symmetrize_nodiag(D, FALSE);
+           D = SparseMatrix_symmetrize_nodiag(D);
            weighted = TRUE;
        }
        if (hops > 0){
index 16516cfa9d2905d788b21ce8c54afb5bfe72adf5..9e2cd9d071ec3bee3bf74167ff585b3da42af153 100644 (file)
@@ -1977,9 +1977,9 @@ static void multilevel_spring_electrical_embedding_core(int dim, SparseMatrix A0
 
   if (!SparseMatrix_is_symmetric(A, FALSE) || A->type != MATRIX_TYPE_REAL){
     if (ctrl->method == METHOD_SPRING_MAXENT){
-      A = SparseMatrix_symmetrize_nodiag(A, FALSE);
+      A = SparseMatrix_symmetrize_nodiag(A);
       assert(D0);
-      D = SparseMatrix_symmetrize_nodiag(D, FALSE);
+      D = SparseMatrix_symmetrize_nodiag(D);
     } else {
       A = SparseMatrix_get_real_adjacency_matrix_symmetrized(A);
     }
index ba3505645333e736307281ff3da21ac2d7ca2f97..1c105d05c682f5b8c45ab807858980cab5971118 100644 (file)
@@ -155,9 +155,9 @@ SparseMatrix SparseMatrix_symmetrize(SparseMatrix A, int pattern_symmetric_only)
   return A;
 }
 
-SparseMatrix SparseMatrix_symmetrize_nodiag(SparseMatrix A, int pattern_symmetric_only){
+SparseMatrix SparseMatrix_symmetrize_nodiag(SparseMatrix A){
   SparseMatrix B;
-  if (SparseMatrix_is_symmetric(A, pattern_symmetric_only)) {
+  if (SparseMatrix_is_symmetric(A, FALSE)) {
     B = SparseMatrix_copy(A);
     return SparseMatrix_remove_diagonal(B);
   }
index 39d52981facc921481e0dba1d9638a55dfe16666..9836afda602e72b8bb0246670a907b3a62b8cac1 100644 (file)
@@ -76,7 +76,7 @@ SparseMatrix SparseMatrix_coordinate_form_add_entries(SparseMatrix A, int nentri
 int SparseMatrix_is_symmetric(SparseMatrix A, int test_pattern_symmetry_only);
 SparseMatrix SparseMatrix_transpose(SparseMatrix A);
 SparseMatrix SparseMatrix_symmetrize(SparseMatrix A, int pattern_symmetric_only);
-SparseMatrix SparseMatrix_symmetrize_nodiag(SparseMatrix A, int pattern_symmetric_only);
+SparseMatrix SparseMatrix_symmetrize_nodiag(SparseMatrix A);
 void SparseMatrix_multiply_vector(SparseMatrix A, real *v, real **res, int transposed);/* if v = NULL, v is assumed to be {1,1,...,1}*/
 SparseMatrix SparseMatrix_remove_diagonal(SparseMatrix A);
 SparseMatrix SparseMatrix_remove_upper(SparseMatrix A);/* remove diag and upper diag */