Currently, uniform sampling does a linear search in each dimension (xyz) to locate which mesh boundaries a sampled point is within. This can be sped up using a binary search implemented in source.F90.
Just to note an observation, the linear search method, assuming the number of indices in each dimension is roughly equal, is O(3·n^(1/3)), where n is the number of voxels. The binary search method will be O(3·log(n^(1/3))). (The 3· is typically ignored of course...) This improvement will be much smaller than the O(n) to O(1) result of implementing alias sampling.
This has been implemented. I used the binary search code that is used elsewhere in MCNP. All tests get the same/expected results. I have not however done any timing testing.
Currently, uniform sampling does a linear search in each dimension (xyz) to locate which mesh boundaries a sampled point is within. This can be sped up using a binary search implemented in
source.F90
.Just to note an observation, the linear search method, assuming the number of indices in each dimension is roughly equal, is O(3·n^(1/3)), where n is the number of voxels. The binary search method will be O(3·log(n^(1/3))). (The 3· is typically ignored of course...) This improvement will be much smaller than the O(n) to O(1) result of implementing alias sampling.