summaryrefslogtreecommitdiff
path: root/src
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 /src
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 'src')
-rw-r--r--src/phat.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/phat.cpp b/src/phat.cpp
index a955b54..c19aea8 100644
--- a/src/phat.cpp
+++ b/src/phat.cpp
@@ -30,6 +30,7 @@
#include <phat/algorithms/row_reduction.h>
#include <phat/algorithms/chunk_reduction.h>
+#include <phat/helpers/dualize.h>
enum Representation_type {VECTOR_VECTOR, VECTOR_SET, SPARSE_PIVOT_COLUMN, FULL_PIVOT_COLUMN, BIT_TREE_PIVOT_COLUMN, VECTOR_LIST};
enum Algorithm_type {STANDARD, TWIST, ROW, CHUNK, CHUNK_SEQUENTIAL };
@@ -108,17 +109,28 @@ void compute_pairing( std::string input_filename, std::string output_filename, b
std::cerr << "Error opening file " << input_filename << std::endl;
print_help_and_exit();
}
-
+
+ phat::index num_cols = matrix.get_num_cols();
+
+ if( dualize ) {
+ double dualize_timer = omp_get_wtime();
+ LOG( "Dualizing ..." )
+ phat::dualize ( matrix );
+ double dualize_time = omp_get_wtime() - dualize_timer;
+ double dualize_time_rounded = floor( dualize_time * 10.0 + 0.5 ) / 10.0;
+ LOG( "Dualizing took " << setiosflags( std::ios::fixed ) << setiosflags( std::ios::showpoint ) << std::setprecision( 1 ) << dualize_time_rounded <<"s" )
+ }
+
double pairs_timer = omp_get_wtime();
phat::persistence_pairs pairs;
LOG( "Computing persistence pairs ..." )
- if( dualize )
- phat::compute_persistence_pairs_dualized< Algorithm > ( pairs, matrix );
- else
- phat::compute_persistence_pairs < Algorithm > ( pairs, matrix );
+ phat::compute_persistence_pairs < Algorithm > ( pairs, matrix );
double pairs_time = omp_get_wtime() - pairs_timer;
double pairs_time_rounded = floor( pairs_time * 10.0 + 0.5 ) / 10.0;
LOG( "Computing persistence pairs took " << setiosflags( std::ios::fixed ) << setiosflags( std::ios::showpoint ) << std::setprecision( 1 ) << pairs_time_rounded <<"s" )
+
+ if( dualize ) dualize_persistence_pairs( pairs, num_cols );
+
double write_timer = omp_get_wtime();
if( use_binary ) {