VF_meanwW | VD_meanwW | VE_meanwW |
VCF_meanwW | VCD_meanwW | VCE_meanwW |
|
Function | Mean with weights |
|
Syntax C/C++ | #include <VFstd.h>
float VF_meanwW( fVector X, fVector Wt, ui size );
(similarly VD_, VE_)
fComplex VCF_meanwW( cfVector X, fVector Wt, ui size );
(similarly VCD_, VCE_) |
C++ VecObj | #include <OptiVec.h>
T vector<T>::meanwW( const vector<T>& Wt );
fComplex vector<complex<T>>::meanwW( const vector<T>& Wt ); |
Pascal/Delphi | uses VFstd;
function VF_meanwW( X, Wt:fVector; size:UIntSize ): Single;
(similarly VD_, VE_)
function VCF_meanwW( X:cfVector; Wt:fVector; size:UIntSize ):fComplex;
Alternative syntax (obsolete, but still supported):
procedure VCF_meanwW( var Mean:fComplex; X:cfVector; Wt:fVector; size:UIntSize );
(similarly VCD_, VCE_) |
|
CUDA function C/C++ | #include <cudaVFstd.h>
int cudaVF_meanwW( float *h_RetVal, fVector d_X, fVector d_Wt, ui size );
int cusdVF_meanwW( float *d_RetVal, fVector d_X, fVector d_Wt, ui size );
float VFcu_meanwW( fVector h_X, fVector h_Wt, ui size );
|
CUDA function Pascal/Delphi | uses VFstd;
function cudaVF_meanwW( var h_RetVal:Single; d_X, d_Wt:fVector; size:UIntSize ): IntBool;
function cusdVF_meanwW( d_RetVal:PSingle; d_X, d_Wt:fVector; size:UIntSize ): IntBool;
function VFcu_meanwW( h_X, h_Wt:fVector; size:UIntSize ): Single;
|
|
Description | meanwW = (1 / sum( Wti )) * sum( Xi * Wti )
Notice that, also in the complex version, the weights are always real rather than complex. |
|
|
Return value | weighted mean of the vector elements (except complex versions in Pascal/Delphi). |
|
|