getfem-commits
[Top][All Lists]
Advanced

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

[Getfem-commits] (no subject)


From: Andriy Andreykiv
Subject: [Getfem-commits] (no subject)
Date: Thu, 8 Nov 2018 10:38:43 -0500 (EST)

branch: comparing_global_objects_by_key
commit f56e01a6e4dc6d488c3d25aa77f99f67a3b42cfa
Author: Andriy.Andreykiv <address@hidden>
Date:   Thu Nov 8 16:38:27 2018 +0100

    comparing pconvex_structure by keys everywhere
---
 src/getfem/bgeot_convex_structure.h | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/getfem/bgeot_convex_structure.h 
b/src/getfem/bgeot_convex_structure.h
index 7632d18..5b4f659 100644
--- a/src/getfem/bgeot_convex_structure.h
+++ b/src/getfem/bgeot_convex_structure.h
@@ -154,6 +154,21 @@ namespace bgeot {
     friend pconvex_structure basic_structure(pconvex_structure cv);
   };
 
+  /**
+  *   Stored objects must be compared by keys, because there is a possibility 
that
+  *   they are duplicated in storages of multiple threads and pointers to them 
are
+  *   never equal
+  */
+  inline bool operator==(const pconvex_structure &p1, const pconvex_structure 
&p2)
+  {
+    return *dal::key_of_stored_object(p1) == *dal::key_of_stored_object(p2);
+  }
+
+  inline bool operator!=(const pconvex_structure &p1, const pconvex_structure 
&p2)
+  {
+    return !(p1 == p2);
+  }
+
   /// Original structure (if concerned)
   inline pconvex_structure basic_structure(pconvex_structure cv)
   { if (cv->auto_basic) return cv; else return cv->basic_pcvs; }
@@ -204,7 +219,7 @@ namespace bgeot {
   prism_structure(dim_type nc) { return prism_P1_structure(nc); }
   IS_DEPRECATED inline pconvex_structure
   pyramid_structure(short_type k) { return pyramid_QK_structure(k); }
-  
+
 
   /** Simplex structure with the Lagrange grid of degree k.
       @param n the simplex dimension.



reply via email to

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