util
Class Histogram

java.lang.Object
  extended by util.Histogram

public class Histogram
extends java.lang.Object

This class defines the basic colormap structure used by the various colormap control and colormap using classes in this library.


Constructor Summary
Histogram(int[] values, int d_num_bins)
          Create a histogram based on the given values, with the given number of bins.
Histogram(int[] values, int d_num_bins, int min, int max)
          Create a histogram based on the given values, with the given number of bins, using the given min and max.
 
Method Summary
 int get_bin_max()
          Get the max index for the bins.
 int get_bin_min()
          Get the min index for the bins.
 int get_bin_range()
          Get the range of the bins.
 int get_max_count()
          Get the maximum count stored in any of the bins.
 int get_num_bins()
          Get the number of bins.
 int get_num_values()
          Get the number of values stored.
 int get_value_max()
          Get the maximum of the values stored.
 double get_value_mean()
          Get the mean of the values stored.
 int get_value_min()
          Get the minimum of the values stored.
 double get_value_std()
          Get the standard deviation of the values stored.
 int[] getHistogram()
          Get the histogram of counts for the given number of equally spaced bins.
 double[] getNormalizedHistogram()
          Get the normalized histogram (all in [0.0, 1.0]) for the given number of equally spaced bins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Histogram

public Histogram(int[] values,
                 int d_num_bins)
Create a histogram based on the given values, with the given number of bins.

Parameters:
values - the array of integer values.
d_num_bins - the number of bins to include.

Histogram

public Histogram(int[] values,
                 int d_num_bins,
                 int min,
                 int max)
Create a histogram based on the given values, with the given number of bins, using the given min and max. All values lower than the min will be counted in the first bin, and all higher than the max will be counted in the last bin.

Parameters:
values - the array of integer values.
d_num_bins - the number of bins to include.
min - the minimum value to include in the histogram binning
max - the maximum value to include in the histogram binning
Method Detail

getHistogram

public int[] getHistogram()
Get the histogram of counts for the given number of equally spaced bins.

Returns:
an array of "count" values.

getNormalizedHistogram

public double[] getNormalizedHistogram()
Get the normalized histogram (all in [0.0, 1.0]) for the given number of equally spaced bins. They are normalized by the max count in any one bin.

Returns:
an array of normalized "fraction" (in [0, 1.0]) values.

get_num_values

public int get_num_values()
Get the number of values stored.

Returns:
the count.

get_value_min

public int get_value_min()
Get the minimum of the values stored.

Returns:
the minimum value.

get_value_max

public int get_value_max()
Get the maximum of the values stored.

Returns:
the maximum value.

get_value_mean

public double get_value_mean()
Get the mean of the values stored.

Returns:
the mean.

get_value_std

public double get_value_std()
Get the standard deviation of the values stored.

Returns:
the standard deviation.

get_num_bins

public int get_num_bins()
Get the number of bins.

Returns:
the standard deviation.

get_bin_range

public int get_bin_range()
Get the range of the bins.

Returns:
the range.

get_bin_min

public int get_bin_min()
Get the min index for the bins. They are indexed from 0 to this index value.

Returns:
the bin maximum index.

get_bin_max

public int get_bin_max()
Get the max index for the bins. They are indexed from 0 to this index value.

Returns:
the bin maximum index.

get_max_count

public int get_max_count()
Get the maximum count stored in any of the bins.

Returns:
the count.