24 static T
common1(T t, T xr, T yr, T dxr, T dyr, T a, T b);
25 static T
common2(T t, T xr, T yr, T dxr, T dyr, T a, T b);
26 static T
gp(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c);
27 static T
gh(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c);
28 static T
ge(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c);
29 static T
gpl(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c);
31 static std::array<T, 3>
np(T xr, T yr, T zr,
int flip, T a, T b, T c);
32 static std::array<T, 3>
nh(T xr, T yr, T zr,
int flip, T a, T b, T c);
33 static std::array<T, 3>
ne(T xr, T yr, T zr,
int flip, T a, T b, T c);
34 static std::array<T, 3>
npl(T xr, T yr, T zr,
int flip, T a, T b, T c);
55 return (xr + t*dxr)*(xr + t*dxr)/(a*a) + (yr + t*dyr)*(yr + t*dyr)/(b*b);
76 return (xr + t*dxr)*2*dxr/(a*a) + (yr + t*dyr)*2*dyr/(b*b);
97inline T
RTRefls<T>::gp(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c)
121inline T
RTRefls<T>::gh(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c)
123 return t - (zr + t*dzr - c*sqrt(
RTRefls::common1(t, xr, yr, dxr, dyr, a, b) + 1)) /
146inline T
RTRefls<T>::ge(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c)
148 return t - (zr + t*dzr - c*sqrt(1 -
RTRefls::common1(t, xr, yr, dxr, dyr, a, b))) /
173 return t - (zr + t*dzr) / dzr;
193 std::array<T, 3> out;
195 out[0] = -2 * xr / (a*a) * flip;
196 out[1] = -2 * yr / (b*b) * flip;
199 T norm = sqrt(out[0]*out[0] + out[1]*out[1] + out[2]*out[2]);
201 out[0] = out[0] / norm;
202 out[1] = out[1] / norm;
203 out[2] = out[2] / norm;
225 std::array<T, 3> out;
227 out[0] = -2 * xr / (a*a) * flip;
228 out[1] = -2 * yr / (b*b) * flip;
229 out[2] = 2 * zr / (c*c) * flip;
231 T norm = sqrt(out[0]*out[0] + out[1]*out[1] + out[2]*out[2]);
233 out[0] = out[0] / norm;
234 out[1] = out[1] / norm;
235 out[2] = out[2] / norm;
257 std::array<T, 3> out;
259 out[0] = 2 * xr / (a*a) * flip;
260 out[1] = 2 * yr / (b*b) * flip;
261 out[2] = 2 * zr / (c*c) * flip;
263 T norm = sqrt(out[0]*out[0] + out[1]*out[1] + out[2]*out[2]);
265 out[0] = out[0] / norm;
266 out[1] = out[1] / norm;
267 out[2] = out[2] / norm;
290 std::array<T, 3> out;
Linear algebra functions for the CPU version of PyPO.
static std::array< T, 3 > npl(T xr, T yr, T zr, int flip, T a, T b, T c)
Definition RTRefls.h:288
static T gp(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c)
Definition RTRefls.h:97
static T ge(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c)
Definition RTRefls.h:146
static std::array< T, 3 > ne(T xr, T yr, T zr, int flip, T a, T b, T c)
Definition RTRefls.h:255
static T gh(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c)
Definition RTRefls.h:121
static T common1(T t, T xr, T yr, T dxr, T dyr, T a, T b)
Definition RTRefls.h:53
static std::array< T, 3 > np(T xr, T yr, T zr, int flip, T a, T b, T c)
Definition RTRefls.h:191
static std::array< T, 3 > nh(T xr, T yr, T zr, int flip, T a, T b, T c)
Definition RTRefls.h:223
static T common2(T t, T xr, T yr, T dxr, T dyr, T a, T b)
Definition RTRefls.h:74
static T gpl(T t, T xr, T yr, T zr, T dxr, T dyr, T dzr, T a, T b, T c)
Definition RTRefls.h:171