teuben / nemo

a Stellar Dynamics Toolbox (Not Everybody Must Observe)
https://astronemo.readthedocs.io
GNU General Public License v2.0
57 stars 42 forks source link

various inefficient median routines #38

Closed teuben closed 3 years ago

teuben commented 3 years ago

median.c is only defining a pointer based index sorting, (sortptr) which can be very slow. turns out that median() is quite fast if a pre-sorted array is used. this median -> pmedian (old one) and smedian( new one, assumes arrays were pre-sorted, e.g. with qsort()

programs which need to be refactored for this: tabhist tabstat ccdstat (speedup is quite large for median=t)

and the library modules median moment

need some patches.

teuben commented 3 years ago

listed routines have been committed. ready to close item?