FunctionMedian of a one-dimensional distribution
Syntax C/C++#include <VFmath.h>
float VF_median( fVector X, ui size );
C++ VecObj#include <OptiVec.h>
T vector<T>::median();
Pascal/Delphiuses VFmath;
function VF_median( X:fVector; size:UIntSize ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_median( float *h_RetVal, fVector d_X, ui size );
int cusdVF_median( float *d_RetVal, fVector d_X, ui size );
float VFcu_median( fVector h_X, ui size );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_median( var h_RetVal:Single; d_X:fVector; size:UIntSize ): IntBool;
function cusdVF_median( d_RetVal:PSingle; d_X:fVector; size:UIntSize ): IntBool;
function VFcu_median( h_X:fVector; size:UIntSize ): Single;
DescriptionThe median of a distribution is defined as the value for which values above and below are equally probable, i.e., for which the number of elements greater and less than the median is equal. If the table X is ordered, the median is simply the element with the index (size+1)/2 (if size is odd) or the mean of the two central elements (if size is even). If a table is not ordered, VF_median finds its median by repeatedly scanning the table through, without actually sorting it.
Error handlingnone
Return valueThe median is returned.
See alsoVF_mean,   VF_meanwW,   VF_sum

VectorLib Table of Contents  OptiVec home