|
22 | 22 | #include <vector> |
23 | 23 |
|
24 | 24 | #include "absl/base/log_severity.h" |
| 25 | +#include "absl/hash/hash.h" |
25 | 26 | #include "absl/numeric/int128.h" |
26 | 27 | #include "absl/random/distributions.h" |
27 | 28 | #include "absl/random/random.h" |
28 | 29 | #include "absl/strings/str_format.h" |
| 30 | +#include "absl/strings/string_view.h" |
29 | 31 | #include "absl/time/clock.h" |
30 | 32 | #include "absl/time/time.h" |
31 | 33 | #include "benchmark/benchmark.h" |
32 | 34 | #include "gtest/gtest.h" |
33 | 35 | #include "ortools/base/gmock.h" |
34 | | -#include "ortools/base/hash.h" |
35 | 36 |
|
36 | 37 | namespace operations_research { |
37 | 38 |
|
@@ -259,12 +260,8 @@ TEST(BinarySearchTest, NonMonoticPredicateReachesLocalInflexionPoint_Double) { |
259 | 260 | const int kNumAttempts = 100000; |
260 | 261 | for (int attempt = 0; attempt < kNumAttempts; ++attempt) { |
261 | 262 | const uint64_t hash_seed = random(); |
262 | | - std::function<bool(double)> non_monotonic_predicate = |
263 | | - [hash_seed](double x) { |
264 | | - return fasthash64(reinterpret_cast<const char*>(&x), sizeof(x), |
265 | | - hash_seed) & |
266 | | - 1; |
267 | | - }; |
| 263 | + const std::function<bool(double)> non_monotonic_predicate = |
| 264 | + [hash_seed](double x) { return absl::HashOf(x, hash_seed) & 1; }; |
268 | 265 | // Pick a random [x_true, x_false] interval which verifies f(x_true) = true |
269 | 266 | // and f(x_false) = false. |
270 | 267 | double x_true, x_false; |
|
0 commit comments