Package edu.umd.cloud9.util.array

Examples of edu.umd.cloud9.util.array.ArrayListOfShorts.trimToSize()


        //System.out.println("-->" + curr + " " + links.toString());
        if (!(stopList.contains(curr))) {
          if (adjLists.containsKey(curr)) {
            //FIXME?
            ArrayListOfIntsWritable list = new ArrayListOfIntsWritable(adjLists.get(curr));
            list.trimToSize();
            links.trimToSize();
            list.addUnique(links.getArray());
            adjLists.remove(curr);
            adjLists.put(curr, list);
          } else {
View Full Code Here


      //System.out.println(key.toString());
      while (values.hasNext()) {
        valIn = values.next();
        //System.out.println(valIn.toString());
        ArrayListOfIntsWritable adjListIn = valIn.getInlinks();
        adjListIn.trimToSize();
        adjList.addUnique(adjListIn.getArray());
      }

      valOut.setType(HITSNode.TYPE_AUTH_COMPLETE);
      valOut.setARank((float) 0.0);
View Full Code Here

      }
      while (itr.hasMoreTokens()) {
        int curr = Integer.parseInt(itr.nextToken());
        if (adjLists.containsKey(curr)) {
          ArrayListOfIntsWritable list = adjLists.get(curr);
          list.trimToSize();
          links.trimToSize();
          //FIXME
          //list.addAll(links.getArray());
          adjLists.put(curr, list);
        } else {
View Full Code Here

      // adjList.trimToSize();

      while (values.hasNext()) {
        valIn = values.next();
        ArrayListOfIntsWritable adjListIn = valIn.getOutlinks();
        adjListIn.trimToSize();
        adjList.addUnique(adjListIn.getArray());
        valOut.setNodeId(valIn.getNodeId());
      }
      valOut.setOutlinks(adjList);
      valOut.setType(HITSNode.TYPE_HUB_COMPLETE);
View Full Code Here

    }

    double[] rawArray = list.getArray();
    int lenBefore = rawArray.length;

    list.trimToSize();
    double[] rawArrayAfter = list.getArray();
    int lenAfter = rawArrayAfter.length;

    assertEquals(89, lenAfter);
    assertTrue(lenBefore > lenAfter);
View Full Code Here

    }

    float[] rawArray = list.getArray();
    int lenBefore = rawArray.length;

    list.trimToSize();
    float[] rawArrayAfter = list.getArray();
    int lenAfter = rawArrayAfter.length;

    assertEquals(89, lenAfter);
    assertTrue(lenBefore > lenAfter);
View Full Code Here

        LOG.warn("Error: tf of " + e.getValue()
            + " will overflow max short value. docno=" + doc.getDocid() + ", term="
            + e.getKey());
        it.remove();
      } else {
        positionsList.trimToSize();
        doclength += positionsList.size();
      }
    }

    if ( positions.size() == 0 ) {
View Full Code Here

        if (_data[i] > probThreshold) {
          words.add(i);
        }
      }
    }
    words.trimToSize();
    return words.getArray();
  }
 
  public PriorityQueue<PairOfFloatInt> getTranslationsWithProbs(float probThreshold){
    PriorityQueue<PairOfFloatInt> q = new PriorityQueue<PairOfFloatInt>(_data.length, Collections.reverseOrder());
View Full Code Here

        LOG.warn("Error: tf of " + e.getValue()
            + " will overflow max short value. docno=" + doc.getDocid() + ", term="
            + e.getKey());
        it.remove();
      } else {
        positionsList.trimToSize();
        doclength += positionsList.size();
      }
    }

    if ( positions.size() == 0 ) {
View Full Code Here

        LOG.warn("Error: tf of " + e.getValue()
            + " will overflow max short value. docno=" + doc.getDocid() + ", term="
            + e.getKey());
        it.remove();
      } else {
        positionsList.trimToSize();
        doclength += positionsList.size();
      }
    }

    if ( positions.size() == 0 ) {
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.