]> granicus.if.org Git - graphviz/commitdiff
remove support for transposed matrix A in SparseMatrix_multiply_dense
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 1 Jul 2021 02:15:37 +0000 (19:15 -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 4c79329c284204a17170dd24cf6f703b947897d6..44c9ab962d6ff17ed961be26e79d1448f957434d 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, FALSE, x, FALSE, &y, FALSE, dim);
+      SparseMatrix_multiply_dense(Lwdd, x, FALSE, &y, FALSE, dim);
     } else {
       for (i = 0; i < m; i++){
        for (j = 0; j < dim; j++){
index a6d350d30fe60332fddd9ceabd4ba425f0627d77..7989a594832b39b2f27d08b64c950e06069bec25 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, FALSE, x, FALSE, &y, FALSE, dim);
+  SparseMatrix_multiply_dense(P, x, FALSE, &y, FALSE, dim);
 
   /* xu yao rao dong */
   if (coarsen_scheme_used > EDGE_BASED_STA && coarsen_scheme_used < EDGE_BASED_STO){
index 6c27563591af55fc928ed2640cb9a85a6e83eecb..3e3f2c397efba04d534e59a1db1c2650dd85e5d9 100644 (file)
@@ -1091,33 +1091,24 @@ static void SparseMatrix_multiply_dense2(SparseMatrix A, real *v, real **res, in
 
 }
 
-
-
-void SparseMatrix_multiply_dense(SparseMatrix A, int ATransposed, real *v, int vTransposed, real **res, int res_transposed, int dim){
-  /* depend on value of {ATranspose, vTransposed}, assume res_transposed == FALSE
-     {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, FALSE}: A^T * V, with A dimension m x n, with V of dimension m x dim. v[i*dim+j] gives V[i,j]. Result of dimension n x dim
-     {FALSE, 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
-     {TRUE, TRUE}: A^T*V^T, with A dimension m x n, V dimension dim x m. v[i*m+j] gives V[i,j]. Result of dimension n x dim
+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
  
      furthermore, if res_transpose d== TRUE, then the result is transposed. Hence if res_transposed == TRUE
 
-     {FALSE, 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, FALSE}: V^T A, with A dimension m x n, with V of dimension m x dim. v[i*dim+j] gives V[i,j]. Result of dimension dim x n
-     {FALSE, 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
-     {TRUE, TRUE}: V A, with A dimension m x n, V dimension dim x m. v[i*m+j] gives V[i,j]. Result of dimension dim x n
+     {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
  */
 
   if (!vTransposed) {
-    SparseMatrix_multiply_dense1(A, v, res, dim, ATransposed, res_transposed);
+    SparseMatrix_multiply_dense1(A, v, res, dim, 0, res_transposed);
   } else {
-    SparseMatrix_multiply_dense2(A, v, res, dim, ATransposed, res_transposed);
+    SparseMatrix_multiply_dense2(A, v, res, dim, 0, res_transposed);
   }
-
 }
 
-
-
 void SparseMatrix_multiply_vector(SparseMatrix A, real *v, real **res, int transposed){
   /* A v or A^T v. Real only for now. */
   int i, j, *ia, *ja, n, m;
index 09da0d08e16a05219619b828bc4ff3d0fe30bfad..32c95c9811ce9c4b458fc04d4c97955ec27aefef 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, int ATranspose, real *v, int vTransposed, real **res, int res_transpose, int dim);
+void SparseMatrix_multiply_dense(SparseMatrix A, real *v, int vTransposed, 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);