00001 
00002 #ifndef AUTOCORR_H
00003 #define AUTOCORR_H
00004 
00005 #include <vector>
00006 
00037 class autocorr 
00038 {
00039 private:
00040   autocorr( const autocorr &rhs );
00041   
00042   const double limit_;
00043   
00044   const size_t numPoints_;
00045 
00046 public:
00047 
00051   class acorrInfo 
00052   {
00053   private:
00054     acorrInfo(const acorrInfo &rhs );
00055     std::vector<double> points_;
00057     double slope_;
00058     double slopeErr_;
00059   public:
00060     acorrInfo() { slope_ = 0; }
00061     ~acorrInfo() {}
00062 
00063     double slope() { return slope_; }
00064     void slope( double s ) { slope_ = s; }
00065 
00066     double slopeErr() { return slopeErr_; }
00067     void slopeErr( double sE ) { slopeErr_ = sE; }
00068 
00069     std::vector<double> &points() { return points_; }
00070   }; 
00071 
00072 private:
00073   void acorrSlope( acorrInfo &info );
00074 
00075 public:
00076   autocorr( double lim = 0.01, size_t numPts = 32 ) : limit_(lim), 
00077                                                       numPoints_(numPts) {}
00078   ~autocorr() {}
00079 
00080   
00081   void ACF( const double *v, const size_t N, acorrInfo &info );
00082 }; 
00083 
00084 #endif