Package cern.colt.list

Examples of cern.colt.list.DoubleArrayList


* @param phi the percentage for which the quantile is to be computed.
* phi must be in the interval <tt>(0.0,1.0]</tt>.
* @return the phi quantile element.
*/
public synchronized double quantile(double phi) {
  return quantiles(new DoubleArrayList(new double[] {phi})).get(0);
}
View Full Code Here


      subBins[c++] = percent[i] + j*step;
    }
  }

  // compute quantile elements;
  double[] quantiles = quantiles(new DoubleArrayList(subBins)).elements();

  // collect summary statistics for each bin.
  // one bin's statistics are the integrated statistics of its subintervals.
  MightyStaticBin1D[] splitBins = new MightyStaticBin1D[noOfBins];
  int maxOrderForSumOfPowers =  getMaxOrderForSumOfPowers();
View Full Code Here

@param axis an axis defining interval boundaries.
@param resolution a measure of accuracy; the desired number of subintervals per interval.
*/
public synchronized MightyStaticBin1D[] splitApproximately(hep.aida.IAxis axis, int k) {
  DoubleArrayList percentages = new DoubleArrayList(new hep.aida.ref.Converter().edges(axis));
  percentages.beforeInsert(0,Double.NEGATIVE_INFINITY);
  percentages.add(Double.POSITIVE_INFINITY);
  for (int i=percentages.size(); --i >= 0; ) {
    percentages.set(i, quantileInverse(percentages.get(i)));
  }
 
  return splitApproximately(percentages,k);
}
View Full Code Here

* Each percentage must be in the interval <tt>[0.0,1.0]</tt>.
* @return the quantiles.
*/
public static DoubleArrayList quantiles(DoubleArrayList sortedData, DoubleArrayList percentages) {
  int s = percentages.size();
  DoubleArrayList quantiles = new DoubleArrayList(s);
 
  for (int i=0; i < s; i++) {
    quantiles.add(quantile(sortedData, percentages.get(i)));
  }
 
  return quantiles;
}
View Full Code Here

  // assertion: data is sorted ascending.
  // assertion: splitValues is sorted ascending.
  int noOfBins = splitters.size() + 1;
 
  DoubleArrayList[] bins = new DoubleArrayList[noOfBins];
  for (int i=noOfBins; --i >= 0;) bins[i] = new DoubleArrayList();
 
  int listSize = sortedList.size();
  int nextStart = 0;
  int i=0;
  while (nextStart < listSize && i < noOfBins-1) {
View Full Code Here

*
* @param element element to be appended.
*/
public synchronized void add(double element) {
  // prototyping implementation; inefficient; TODO
  this.addAllOf(new DoubleArrayList(new double[] {element}));
  /*
  sumSquares += element * element;
  if (this.done == 0) { // initial setup
    this.min = element;
    this.max = element;
View Full Code Here

* <tt>keys = (8,7,6), values = (1,2,2) --> keyList = (8,6,7)</tt>
*
* @param keyList the list to be filled, can have any size.
*/
public void keysSortedByValue(final IntArrayList keyList) {
  pairsSortedByValue(keyList, new DoubleArrayList(size()));
}
View Full Code Here

* This method can be used to iterate over the values of the receiver.
*
* @return the values.
*/
public DoubleArrayList values() {
  DoubleArrayList list = new DoubleArrayList(size());
  values(list);
  return list;
}
View Full Code Here

* This method can be used to iterate over the keys of the receiver.
*
* @return the keys.
*/
public DoubleArrayList keys() {
  DoubleArrayList list = new DoubleArrayList(size());
  keys(list);
  return list;
}
View Full Code Here

/**
* Returns a string representation of the receiver, containing
* the String representation of each key-value pair, sorted ascending by key.
*/
public String toString() {
  DoubleArrayList theKeys = keys();
  theKeys.sort();

  StringBuffer buf = new StringBuffer();
  buf.append("[");
  int maxIndex = theKeys.size() - 1;
  for (int i = 0; i <= maxIndex; i++) {
    double key = theKeys.get(i);
      buf.append(String.valueOf(key));
    buf.append("->");
      buf.append(String.valueOf(get(key)));
    if (i < maxIndex) buf.append(", ");
  }
View Full Code Here

TOP

Related Classes of cern.colt.list.DoubleArrayList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.