From 0ae0988875cbf9f3c8603a7db2c743c041e7cb61 Mon Sep 17 00:00:00 2001 From: Ulrich Bauer Date: Fri, 13 Nov 2015 18:21:26 -0500 Subject: use google sparse hash map --- ripser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'ripser.cpp') diff --git a/ripser.cpp b/ripser.cpp index 54a3ae2..0e480f5 100644 --- a/ripser.cpp +++ b/ripser.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include "prettyprint.hpp" typedef float value_t; @@ -627,7 +627,7 @@ typedef index_t diameter_index_t; template void assemble_columns_to_reduce ( std::vector& columns_to_reduce, - std::unordered_map& pivot_column_index, + google::sparse_hash_map& pivot_column_index, const Comparator& comp, index_t dim, index_t n, value_t threshold, @@ -750,7 +750,7 @@ inline void push_entry(Heap& column, index_t i, coefficient_t c, value_t diamete template void compute_pairs( std::vector& columns_to_reduce, - std::unordered_map& pivot_column_index, + google::sparse_hash_map& pivot_column_index, const ComparatorCofaces& comp, const Comparator& comp_prev, index_t dim, index_t n, value_t threshold, @@ -1173,7 +1173,7 @@ int main( int argc, char** argv ) { rips_filtration_diameter_comparator comp(diameters[1], dim + 1, binomial_coeff); rips_filtration_comparator comp_prev(dist, dim, binomial_coeff); - std::unordered_map pivot_column_index; + google::sparse_hash_map pivot_column_index; compute_pairs( columns_to_reduce, @@ -1222,8 +1222,8 @@ int main( int argc, char** argv ) { #endif - std::unordered_map pivot_column_index; - pivot_column_index.reserve(columns_to_reduce.size()); + google::sparse_hash_map pivot_column_index; + pivot_column_index.resize(columns_to_reduce.size()); compute_pairs( columns_to_reduce, @@ -1259,7 +1259,7 @@ int main( int argc, char** argv ) { rips_filtration_comparator comp(dist, dim + 1, binomial_coeff); std::unordered_map pivot_column_index; - pivot_column_index.reserve(columns_to_reduce.size()); + pivot_column_index.resize(columns_to_reduce.size()); compute_pairs( columns_to_reduce, -- cgit v1.2.3