Returns a weighted sum of a prior and the actual processing time.
| 452 | |
| 453 | // Returns a weighted sum of a prior and the actual processing time. |
| 454 | double weighted_processing_time(int64 num_elements, double processing_time, |
| 455 | double prior) { |
| 456 | if (num_elements < 30) { |
| 457 | double prior_weight = 1.0L / static_cast<double>(2 << num_elements); |
| 458 | return prior_weight * prior + (1.0L - prior_weight) * processing_time; |
| 459 | } else { |
| 460 | return processing_time; |
| 461 | } |
| 462 | } |
| 463 | |
| 464 | TEST(TestManyElements, Model) { |
| 465 | std::shared_ptr<Node> interleave_many = |