From bdb1e5517822d935da93d83c8950cbbd11560698 Mon Sep 17 00:00:00 2001 From: glisse Date: Fri, 13 Nov 2015 20:27:56 +0000 Subject: Using a static variable really helps. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/annotations_in_boundary@914 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 695a6f642399c2646e5a26fac20173fbd57fe160 --- src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/Persistent_cohomology') diff --git a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h index 1d8c2ca2..609f40a2 100644 --- a/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h +++ b/src/Persistent_cohomology/include/gudhi/Persistent_cohomology.h @@ -434,11 +434,9 @@ class Persistent_cohomology { // with multiplicity. We used to sum the coefficients directly in // annotations_in_boundary by using a map, we now do it later. typedef std::pair annotation_t; - std::vector annotations_in_boundary; - /* A small speed boost is possible with the following non-thread-safe: - static std::vector> annotations_in_boundary; - annotations_in_boundary.clear(); - */ + // Danger: not thread-safe! + static std::vector annotations_in_boundary; + annotations_in_boundary.clear(); int sign = 1 - 2 * (dim_sigma % 2); // \in {-1,1} provides the sign in the // alternate sum in the boundary. Simplex_key key; -- cgit v1.2.3