Package cern.colt.list

Examples of cern.colt.list.DoubleArrayList


  }
  catch (IllegalArgumentException exc) { // we can hold rows*columns>Integer.MAX_VALUE cells !
    if (! "matrix too large".equals(exc.getMessage())) throw exc;
  }
  indexes = new IntArrayList();
  values = new DoubleArrayList();
  starts = new int[rows+1];
}
View Full Code Here


  IntArrayList indexList = indexes[i];
  if (indexList != null) k = indexList.binarySearch(j);
 
  if (k>=0) { // found
    if (value==0) {
      DoubleArrayList valueList = values[i];
      indexList.remove(k);
      valueList.remove(k);
      int s = indexList.size();
      if (s>2 && s*3 < indexList.elements().length) {
        indexList.setSize(s*3/2);
        indexList.trimToSize();
        indexList.setSize(s);
       
        valueList.setSize(s*3/2);
        valueList.trimToSize();
        valueList.setSize(s);   
      }
    }
    else {
      values[i].setQuick(k,value);
    }
  }
  else { // not found
    if (value==0) return;

    k = -k-1;

    if (indexList == null) {
      indexes[i] = new IntArrayList(3);
      values[i= new DoubleArrayList(3);
    }
    indexes[i].beforeInsert(k,j);
    values[i].beforeInsert(k,value);
  }
}
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

  //System.out.println(binB);
  //System.out.println(binA.compareWith(binB));

  System.out.println("\n\nBenchmarking frequencies...\n");
  IntArrayList freq = new IntArrayList();
  DoubleArrayList distinct = new DoubleArrayList();
  cern.colt.Timer timer = new cern.colt.Timer();
  timer.reset();
  timer.start();
  binA.frequencies(distinct,freq);
  timer.stop().display();
View Full Code Here

  DoubleBuffer[] fullBuffers = bufferSet._getFullOrPartialBuffers();
  double[] quantileElements = new double[phis.size()];

  //do the main work: determine values at given positions in sorted sequence
  return new DoubleArrayList(bufferSet.getValuesAtPositions(fullBuffers, triggerPositions));
}
View Full Code Here

    }
  else {
    this.beta=1.0;
  }
  
  DoubleArrayList quantileElements = super.quantileElements(phis);

  // restore state we were in before.
  // remove the temporarily added infinities.
  if (partial != null) removeInfinitiesFrom(missingValues, partial);
View Full Code Here

  this.target = target;
  this.capacity = capacity;
  this.xElements = new double[capacity];
  this.yElements = new double[capacity];
  this.zElements = new double[capacity];
  this.xList = new DoubleArrayList(xElements);
  this.yList = new DoubleArrayList(yElements);
  this.zList = new DoubleArrayList(zElements);
  this.size = 0;
}
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.