Changeset 137


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

added constructor taking vector

Location:
trunk/src
Files:
2 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  }
  • trunk/src/Averager.h

    r97 r137  
    55
    66#include <cmath>
     7#include "vector.h"
    78
    89namespace theplu{
     
    2526    /// Constructor taking the value of first data point.
    2627    ///
    27     Averager(double);
     28    Averager(const double);
    2829   
    2930    ///
     
    3132    /// samples.
    3233    ///
    33     Averager(double, double, long);
     34    Averager(const double, const double, const long);
     35
     36    ///
     37    /// Constructor taking gslapi::vector.
     38    ///
     39    Averager(const gslapi::vector&);
    3440   
    3541    ///
Note: See TracChangeset for help on using the changeset viewer.