Package org.apache.mahout.math.list

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


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


   * #forEachKey(FloatProcedure)}. <p> This method can be used to iterate over the values of the receiver.
   *
   * @return the values.
   */
  public IntArrayList values() {
    IntArrayList list = new IntArrayList(size());
    values(list);
    return list;
  }
View Full Code Here

   * #forEachKey(IntProcedure)}. <p> This method can be used to iterate over the keys of the receiver.
   *
   * @return the keys.
   */
  public IntArrayList keys() {
    IntArrayList list = new IntArrayList(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() {
    IntArrayList theKeys = keys();
    //theKeys.sort();

    StringBuilder buf = new StringBuilder();
    buf.append('[');
    int maxIndex = theKeys.size() - 1;
    for (int i = 0; i <= maxIndex; i++) {
      int 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

  /**
   * Returns a string representation of the receiver, containing the String representation of each key-value pair,
   * sorted ascending by value.
   */
  public String toStringByValue() {
    IntArrayList theKeys = new IntArrayList();
    keysSortedByValue(theKeys);

    StringBuilder buf = new StringBuilder();
    buf.append('[');
    int maxIndex = theKeys.size() - 1;
    for (int i = 0; i <= maxIndex; i++) {
      int 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

  @Override
  public void readFields(DataInput in) throws IOException {
    super.readFields(in);
    int numpoints = in.readInt();
    this.boundPoints = new IntArrayList();
    for (int i = 0; i < numpoints; i++) {
      this.boundPoints.add(in.readInt());
    }
  }
View Full Code Here

   * Fetch the list of entries from the tuple
   *
   * @return a List containing the strings in the order of insertion
   */
  public IntArrayList getEntries() {
    return new IntArrayList(this.tuple.elements());
  }
View Full Code Here

  }
 
  @Override
  public void readFields(DataInput in) throws IOException {
    int len = in.readInt();
    tuple = new IntArrayList(len);
    IntWritable value = new IntWritable();
    for (int i = 0; i < len; i++) {
      value.readFields(in);
      tuple.add(value.get());
    }
View Full Code Here

    }
   
    Map<String,Long> gList = PFPGrowth.deserializeMap(params, PFPGrowth.G_LIST, context.getConfiguration());
   
    for (Entry<String,Long> entry : gList.entrySet()) {
      IntArrayList groupList = groupFeatures.get(entry.getValue());
      Integer itemInteger = fMap.get(entry.getKey());
      if (groupList != null) {
        groupList.add(itemInteger);
      } else {
        groupList = new IntArrayList();
        groupList.add(itemInteger);
        groupFeatures.put(entry.getValue(), groupList);
      }
     
    }
    maxHeapSize = Integer.valueOf(params.get(PFPGrowth.MAX_HEAPSIZE, "50"));
View Full Code Here

        writer.append("Count: ").append(String.valueOf(count)).append('\n');
      }
      if (facets != null) {
        List<String> keyList = new ArrayList<String>(facets.size());

        IntArrayList valueList = new IntArrayList(facets.size());
        facets.pairsSortedByKey(keyList, valueList);
        writer.append("-----Facets---\n");
        writer.append("Key\t\tCount\n");
        int i = 0;
        for (String key : keyList) {
          writer.append(key).append("\t\t").append(String.valueOf(valueList.get(i++))).append('\n');

        }
      }
      writer.flush();
View Full Code Here

TOP

Related Classes of org.apache.mahout.math.list.IntArrayList

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.