#ifndef UTIL_H #define UTIL_H #include // fprintf() #include // exit() #define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b)) #define UNUSED(a) ((void) (a)) #define D(...) do { \ fprintf(stderr, "DEBUG: %s(): ", __func__); \ fprintf(stderr, __VA_ARGS__); \ fputs("\n", stderr); \ } while (0) #define die(...) do { \ fputs("FATAL: ", stderr); \ fprintf(stderr, __VA_ARGS__); \ fputs("\n", stderr); \ exit(EXIT_FAILURE); \ } while (0) static inline float km_score( const float mean_distance, const size_t num_empty ) { return 1.0 / (mean_distance + num_empty); } #endif /* UTIL_H */