Changeset 137 for trunk/src/Averager.cc


Ignore:
Timestamp:
Aug 19, 2004, 11:36:44 AM (17 years ago)
Author:
Peter
Message:

added constructor taking vector

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Averager.cc

    r97 r137  
    11// $Id$
    22
     3#include "Averager.h"
     4
    35#include <sys/types.h>
     6#include <ostream>
     7#include "vector.h"
    48
    5 #include <ostream>
    6 
    7 #include "Averager.h"
    89
    910namespace theplu {
     
    1617  }
    1718
    18   Averager::Averager(double x)
     19  Averager::Averager(const double x)
    1920    : n_(1), x_(x), xx_(x*x)
    2021  {
    2122  }
    2223
    23   Averager::Averager(double x,double xx,long n)
     24  Averager::Averager(const double x,const double xx,const long n)
    2425    : n_(n), x_(x), xx_(xx)
     26  {
     27  }
     28
     29  Averager::Averager(const gslapi::vector& vec)
     30    :n_(vec.size()), x_(vec.sum()), xx_(vec*vec)
    2531  {
    2632  }
Note: See TracChangeset for help on using the changeset viewer.