|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarytts.util.math.Histogram
public class Histogram
| Constructor Summary | |
|---|---|
Histogram(double[] data)
|
|
Histogram(double[] data,
int nbins)
A simple constructor |
|
Histogram(double[] data,
int nbins,
double min,
double max)
Constructor which sets name, number of bins, and range. |
|
| Method Summary | |
|---|---|
void |
changeSettings(int nbins)
|
int |
entries()
Get number of entries in the histogram. |
void |
fill(double x)
Enter data into the histogram. |
double |
getBandWidth()
|
double[] |
getDataArray()
|
boolean |
getDebug()
Get debug flag. |
double[] |
getHistArray()
This method gives you the bin contents in the form of an array. |
double[] |
getSampleArray()
|
double |
max()
Get upper end of histogram range |
double |
mean()
|
double |
min()
Get lower end of histogram range |
java.lang.String |
name()
Get the name of the histogram. |
int |
numberOfBins()
Get the number of bins in the histogram. |
double |
overflow()
Get the height of the overflow bin. |
void |
setBandWidth()
|
void |
setDebug(boolean flag)
Set debug flag. |
void |
setHistogram(double[] data,
int nbins,
double min,
double max)
Settings to Histogram |
double[] |
setSampleArray()
|
void |
show()
Print the histogram data to the console. |
double |
stdDev()
|
double |
underflow()
Get the height of the underflow bin. |
double |
variance()
|
void |
writeToFile(java.lang.String fileName)
Save the histogram data to a file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Histogram(double[] data)
public Histogram(double[] data,
int nbins)
data - nbins -
public Histogram(double[] data,
int nbins,
double min,
double max)
data - samplesnbins - the number of bins the histogram should have. The
range specified by min and max will be divided up into this
many bins.min - the minimum of the range covered by the histogram binsmax - the maximum value of the range covered by the histogram bins| Method Detail |
|---|
public void setHistogram(double[] data,
int nbins,
double min,
double max)
data - nbins - min - max - public void changeSettings(int nbins)
public void fill(double x)
x - is the value to add in to the histogrampublic void setBandWidth()
public double getBandWidth()
public void writeToFile(java.lang.String fileName)
throws java.io.IOException
fileName - name of the file to write the histogram to.
Note this must be valid for your operating system,
e.g. a unix filename might not work under windows
java.io.IOException - if file cannot be opened or written to.public void show()
public double[] setSampleArray()
public int entries()
public java.lang.String name()
public int numberOfBins()
public double min()
public double mean()
public double variance()
public double stdDev()
public double max()
public double overflow()
public double underflow()
public double[] getHistArray()
public double[] getSampleArray()
public double[] getDataArray()
public void setDebug(boolean flag)
flag - debug flag (true or false)public boolean getDebug()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||