Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

histogram::bin_vec Class Reference

An array of histogram bins. More...

#include <histogram.h>

List of all members.

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_binbins


Detailed Description

An array of histogram 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.


Constructor & Destructor Documentation

histogram::bin_vec::bin_vec ( const bin_vec & rhs ) [private]
 

histogram::bin_vec::bin_vec ( size_t N ) [inline]
 

Definition at line 148 of file histogram.h.

00148                         : num_bins( N )
00149     {
00150       bins = new histo_bin[ num_bins ];
00151     }

histogram::bin_vec::~bin_vec ( ) [inline]
 

Definition at line 153 of file histogram.h.

00154     {
00155       delete [] bins;
00156     }


Member Function Documentation

void histogram::bin_vec::end ( const size_t i,
const double val ) [inline]
 

Definition at line 178 of file histogram.h.

00179     {
00180       assert( i < num_bins );
00181       bins[i].end( val );
00182     }

double histogram::bin_vec::end ( const size_t i ) [inline]
 

Definition at line 172 of file histogram.h.

00173     { 
00174       assert( i < num_bins );
00175       return bins[i].end(); 
00176     }

size_t histogram::bin_vec::length ( ) [inline]
 

Definition at line 158 of file histogram.h.

00158 { return num_bins; }

double histogram::bin_vec::operator[] ( const size_t i ) const [inline]
 

RHS [] operator.

Definition at line 193 of file histogram.h.

00194     {
00195       assert( i < num_bins );
00196       return bins[i].frequency();
00197     }

double & histogram::bin_vec::operator[] ( const size_t i ) [inline]
 

LHS [] operator.

Definition at line 185 of file histogram.h.

00186     {
00187       assert( i < num_bins );
00188       
00189       return bins[i].freqPtr();
00190     }

void histogram::bin_vec::start ( const size_t i,
const double val ) [inline]
 

Definition at line 166 of file histogram.h.

00167     {
00168       assert( i < num_bins );
00169       bins[i].start( val );
00170     }

double histogram::bin_vec::start ( const size_t i ) [inline]
 

Definition at line 160 of file histogram.h.

00161     { 
00162       assert( i < num_bins );
00163       return bins[i].start(); 
00164     }


Member Data Documentation

histo_bin * histogram::bin_vec::bins [private]
 

Definition at line 145 of file histogram.h.

const size_t histogram::bin_vec::num_bins [private]
 

Definition at line 144 of file histogram.h.


The documentation for this class was generated from the following file:
Generated at Wed May 21 21:19:27 2003 for Basic Statistics Functions by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001