VF_selected_mean | VD_selected_mean | VE_selected_mean |
|
Function | Mean 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/Delphi | uses 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/Delphi | uses 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;
|
|
Description | Those 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 handling | If 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 value | Mean of the selected vector elements |
|
|