VF_selected_meanVD_selected_meanVE_selected_mean
FunctionMean of the elements of a one-dimensional distribution, falling into a specified interval
Syntax C/C++#include <VFstd.h>
float VF_selected_mean( ui *nsel, fVector X, ui size, float XMin, float XMax );
C++ VecObj#include <OptiVec.h>
T vector<T>::selected_mean( ui *nsel, T XMin, T XMax );
Pascal/Delphiuses VFstd;
function VF_selected_mean( var nsel:UIntSize; X:fVector; size:UIntSize; XMin, XMax:Single ): Single;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_selected_mean( ui *h_nsel, fVector d_X, ui size, float XMin, float XMax );
int cusdVF_selected_mean( ui *h_nsel, fVector d_X, ui size, float *d_XMin, float *d_XMax );
float VFcu_selected_mean( ui *h_nsel, fVector h_X, ui size, float XMin, float XMax );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_selected_mean( var h_RetVal:Single; var h_nsel:UIntSize; d_X:fVector; size:UIntSize; XMin, XMax:Single ):: IntBool;
function cusdVF_selected_mean( d_RetVal:PSingle; var h_nsel:UIntSize; d_X:fVector; size:UIntSize; d_XMin, d_XMax:PSingle ):: IntBool;
function VFcu_selected_mean( var h_nsel:UIntSize; h_X:fVector; size:UIntSize; XMin, XMax:Single ): Single;
DescriptionThose elements of X are selected, which fall into the interval XMin ≤ Xi ≤ XMax.
Their mean is calculated, and the number of selected elements is stored at the address nsel. If this number is not needed, nsel may be passed to the function as NULL (C/C++) or nil (Pascal/Delphi).
Error handlingIf no element falls into the specified range, nsel = 0 and the return value is (XMax+XMin)/2. If *nsel was given as NULL / nil, so that it cannot be set to zero, a warning message will be generated in that case.
Return valueMean of the selected vector elements
See alsoVF_mean

VectorLib Table of Contents  OptiVec home