#include <histogram.h>
Public Methods | |
| bin_vec (size_t N) | |
| ~bin_vec () | |
| size_t | length () |
| double | start (const size_t i) |
| void | start (const size_t i, const double val) |
| double | end (const size_t i) |
| void | end (const size_t i, const double val) |
| double& | operator[] (const size_t i) |
| LHS [] operator. More... | |
| double | operator[] (const size_t i) const |
| RHS [] operator. More... | |
Private Methods | |
| bin_vec (const bin_vec &rhs) | |
Private Attributes | |
| const size_t | num_bins |
| histo_bin* | bins |
This class overloads the array index operator[]. For an instance of bin_vec named binz, binz[i] will return the frequency value at index i.
The class constructor is passed a value for the number of bin_vec elements. It dynamically allocates an internal array.
The class destructor deallocates the internal array.
The start and end values for a given bin are referenced via the start and end functions.
Definition at line 140 of file histogram.h.
|
|
|
|
|
Definition at line 148 of file histogram.h. 00148 : num_bins( N ) 00149 { 00150 bins = new histo_bin[ num_bins ]; 00151 } |
|
|
Definition at line 153 of file histogram.h. 00154 {
00155 delete [] bins;
00156 }
|
|
|
Definition at line 178 of file histogram.h. 00179 {
00180 assert( i < num_bins );
00181 bins[i].end( val );
00182 }
|
|
|
Definition at line 172 of file histogram.h. 00173 {
00174 assert( i < num_bins );
00175 return bins[i].end();
00176 }
|
|
|
Definition at line 158 of file histogram.h. 00158 { return num_bins; }
|
|
|
RHS [] operator.
Definition at line 193 of file histogram.h. 00194 {
00195 assert( i < num_bins );
00196 return bins[i].frequency();
00197 }
|
|
|
LHS [] operator.
Definition at line 185 of file histogram.h. 00186 {
00187 assert( i < num_bins );
00188
00189 return bins[i].freqPtr();
00190 }
|
|
|
Definition at line 166 of file histogram.h. 00167 {
00168 assert( i < num_bins );
00169 bins[i].start( val );
00170 }
|
|
|
Definition at line 160 of file histogram.h. 00161 {
00162 assert( i < num_bins );
00163 return bins[i].start();
00164 }
|
|
|
Definition at line 145 of file histogram.h. |
|
|
Definition at line 144 of file histogram.h. |
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001