I said there was some room for improvement because I thought the last 20 seconds or so of the algorithm could be optimized away. However, math developer Bobby informed me that those last few dance steps are necessary to make sure that the right thing happens when the input contains NaNs. (Thanks also to Bobby for providing the title of today's post.)
(Once when sorting out the mess in the office I compared merge-sort and quick-sort, and found quick-sort to be a funnier way to get the papers in alphabetical order.)
Great stuff…hard to stop watching, even when you know where it’s going! :)
About
Steve Eddins is a software development manager in the MATLAB and image processing areas at MathWorks. Steve coauthored Digital Image Processing Using MATLAB. He writes here about image processing concepts, algorithm implementations, and MATLAB.
Brilliant!
…and there is a merge-sort too!
(Once when sorting out the mess in the office I compared merge-sort and quick-sort, and found quick-sort to be a funnier way to get the papers in alphabetical order.)
That last bit is a much needed set of cache coherency steps.
Great stuff…hard to stop watching, even when you know where it’s going! :)