Fix persistence comp. in interpret_persistence()
authorStefan Huber <shuber@sthu.org>
Thu, 27 Nov 2014 13:18:29 +0000 (14:18 +0100)
committerStefan Huber <shuber@sthu.org>
Thu, 27 Nov 2014 13:18:29 +0000 (14:18 +0100)
include/libstick/persistence.h

index a2e163f6bcf851034fd7c41037d164fea06b1bf1..481d6480d2dd50821d82845672fdf0dd45873673 100644 (file)
@@ -303,7 +303,9 @@ class persistence {
                         os << birth << "\033[1;31m -> " << death << "\033[0;m";
 
                         if (f != NULL) {
-                            const VT pers = f->get_value(death) -  f->get_value(birth);
+                            const IT birth_idx = order.order_to_complex(birth);
+                            const IT death_idx = order.order_to_complex(death);
+                            const VT pers = f->get_value(death_idx) - f->get_value(birth_idx);
                             os << " \tpers: " << pers;
                         }
                     } else {