summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-05-06 09:13:06 +0000
committerjan.reininghaus <jan.reininghaus@8e3bb3c2-eed4-f18f-5264-0b6c94e6926d>2013-05-06 09:13:06 +0000
commit96eafea12583669ff0084b2e780fc6165548b43c (patch)
tree1ace5f174e6ff3e005b83d1df9ea40ee320e8f15
parent6ff1c5b1ff99d7ad4c21cff02c60aee55aef1159 (diff)
changed benchmark behavior
git-svn-id: https://phat.googlecode.com/svn/trunk@62 8e3bb3c2-eed4-f18f-5264-0b6c94e6926d
-rw-r--r--src/benchmark.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/benchmark.cpp b/src/benchmark.cpp
index 634fd4c..55538fd 100644
--- a/src/benchmark.cpp
+++ b/src/benchmark.cpp
@@ -30,6 +30,8 @@
#include <phat/algorithms/row_reduction.h>
#include <phat/algorithms/chunk_reduction.h>
+#include <phat/helpers/dualize.h>
+
#include <iostream>
#include <iomanip>
@@ -122,16 +124,23 @@ void compute( std::string input_filename,
print_help_and_exit();
}
- double pairs_timer = omp_get_wtime();
- phat::persistence_pairs pairs;
+ Algorithm reduction_algorithm;
+ double reduction_timer = -1;
if( ansatz == PRIMAL ) {
std::cout << " primal";
- phat::compute_persistence_pairs< Algorithm > ( pairs, matrix );
+ reduction_timer = omp_get_wtime();
+ reduction_algorithm( matrix );
} else {
std::cout << " dual";
- phat::compute_persistence_pairs_dualized< Algorithm > ( pairs, matrix );
+ dualize( matrix );
+ reduction_timer = omp_get_wtime();
+ reduction_algorithm( matrix );
}
- std::cout << " " << setiosflags( std::ios::fixed ) << setiosflags( std::ios::showpoint ) << std::setprecision( 1 ) << omp_get_wtime() - pairs_timer <<"s" << std::endl;
+ double running_time = omp_get_wtime() - reduction_timer;
+ double running_time_rounded = floor( running_time * 10.0 + 0.5 ) / 10.0;
+
+ //std::cout << " " << setiosflags( std::ios::fixed ) << setiosflags( std::ios::showpoint ) << std::setprecision( 4 ) << running_time <<"s" << std::endl;
+ std::cout << " " << setiosflags( std::ios::fixed ) << setiosflags( std::ios::showpoint ) << std::setprecision( 1 ) << running_time_rounded <<"s" << std::endl;
}