getfem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Getfem-commits] (no subject)


From: Markus Bürg
Subject: [Getfem-commits] (no subject)
Date: Thu, 23 May 2019 10:24:01 -0400 (EDT)

branch: mb-Use_rtree_in_poly_composite
commit 208f8a626028ed2af0322fa559f0e6fcdcbc152f
Author: mb <address@hidden>
Date:   Thu May 23 16:23:22 2019 +0200

    Obtain column beforehand to avoid one vector access in the loop.
---
 src/getfem/bgeot_poly_composite.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/getfem/bgeot_poly_composite.h 
b/src/getfem/bgeot_poly_composite.h
index 2546bba..38dce95 100644
--- a/src/getfem/bgeot_poly_composite.h
+++ b/src/getfem/bgeot_poly_composite.h
@@ -131,7 +131,8 @@ namespace bgeot {
     const base_matrix &M, const ITER &it, const base_node &p1, base_node &p2) {
     for (dim_type d = 0; d < p2.size(); ++d) {
       p2[d] = 0;
-      for (dim_type i = 0; i < p1.size(); ++i) p2[d] += M(i, d) * (*(it + i) - 
p1[i]);
+      auto &col = mat_col(M, d);
+      for (dim_type i = 0; i < p1.size(); ++i) p2[d] += col[i] * (*(it + i) - 
p1[i]);
     }
   }
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]