SCPPNT::Mean< T > Class Template Reference

Compute the mean of a sequence of values. More...

#include <statfunc.h>

List of all members.

Public Member Functions

template<class I>
operator() (Subscript nelem, I begin)
 Compute sample mean from data pointed to by begin.


Detailed Description

template<class T>
class SCPPNT::Mean< T >

Compute the mean of a sequence of values.

Parameters:
T A floating point type.

Definition at line 121 of file statfunc.h.


Member Function Documentation

template<class T>
template<class I>
T SCPPNT::Mean< T >::operator() ( Subscript  nelem,
begin 
) [inline]

Compute sample mean from data pointed to by begin.

Parameters:
I An iterator type pointing to values for which the mean is computed.
nelem Number of values used to compute mean.
begin Iterator to values used to compute mean.

Definition at line 134 of file statfunc.h.

00135     {
00136       T n = nelem;
00137       T sum = 0;
00138 
00139       while (nelem--)
00140       {
00141         sum += *begin;
00142         ++begin;
00143       }
00144 
00145       return sum / n;
00146     }


The documentation for this class was generated from the following file:
Generated on Tue Dec 18 23:34:48 2007 for SCPPNT by  doxygen 1.5.4