Class GaussianWidthFinder

java.lang.Object
  |
  +--GaussianWidthFinder

class GaussianWidthFinder
extends java.lang.Object

This class will measure the width of a gaussian. The supplied data will first be searched for a maximum, then bisection will be used to find the two "half-height" points. The distance between these two points will be taken to be the width of the gaussian.

No attempt will be made to determine whether the data actually follows a gaussian distribution. If the data contains more than one "turning" point, the results are undefined.


Field Summary
protected  double[] data
          Local copy of the gaussian data
 
Constructor Summary
GaussianWidthFinder(double[] data)
          Creates a new GaussianWidthFinder, to operate on the specified array of values.
 
Method Summary
protected  int bisect(int left, int right, double target)
          Searches the specified interval for a value.
protected  int getMaxIndex()
          Searches for the index of the largest value
 int getWidth()
           
 int getWidth(int centre, int rightMost)
          Returns the width of the gaussian, assuming the centre is known.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

data

protected double[] data
Local copy of the gaussian data
Constructor Detail

GaussianWidthFinder

public GaussianWidthFinder(double[] data)
Creates a new GaussianWidthFinder, to operate on the specified array of values.
Method Detail

getWidth

public int getWidth(int centre,
                    int rightMost)
Returns the width of the gaussian, assuming the centre is known.
Parameters:
centre - The centre of the gaussian
rightmost - The highest index for which data[] contains valid data.
Returns:
The width of the guassian, measured in array storage locations

getWidth

public int getWidth()
Returns:
The width of the guassian, measured in array storage locations

getMaxIndex

protected int getMaxIndex()
Searches for the index of the largest value

bisect

protected int bisect(int left,
                     int right,
                     double target)
Searches the specified interval for a value.
Parameters:
left - The index corresponding to the minimum bound
right - The index corresponding to the maximum bound
target - The value to search for