| 212 | } |
| 213 | |
| 214 | std::vector<float> heun_combine_velocity( |
| 215 | const std::vector<float> & velocity_first, |
| 216 | const std::vector<float> & velocity_second) { |
| 217 | require_same_size(velocity_first.size(), velocity_second.size(), "Heun velocity size mismatch"); |
| 218 | std::vector<float> out(velocity_first.size(), 0.0F); |
| 219 | for (size_t i = 0; i < velocity_first.size(); ++i) { |
| 220 | out[i] = 0.5F * (velocity_first[i] + velocity_second[i]); |
| 221 | } |
| 222 | return out; |
| 223 | } |
| 224 | |
| 225 | std::vector<float> heun_step( |
| 226 | const std::vector<float> & x_before, |