Slightly faster SH basis implementation. #1
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I eliminated some unnecessary sine and cosine calculations, resulting in a slight speed gain.
Using iFOD2 on a software phantom, the current master branch gets me:
gtime tckgen csd/fod10.mif -mask mask.mif -number 100000 -seed_image mask.mif csd/test.tck -force
tckgen [WARNING]: existing output files will be overwritten
103565 generated, 100000 selected [100%]
843.04user 1.89system 3:44.91elapsed 375%CPU (0avgtext+0avgdata 263208960maxresident)k
0inputs+22outputs (32major+16220minor)pagefaults 0swaps
whereas with this commit, I get:
gtime tckgen csd/fod10.mif -mask mask.mif -number 100000 -seed_image mask.mif csd/test.tck -force
tckgen [WARNING]: existing output files will be overwritten
103592 generated, 100000 selected [100%]
800.80user 2.91system 3:27.70elapsed 386%CPU (0avgtext+0avgdata 263012352maxresident)k
3inputs+22outputs (193major+16043minor)pagefaults 0swaps