3 ms·
The function is trying to get the median, which is not defined for an empty set. With this particular implementation, there is an assert for that: https://gith
by account42 5y ago
The function is trying to get the median, which is not defined for an empty set. With this particular implementation, there is an assert for that:
https://github.com/shogun-toolbox/shogun/blob/9b8d85/src/shogun/mathematics/linalg/LinalgNamespace.h#L1816 https://github.com/shogun-toolbox/shogun/blob/9b8d85/src/sho...
Unrelated, but from the same section:
> Fixes are trivial, access the nth element only after the call being made. Be careful.
Wouldn't the proper fix to do the nth_element for the larget element first (for those cases that don't do that already) and then adjust the end to be the begin + larger_n for the second nth_element call? Otherwise the second call will check [begin + larger_n, end) again for no reason at all.