Returns a visual representation of a histogram object.
Initially returns an array of just the min. and max. values
but can also support the addition of quantiles.

@return a visual representation of this histogram
517734
public HistogramVisual asVisual()
  {
    float[] visualCounts = new float[bins.length - 2];
    for (int i = 0; i < visualCounts.length; ++i) {
      visualCounts[i] = (float) bins[i + 1];
    }
    return new HistogramVisual(breaks, visualCounts, new float[]{min, max});
  }
320752
public Object getNextData() {
        moreData = false;
        if (dataObject instanceof double[][]) {
            return outputData;
        } else {
            throw new RuntimeException();
        }
    }

    public ColorMapBuffer getNextDataColor( int attColor ) {
        return null;
    }

    /**
     * Create a string that defines how the legend will look.
     * @throws IOException 
     */
    public String getLegendString() throws IOException {
        return null;
    }

    /**
     * 
     */
    public void hasChanged( boolean _haschanged ) {
        // if (_haschanged) {
        // novalue = new Double(Double.NaN);
        // matrixType = 0;
        // // theFilePath = null;
        // cellFile = nullFile = null;
        // filename = null;
        // mapsetPath = null;
        // locationPath = null;
        // rasterByteBuffer = null;
        // moreData = false;
        // // fileWindow = null;
        // // dataWindow = null;
        // rasterMapType = -9999;
        // numberOfBytesPerValue = -9999;
        // compressed = -9999;
        // }
        // hasChanged = _haschanged;
    }
1279032
public List<Integer> listValues() {
		ArrayList<Integer> list = new ArrayList<Integer>(getRange());
		for (int i = getMin(); i <= getMax(); i++) {
			list.add(i);
		}
		return list;
	}
579718
public T max() {
        if (sum == 0)
            return null;
        int maxCount = -1;
        int maxIndex = -1;
        for (TIntIntIterator it = indexToCount.iterator(); it.hasNext(); ) {
            it.advance();
            if (it.value() > maxCount) {
                maxIndex = it.key();
                maxCount = it.value();
            }
        }
        return objectIndices.lookup(maxIndex);
    }
391552
def color_hist(fg, bg)
      img = number_colors > 256 ? quantize(256) : self

      begin
        hist = img.color_histogram
      rescue NotImplementedError
        warn 'The color_histogram method is not supported by this version '\
                     'of ImageMagick/GraphicsMagick'
      else
        pixels = hist.keys.sort_by { |pixel| hist[pixel] }
        scale = HISTOGRAM_ROWS / (hist.values.max * AIR_FACTOR)

        histogram = Image.new(HISTOGRAM_COLS, HISTOGRAM_ROWS) do
          self.background_color = bg
          self.border_color = fg
        end

        x = 0
        pixels.each do |pixel|
          column = Array.new(HISTOGRAM_ROWS).fill { Pixel.new }
          HISTOGRAM_ROWS.times do |y|
            column[y] = pixel if y >= HISTOGRAM_ROWS - (hist[pixel] * scale)
          end
          histogram.store_pixels(x, 0, 1, HISTOGRAM_ROWS, column)
          x = x.succ
        end

        histogram['Label'] = 'Color Frequency'
        return histogram
      end
    end
461494
public Histogram toHistogram(final float[] breaks)
  {
    final double[] approximateBins = new double[breaks.length - 1];

    double prev = sum(breaks[0]);
    for (int i = 1; i < breaks.length; ++i) {
      double s = sum(breaks[i]);
      approximateBins[i - 1] = (float) (s - prev);
      prev = s;
    }

    return new Histogram(breaks, approximateBins);
  }
187327
public int[] getDefalutValuesArray() {
        int[] defaultValues = new int[5];

        defaultValues[0] = GLES20.GL_LINEAR_MIPMAP_NEAREST; // MIN FILTER
        defaultValues[1] = GLES20.GL_LINEAR; // MAG FILTER
        defaultValues[2] = 1; // ANISO FILTER
        defaultValues[3] = GLES20.GL_CLAMP_TO_EDGE; // WRAP S
        defaultValues[4] = GLES20.GL_CLAMP_TO_EDGE; // WRAP T

        return defaultValues;
    }
1187940
public BufferedImage getSnapshot ()
    {
        BufferedImage baseSnap = _base.getSnapshot();
        BufferedImage img = new BufferedImage(_bounds.width, _bounds.height,
            baseSnap.getType());
        Graphics2D gfx = (Graphics2D) img.getGraphics();
        try {
            gfx.transform(_transform);
            gfx.drawImage(baseSnap, 0, 0, null);
        } finally {
            gfx.dispose();
        }
        return img;
    }
838260
public StatisticImpl[] getJ2EEStatistics() {
        ArrayList members = copyStatistics();
        if (members == null || members.size() == 0)
            return new StatisticImpl[0];

        StatisticImpl[] ret = new StatisticImpl[members.size()];
        for (int i = 0; i < ret.length; i++) {
            ret[i] = (StatisticImpl) members.get(i);
        }
        return ret;
    }
596283
public static void histogram( GrayS8 input , int minValue , int histogram[] ) {
		if( BoofConcurrency.USE_CONCURRENT ) {
			ImplImageStatistics_MT.histogram(input,minValue,histogram);
		} else {
			ImplImageStatistics.histogram(input,minValue,histogram);
		}
	}
428816
@java.lang.Deprecated
  public java.util.Map<java.lang.String, java.lang.Long> getHistogram() {
    return getHistogramMap();
  }
224700
def values(self):
        ""
        if util.config.future_deprecations:
            self.param.warning('Histogram.values is deprecated in favor of '
                               'common dimension_values method.')
        return self.dimension_values(1)
467473
private void extractFgBgData(Map<Integer, Integer> colorHistogram) {
        if (colorHistogram.isEmpty()) {
            // An empty histogram indicates we've encountered a 0px area image. It has no luminance.
            mBackgroundLuminance = mForegroundLuminance = 0;
            mBackgroundColor = Color.BLACK;
            mForegroundColor = Color.BLACK;
        } else if (colorHistogram.size() == 1) {
            // Deal with views that only contain a single color
            final int singleColor = colorHistogram.keySet().iterator().next();
            mBackgroundLuminance = mForegroundLuminance =
                    ContrastUtils.calculateLuminance(singleColor);
            mForegroundColor = singleColor;
            mBackgroundColor = singleColor;
        } else {
            // Find the average luminance value within the set of luminances for
            // purposes of splitting luminance values into high-luminance and
            // low-luminance buckets. This is explicitly not a weighted average.
            double luminanceSum = 0;
            for (int color : colorHistogram.keySet()) {
                luminanceSum += ContrastUtils.calculateLuminance(color);
            }

            final double averageLuminance = luminanceSum / colorHistogram.size();

            // Select the highest and lowest luminance values that contribute to
            // most number of pixels in the image -- our background and
            // foreground colors.
            double lowLuminanceContributor = 0.0d;
            double highLuminanceContributor = 1.0d;
            int lowLuminanceColor = -1;
            int highLuminanceColor = -1;
            int maxLowLuminanceFrequency = 0;
            int maxHighLuminanceFrequency = 0;
            for (Entry<Integer, Integer> entry : colorHistogram.entrySet()) {
                final int color = entry.getKey();
                final double luminanceValue = ContrastUtils.calculateLuminance(color);
                final int frequency = entry.getValue();
                if ((luminanceValue < averageLuminance) && (frequency > maxLowLuminanceFrequency)) {
                    lowLuminanceContributor = luminanceValue;
                    maxLowLuminanceFrequency = frequency;
                    lowLuminanceColor = color;
                } else if ((luminanceValue >= averageLuminance)
                        && (frequency > maxHighLuminanceFrequency)) {
                    highLuminanceContributor = luminanceValue;
                    maxHighLuminanceFrequency = frequency;
                    highLuminanceColor = color;
                }
            }

            // Background luminance is that which occurs more frequently
            if (maxHighLuminanceFrequency > maxLowLuminanceFrequency) {
                mBackgroundLuminance = highLuminanceContributor;
                mBackgroundColor = highLuminanceColor;
                mForegroundLuminance = lowLuminanceContributor;
                mForegroundColor = lowLuminanceColor;
            } else {
                mBackgroundLuminance = lowLuminanceContributor;
                mBackgroundColor = lowLuminanceColor;
                mForegroundLuminance = highLuminanceContributor;
                mForegroundColor = highLuminanceColor;
            }
        }
    }
282159
public Pose[] getPose() {
		Pose[] ret = new Pose[psa.length];
		for (int i = 0; i < ret.length; i++) {
			ret[i] = psa[i].getPose();
		}
		return ret;
	}
254899
public Double[] exportImaginary()
    {
        Double[] ad = new Double[indexSet.size()];
        int i = 0;
        for (IndexMN index: indexSet) {
            if (imaginary.containsKey(index)) {
                ad[i] = imaginary.get(index);
            } else {
                ad[i] = 0.0;
            }
            i++;
        }
        return ad;
    }
860024
def normalized(self):
        
        total = self.total()
        result = Histogram()
        for value, count in iteritems(self):
            try:
                result[value] = count / float(total)
            except UnorderableElements as e:
                result = Histogram.from_dict(dict(result), key=hash)
                result[value] = count / float(total)
        return result
30707
function(w) {
    if(w.length === 0) { return {}; } // ... ;s
    var maxv = w[0];
    var minv = w[0];
    var maxi = 0;
    var mini = 0;
    var n = w.length;
    for(var i=1;i<n;i++) {
      if(w[i] > maxv) { maxv = w[i]; maxi = i; } 
      if(w[i] < minv) { minv = w[i]; mini = i; } 
    }
    return {maxi: maxi, maxv: maxv, mini: mini, minv: minv, dv:maxv-minv};
  }