#include <Histogram.h>
Public Member Functions | |
CHistogram (const double First, const double Interval, const int nPoints) | |
~CHistogram () | |
void | Update (const double Val) |
void | Print (ofstream *out, const char *Str) |
Private Attributes | |
int | m_n |
unsigned int * | m_Vector |
double | m_First |
double | m_Interval |
Definition at line 28 of file Histogram.h.
CHistogram::CHistogram | ( | const double | First, | |
const double | Interval, | |||
const int | nPoints | |||
) |
Definition at line 35 of file Histogram.cpp.
00038 { 00039 m_n = nPoints; 00040 m_First = First; 00041 m_Interval = Interval; 00042 m_Vector = new unsigned int[nPoints]; 00043 for(int i=0; i<nPoints; i++) 00044 { 00045 m_Vector[i] = 0; 00046 } 00047 }
CHistogram::~CHistogram | ( | ) |
Definition at line 50 of file Histogram.cpp.
00051 { 00052 delete[] m_Vector; 00053 }
void CHistogram::Print | ( | ofstream * | out, | |
const char * | Str | |||
) |
Definition at line 72 of file Histogram.cpp.
00073 { 00074 if(Str != 0) 00075 *out << Str; 00076 00077 *out << m_n << endl; 00078 for(int i=0; i<m_n; i++) 00079 { 00080 if(Str != 0) 00081 *out << Str; 00082 *out << m_First + i * m_Interval << " " << m_Vector[i] << endl; 00083 } 00084 00085 }
void CHistogram::Update | ( | const double | Val | ) |
Definition at line 56 of file Histogram.cpp.
double CHistogram::m_First [private] |
Definition at line 38 of file Histogram.h.
double CHistogram::m_Interval [private] |
Definition at line 39 of file Histogram.h.
int CHistogram::m_n [private] |
Definition at line 36 of file Histogram.h.
unsigned int* CHistogram::m_Vector [private] |
Definition at line 37 of file Histogram.h.