From 2814e25cbc70160e57f426ec708f6d99180ef5fd Mon Sep 17 00:00:00 2001 From: glisse Date: Sun, 25 Oct 2015 21:41:01 +0000 Subject: Example to compute persistence of a Rips filtration "in parallel". On a machine with a gazillion cores, it gains a factor >2 at the expense of some memory. At this point, construction of the Rips graph and expansion are not negligible anymore and could use some parallelism. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/tbb@875 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 53d6a74338f1346bd7d1ca018ec15dd1ee8287e8 --- src/Hasse_complex/include/gudhi/Hasse_complex.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/Hasse_complex/include/gudhi') diff --git a/src/Hasse_complex/include/gudhi/Hasse_complex.h b/src/Hasse_complex/include/gudhi/Hasse_complex.h index af9ae5e9..38887264 100644 --- a/src/Hasse_complex/include/gudhi/Hasse_complex.h +++ b/src/Hasse_complex/include/gudhi/Hasse_complex.h @@ -44,8 +44,7 @@ struct Hasse_simplex { template< class Complex_ds > Hasse_simplex(Complex_ds & cpx , typename Complex_ds::Simplex_handle sh) - : key_(cpx.key(sh)) - , filtration_(cpx.filtration(sh)) + : filtration_(cpx.filtration(sh)) , boundary_() { boundary_.reserve(cpx.dimension(sh) + 1); for (auto b_sh : cpx.boundary_simplex_range(sh)) { @@ -55,7 +54,7 @@ struct Hasse_simplex { Hasse_simplex(typename HasseCpx::Simplex_key key , typename HasseCpx::Filtration_value fil - , std::vector boundary) + , std::vector const& boundary) : key_(key) , filtration_(fil) , boundary_(boundary) { } @@ -197,11 +196,12 @@ class Hasse_complex { } void initialize_filtration() { + // Setting the keys is done by pcoh, Simplex_tree doesn't do it either. +#if 0 Simplex_key key = 0; - for (auto & h_simp : complex_) { - h_simp.key_ = key; - ++key; - } + for (auto & h_simp : complex_) + h_simp.key_ = key++; +#endif } std::vector< Hasse_simp, Gudhi::no_init_allocator > complex_; -- cgit v1.2.3