fvec_median method

double fvec_median(
  1. Pointer<fvec_t> v
)

returns the median of a vector

The QuickSelect routine is based on the algorithm described in "Numerical recipes in C", Second Edition, Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5

This implementation of the QuickSelect routine is based on Nicolas Devillard's implementation, available at http://ndevilla.free.fr/median/median/ and in the Public Domain.

\param v vector to get median from

\return the median of v

Implementation

double fvec_median(
  ffi.Pointer<fvec_t> v,
) {
  return _fvec_median(
    v,
  );
}