summaryrefslogtreecommitdiff
path: root/include/phat/helpers
diff options
context:
space:
mode:
authorulrich.bauer@gmail.com <ulrich.bauer@gmail.com@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-05-16 15:34:15 +0000
committerulrich.bauer@gmail.com <ulrich.bauer@gmail.com@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-05-16 15:34:15 +0000
commit8fa5020a3710161bb0ddfda1b9003a369b3b2174 (patch)
treeec2f33b938304aa3809e3a5aba6e8d488d7501b0 /include/phat/helpers
parent772d0888efe11e12c6849e44bdda5c0cf58d39ee (diff)
dualization timing in phat binary, explicit function for dualizing persistence pairs
git-svn-id: https://phat.googlecode.com/svn/trunk@87 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
Diffstat (limited to 'include/phat/helpers')
-rw-r--r--include/phat/helpers/dualize.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/phat/helpers/dualize.h b/include/phat/helpers/dualize.h
index 5a9baf7..e3ae9ed 100644
--- a/include/phat/helpers/dualize.h
+++ b/include/phat/helpers/dualize.h
@@ -20,6 +20,8 @@
#include <phat/helpers/misc.h>
#include <phat/boundary_matrix.h>
+#include <phat/persistence_pairs.h>
+
namespace phat {
template< typename Representation >
@@ -60,4 +62,11 @@ namespace phat {
boundary_matrix.load_vector_vector( dual_matrix, dual_dims );
}
+
+ void dualize_persistence_pairs( persistence_pairs& pairs, const index n ) {
+ for (index i = 0; i < pairs.get_num_pairs(); ++i) {
+ std::pair< index, index > pair = pairs.get_pair( i );
+ pairs.set_pair( i , n - 1 - pair.second, n - 1 - pair.first);
+ }
+ }
}