Skip to content

Commit

Permalink
add generic print_map function for debuggin
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwb committed Oct 21, 2024
1 parent dc1cf7d commit f48b92a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <iostream>
#include <sstream>
#include <algorithm>
#include <map>

#include "superdouble.h"

Expand Down Expand Up @@ -144,6 +145,14 @@ template<typename T> void print_vector (std::vector<T>& vec) {
std::cout << std::endl;
}

// this is used mostly for de-bugging
template<typename map_key, typename map_val> void print_map (const std::map<map_key, map_val>& _map) {
for (const auto& elem : _map) {
std::cout << elem.first << " => " << elem.second << std::endl;
}

}

unsigned int calc_hamming_dist (const std::string& s1, const std::string& s2);

double logn (double x, double base);
Expand Down

0 comments on commit f48b92a

Please sign in to comment.