]> granicus.if.org Git - graphviz/commitdiff
remove support for transposed matrix v in SparseMatrix_multiply_dense
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 1 Jul 2021 02:17:52 +0000 (19:17 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 7 Jul 2021 14:30:16 +0000 (07:30 -0700)
The only use of this function is with not-transposed matrices.

lib/sfdpgen/post_process.c
lib/sfdpgen/spring_electrical.c
lib/sparse/SparseMatrix.c
lib/sparse/SparseMatrix.h

index 44c9ab962d6ff17ed961be26e79d1448f957434d..c826442124a9ce2dfb1e020473f22ad8adf5b5e3 100644 (file)
@@ -659,7 +659,7 @@ real StressMajorizationSmoother_smooth(StressMajorizationSmoother sm, int dim, r
       }
       /* solve (Lw+lambda*I) x = Lwdd y + lambda x0 */
 
-      SparseMatrix_multiply_dense(Lwdd, x, FALSE, &y, FALSE, dim);
+      SparseMatrix_multiply_dense(Lwdd, x, &y, FALSE, dim);
     } else {
       for (i = 0; i < m; i++){
        for (j = 0; j < dim; j++){
index 7989a594832b39b2f27d08b64c950e06069bec25..c9de0225e4dca7cb14f3c1bd665ee4f4ec45f8ee 100644 (file)
@@ -1685,7 +1685,7 @@ void interpolate_coord(int dim, SparseMatrix A, real *x){
 }
 static void prolongate(int dim, SparseMatrix A, SparseMatrix P, SparseMatrix R, real *x, real *y, int coarsen_scheme_used, real delta){
   int nc, *ia, *ja, i, j, k;
-  SparseMatrix_multiply_dense(P, x, FALSE, &y, FALSE, dim);
+  SparseMatrix_multiply_dense(P, x, &y, FALSE, dim);
 
   /* xu yao rao dong */
   if (coarsen_scheme_used > EDGE_BASED_STA && coarsen_scheme_used < EDGE_BASED_STO){
index 3e3f2c397efba04d534e59a1db1c2650dd85e5d9..0bf5cf3160a794612c79fee74a7616a01ccbb5ad 100644 (file)
@@ -1091,22 +1091,16 @@ static void SparseMatrix_multiply_dense2(SparseMatrix A, real *v, real **res, in
 
 }
 
-void SparseMatrix_multiply_dense(SparseMatrix A, real *v, int vTransposed, real **res, int res_transposed, int dim){
-  /* depend on value of {vTransposed}, assume res_transposed == FALSE
-     {FALSE}: A * V, with A dimension m x n, with V of dimension n x dim. v[i*dim+j] gives V[i,j]. Result of dimension m x dim
-     {TRUE}: A*V^T, with A dimension m x n, V dimension dim x n, v[i*n+j] gives V[i,j]. Result of dimension m x dim
+void SparseMatrix_multiply_dense(SparseMatrix A, real *v, real **res, int res_transposed, int dim){
+  /* assume res_transposed == FALSE
+     A * V, with A dimension m x n, with V of dimension n x dim. v[i*dim+j] gives V[i,j]. Result of dimension m x dim
  
      furthermore, if res_transpose d== TRUE, then the result is transposed. Hence if res_transposed == TRUE
 
-     {FALSE}: V^T A^T, with A dimension m x n, with V of dimension n x dim. v[i*dim+j] gives V[i,j]. Result of dimension dim x dim
-     {TRUE}: V*A^T, with A dimension m x n, V dimension dim x n, v[i*n+j] gives V[i,j]. Result of dimension dim x m
+     V^T A^T, with A dimension m x n, with V of dimension n x dim. v[i*dim+j] gives V[i,j]. Result of dimension dim x dim
  */
 
-  if (!vTransposed) {
-    SparseMatrix_multiply_dense1(A, v, res, dim, 0, res_transposed);
-  } else {
-    SparseMatrix_multiply_dense2(A, v, res, dim, 0, res_transposed);
-  }
+  SparseMatrix_multiply_dense1(A, v, res, dim, 0, res_transposed);
 }
 
 void SparseMatrix_multiply_vector(SparseMatrix A, real *v, real **res, int transposed){
index 32c95c9811ce9c4b458fc04d4c97955ec27aefef..fa867a7aac08932cd70f78edc0eb98ec4599c131 100644 (file)
@@ -73,7 +73,7 @@ SparseMatrix SparseMatrix_remove_diagonal(SparseMatrix A);
 SparseMatrix SparseMatrix_remove_upper(SparseMatrix A);/* remove diag and upper diag */
 SparseMatrix SparseMatrix_divide_row_by_degree(SparseMatrix A);
 SparseMatrix SparseMatrix_get_real_adjacency_matrix_symmetrized(SparseMatrix A);  /* symmetric, all entries to 1, diaginal removed */
-void SparseMatrix_multiply_dense(SparseMatrix A, real *v, int vTransposed, real **res, int res_transpose, int dim);
+void SparseMatrix_multiply_dense(SparseMatrix A, real *v, real **res, int res_transpose, int dim);
 SparseMatrix SparseMatrix_apply_fun(SparseMatrix A, double (*fun)(double x));/* for real only! */
 SparseMatrix SparseMatrix_copy(SparseMatrix A);
 int SparseMatrix_has_diagonal(SparseMatrix A);