| 563 | } |
| 564 | |
| 565 | af::array partials(const af::array& pos4, uint32_t index, double rel_diff, |
| 566 | double abs_diff) { |
| 567 | double arr[4] = {0.0}; |
| 568 | arr[index] = 1.0; |
| 569 | |
| 570 | auto pos_diff = pos4 * rel_diff + abs_diff; |
| 571 | auto h4 = pos_diff * af::array(af::dim4(4, 1), arr); |
| 572 | af::array h = |
| 573 | af::moddims(pos_diff(index, af::span), af::dim4(1, 1, pos4.dims()[1])); |
| 574 | |
| 575 | return (-metric4(pos4 + h4 * 2.0) + metric4(pos4 + h4) * 8.0 - |
| 576 | metric4(pos4 - h4) * 8.0 + metric4(pos4 - h4 * 2.0)) / |
| 577 | (h * 12.0); |
| 578 | } |
| 579 | |
| 580 | /** |
| 581 | * @brief Computes the geodesics from the established metric, 4-vector positions |