The cpp version did not pass the basic spherical tests. This PR fixes this. All tests (both cpp and Cythonized) provided in the test files below pass. If you haven't been tracking my recent changes, it may be easier to read the entire file without diffs.
changes
Change tStep to a signed type, since it can be negative.
Add constants ABS_EPSILON, REL_EPSILON.
Copied a few test cases from #89 with corrected voxels.
Add function KnLessThan(), which ensures a *is strictly less than* b.
Instead of checking the conditionals
t *strictly less than* tMax && tMax *strictly less than* t_end
in the while loop, I've added these to the corresponding functions radialHit(), angularHit(), azimuthalHit().
Update generalizedPlaneHit() to use strictlyLessThan for comparisons with a, b.
Update tests in Cythonized code.
Rid code of C++11 compiler warnings.
Code cleanup, other small changes such as starting enums from 0.
bug fixes
Fix bug in angularHit(): It used numRadialVoxels() instead of numAngularVoxels().
Fix bug in radialHit(): From the MATLAB algorithm, I assumed that the vector time was always used; this is not the case. Both time and time_array are used in the statements that follow. I've re-named these to intersection_times and times_gt_t to be more clear about their roles.
Correctly update voxel boundary segments to use length in the plane rather than 3-dimensional length.
The cpp version did not pass the basic spherical tests. This PR fixes this. All tests (both cpp and Cythonized) provided in the test files below pass. If you haven't been tracking my recent changes, it may be easier to read the entire file without diffs.
changes
a *is strictly less than* b
.in the while loop, I've added these to the corresponding functions radialHit(), angularHit(), azimuthalHit().
bug fixes
time
was always used; this is not the case. Bothtime
andtime_array
are used in the statements that follow. I've re-named these tointersection_times
andtimes_gt_t
to be more clear about their roles.