diff --git a/cwVectOps.h b/cwVectOps.h index a5e402c..ba60842 100644 --- a/cwVectOps.h +++ b/cwVectOps.h @@ -342,6 +342,23 @@ namespace cw return sum(v,n)/n; } + + template< typename T > + double std( const T* v, unsigned n ) + { + if( n < 2 ) + return 0; + + double u = mean(v,n); + double dsum = 0; + for(unsigned i=0; i