MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / partials

Function partials

examples/pde/bhrt.cpp:565–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565af::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

Callers 1

geodesicsFunction · 0.85

Calls 5

moddimsFunction · 0.85
metric4Function · 0.85
arrayClass · 0.50
dim4Class · 0.50
dimsMethod · 0.45

Tested by

no test coverage detected