Ignore:
Timestamp:
Dec 13, 2005, 3:51:31 PM (17 years ago)
Author:
Markus Ringnér
Message:

Added member function to add all values in a gsl vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/statistics/Averager.h

    r427 r433  
    44#define _theplu_statistics_averager_
    55
     6#include <c++_tools/gslapi/vector.h>
     7
    68#include <cmath>
    79
    810namespace theplu{
    9 namespace gslapi{
    10   class vector;
    11 }
    1211
    1312namespace statistics{
     
    4443    ///
    4544    inline void add(const double d,const long n=1) { n_+=n; x_+=n*d; xx_+=n*d*d;}
     45
     46    ///
     47    /// Adding each value in vector \a v \a n (default=1)
     48    /// number of times.
     49    ///
     50    inline void add(const gslapi::vector& v, const long n=1)
     51    { n_+=n*v.size(); x_+=n*v.sum(); xx_+=n*(v*v);}
     52
    4653
    4754    ///
Note: See TracChangeset for help on using the changeset viewer.