List of usage examples for org.apache.commons.math3.util ResizableDoubleArray ResizableDoubleArray
public ResizableDoubleArray()
From source file:com.itemanalysis.psychometrics.histogram.Histogram.java
/** * This constructor is the most general. It can only use three of the four bin calculation classes. That is, * the {@link #binCalculationType} must be a FreedmanDiaconisBinCalculation, ScottBinCalculation, or * SturgesBinCalculation. A SimpleBinCalculation is not permitted. * * @param histogramType indicates the type of y-axis values that will be returned when {@link #evaluate()} * is called. It has no other effect. * @param lowerInclusive true if the bins should be lower inclusive. If false, the bins will be upper inclusive. *//*from ww w. j a v a 2s. com*/ public Histogram(HistogramType histogramType, BinCalculationType binCalculationType, boolean lowerInclusive) { if (binCalculationType == BinCalculationType.SIMPLE) throw new IllegalArgumentException("Cannot use a SimpleBinCalculation with this constructor"); this.histogramType = histogramType; this.binCalculationType = binCalculationType; this.lowerInclusive = lowerInclusive; data = new ResizableDoubleArray(); bins = new ArrayList<Bin>(); }
From source file:com.itemanalysis.psychometrics.histogram.Histogram.java
/** * This constructor is for use with a {@link com.itemanalysis.psychometrics.histogram.SimpleBinCalculation} * where the user provides the min, max, and number of points. * * @param histogramType type of histogram * @param numberOfBins number of bins to include in histogram * @param min minimum value//from w w w.java 2 s . c om * @param max maximum value * @param lowerInclusive true if lower bound is included in the interval but teh upper bound is not. * If false lower bound not included but upper bound is included. */ public Histogram(HistogramType histogramType, int numberOfBins, double min, double max, boolean lowerInclusive) { this.histogramType = histogramType; this.binCalculationType = BinCalculationType.SIMPLE; binCalc = new SimpleBinCalculation(numberOfBins, min, max); this.lowerInclusive = lowerInclusive; data = new ResizableDoubleArray(); bins = new ArrayList<Bin>(); }