Utils
Class BasicHist

java.lang.Object
  extended by Utils.BasicHist

public class BasicHist
extends java.lang.Object

A simple histogram class to count the frequency of values of a parameter of interest.

Author:
Ioannis Kakavas, Spyridon Dossis

Field Summary
(package private)  int[] bins
           
(package private)  double hi
           
(package private)  double lo
           
(package private)  int numBins
           
(package private)  double range
           
 
Constructor Summary
BasicHist(int numBins, double lo, double hi)
          The constructor will create an array of a given number of bins.
 
Method Summary
 void add(double x)
          Takes the value x as input and places it in the according bin
 void clear()
          Clear the histogram bins.
 int getValue(int bin)
          Provides access to the bins
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bins

int[] bins

numBins

int numBins

lo

double lo

hi

double hi

range

double range
Constructor Detail

BasicHist

public BasicHist(int numBins,
                 double lo,
                 double hi)
The constructor will create an array of a given number of bins. The range of the histogram given by the upper and lower limit values.

Parameters:
numBins - Number of bins for the histogram
lo - The lower limit of the histogram
hi - The upper limit of the histogram
Method Detail

add

public void add(double x)
Takes the value x as input and places it in the according bin

Parameters:
x -

clear

public void clear()
Clear the histogram bins.


getValue

public int getValue(int bin)
Provides access to the bins

Parameters:
bin - the index of the bin that is queried
Returns:
the number of samples in the specific bin