sfstoolbox / sfs-matlab

SFS Toolbox for Matlab/Octave
https://sfs-matlab.readthedocs.io
MIT License
98 stars 39 forks source link

fix recursive call of selection function and remove time consuming vector product #51

Closed fietew closed 8 years ago

fietew commented 8 years ago

For some applications, e.g. local WFS, the secondary source selection is very slow. This is due to the recursive calls of secondary_source_selection and the usage of the - imho not necessary - function vector_product. Furthermore xs does not need to be replicated to perform x0-xs.

hagenw commented 8 years ago

Cool, I was not aware that it is possible to achieve it with something like nk(:).

I have tested it with running

>> test_driving_functions(1)

and the output seems to be fine. It would be nice if we could have a better way of testing, if such changes gave exactly the correct results. Do you have an idea, how to write a good test routine for this?

fietew commented 8 years ago

We could create a new testing function which checks the secondary source selection criterion by hand.