diff options
| author | KunoiSayami <[email protected]> | 2023-05-29 22:45:41 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2023-05-29 22:45:41 +0800 |
| commit | d01ba96eb4ae147159f15d5f3cdb076fc60483e4 (patch) | |
| tree | 52108e4a46d268d45f6d58e3e70dcd32738c4304 /read_helper.h | |
| parent | 00543577ea9d59d1bf73837f26d16f41ef67724d (diff) | |
feat(exp): Add expt_0529
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'read_helper.h')
| -rw-r--r-- | read_helper.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/read_helper.h b/read_helper.h index eb7d2e3..2e87b0b 100644 --- a/read_helper.h +++ b/read_helper.h @@ -5,8 +5,9 @@ #include <cstdio> #include <random> #include <vector> + #ifndef P_ERR -#if !(defined(NDEBUG) || defined(READ_NO_OUTPUT)) +#ifdef PRINT_READ_PROCESS #define P_ERR(...) fprintf(stderr, __VA_ARGS__) #else #define P_ERR(...) @@ -20,6 +21,16 @@ class ReadHelper { key_type max_value = std::numeric_limits<key_type>::min(), min_value = std::numeric_limits<key_type>::max(); + inline void store_into_vector(key_type value) { + if (max_value < value) { + max_value = value; + } + if (min_value > value) { + min_value = value; + } + population_vector.push_back(value); + } + char const *filename; static constexpr size_t REVERSED_BLOCK = 256; @@ -35,16 +46,6 @@ public: key_type minValue() const { return min_value; } std::vector<key_type> population_vector; - inline void store_into_vector(key_type value) { - if (max_value < value) { - max_value = value; - } - if (min_value > value) { - min_value = value; - } - population_vector.push_back(value); - } - void finish_read() { this->population_vector.push_back(this->max_value); this->population_vector.push_back(this->min_value); |
