Examples of DoubleArrayList


Examples of org.apache.hadoop.hbase.regionserver.idx.support.arrays.DoubleArrayList

        break;
      case LONG:
        keyStore = new LongArrayList();
        break;
      case DOUBLE:
        keyStore = new DoubleArrayList();
        break;
      case BYTE:
        keyStore = new ByteArrayList();
        break;
      case CHAR:
View Full Code Here

Examples of org.apache.mahout.math.list.DoubleArrayList

      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

Examples of org.apache.mahout.math.list.DoubleArrayList

   *
   * @param k int
   */
  DoubleBuffer(int k) {
    super(k);
    this.values = new DoubleArrayList(0);
    this.isSorted = false;
  }
View Full Code Here

Examples of org.apache.mahout.math.list.DoubleArrayList

  private DoubleArrayList buffer;
  private boolean isSorted;

  /** Constructs an empty exact quantile finder. */
  ExactDoubleQuantileFinder() {
    this.buffer = new DoubleArrayList(0);
    this.clear();
  }
View Full Code Here

Examples of org.apache.mahout.math.list.DoubleArrayList

    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(DoubleBufferSet.getValuesAtPositions(fullBuffers, triggerPositions));
  }
View Full Code Here

Examples of org.apache.mahout.math.list.DoubleArrayList

      this.beta = (this.totalElementsFilled + missingValues) / (double) this.totalElementsFilled;
    } 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

Examples of org.apache.mahout.math.list.DoubleArrayList

   *                    <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

Examples of org.apache.mahout.math.list.DoubleArrayList

    // 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;
View Full Code Here

Examples of org.apache.mahout.math.list.DoubleArrayList

   * (double)quantiles</tt> for <tt>i={1,2,...,quantiles-1}</tt>.
   *
   * @return the equi-depth phi's
   */
  public static org.apache.mahout.math.list.DoubleArrayList newEquiDepthPhis(int quantiles) {
    DoubleArrayList phis =
        new DoubleArrayList(quantiles - 1);
    for (int i = 1; i <= quantiles - 1; i++) {
      phis.add(i / (double) quantiles);
    }
    return phis;
  }
View Full Code Here

Examples of org.apache.mahout.math.list.DoubleArrayList

   * @param values The values to be filled into the new list.
   * @return a new list.
   */
  public org.apache.mahout.math.list.DoubleArrayList toList(DoubleMatrix1D values) {
    int size = values.size();
    DoubleArrayList list = new DoubleArrayList(size);
    list.setSize(size);
    for (int i = size; --i >= 0;) {
      list.set(i, values.get(i));
    }
    return list;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.