Package edu.umd.cloud9.util.map

Examples of edu.umd.cloud9.util.map.HMapII.increment()


    System.out.println("Complete postings list for 'silver': " + value);

    Int2IntFrequencyDistribution silverHist = new Int2IntFrequencyDistributionEntry();
    postings = value.getRightElement();
    for (PairOfInts pair : postings) {
      silverHist.increment(pair.getRightElement());
    }

    System.out.println("histogram of tf values for silver");
    for (PairOfInts pair : silverHist) {
      System.out.println(pair.getLeftElement() + "\t" + pair.getRightElement());
View Full Code Here


    for (Int2IntFrequencyDistribution fd : distributions.values()) {
      long conditionalSum = 0;

      for (PairOfInts pair : fd) {
        conditionalSum += pair.getRightElement();
        m.increment(pair.getLeftElement(), pair.getRightElement());
      }

      if (conditionalSum != fd.getSumOfCounts()) {
        throw new RuntimeException("Internal Error!");
      }
View Full Code Here

    System.out.println("Complete postings list for 'gold': " + value);

    Int2IntFrequencyDistribution goldHist = new Int2IntFrequencyDistributionEntry();
    postings = value.getRightElement();
    for (PairOfInts pair : postings) {
      goldHist.increment(pair.getRightElement());
    }

    System.out.println("histogram of tf values for gold");
    for (PairOfInts pair : goldHist) {
      System.out.println(pair.getLeftElement() + "\t" + pair.getRightElement());
View Full Code Here

    System.out.println("Complete postings list for 'silver': " + value);

    Int2IntFrequencyDistribution silverHist = new Int2IntFrequencyDistributionEntry();
    postings = value.getRightElement();
    for (PairOfInts pair : postings) {
      silverHist.increment(pair.getRightElement());
    }

    System.out.println("histogram of tf values for silver");
    for (PairOfInts pair : silverHist) {
      System.out.println(pair.getLeftElement() + "\t" + pair.getRightElement());
View Full Code Here

    for (Int2IntFrequencyDistribution fd : distributions.values()) {
      long conditionalSum = 0;

      for (PairOfInts pair : fd) {
        conditionalSum += pair.getRightElement();
        m.increment(pair.getLeftElement(), pair.getRightElement());
      }

      if (conditionalSum != fd.getSumOfCounts()) {
        throw new RuntimeException("Internal Error!");
      }
View Full Code Here

    for (Int2IntFrequencyDistributionFastutil fd : distributions.values()) {
      long conditionalSum = 0;

      for (PairOfInts pair : fd) {
        conditionalSum += pair.getRightElement();
        m.increment(pair.getLeftElement(), pair.getRightElement());
      }

      if (conditionalSum != fd.getSumOfCounts()) {
        throw new RuntimeException("Internal Error!");
      }
View Full Code Here

  @Test
  public void testIncrement() {
    HMapID m = new HMapID();
    assertEquals(0.0, m.get(1), 10E-6);

    m.increment(1, 0.5);
    assertEquals(0.5, m.get(1), 10E-6);

    m.increment(1, 1.0);
    m.increment(2, 0.0);
    m.increment(3, -0.5);
View Full Code Here

    assertEquals(0.0, m.get(1), 10E-6);

    m.increment(1, 0.5);
    assertEquals(0.5, m.get(1), 10E-6);

    m.increment(1, 1.0);
    m.increment(2, 0.0);
    m.increment(3, -0.5);

    assertEquals(1.5, m.get(1), 10E-6);
    assertEquals(0.0, m.get(2), 10E-6);
View Full Code Here

    m.increment(1, 0.5);
    assertEquals(0.5, m.get(1), 10E-6);

    m.increment(1, 1.0);
    m.increment(2, 0.0);
    m.increment(3, -0.5);

    assertEquals(1.5, m.get(1), 10E-6);
    assertEquals(0.0, m.get(2), 10E-6);
    assertEquals(-0.5, m.get(3), 10E-6);
View Full Code Here

    m.increment(1, 0.5);
    assertEquals(0.5, m.get(1), 10E-6);

    m.increment(1, 1.0);
    m.increment(2, 0.0);
    m.increment(3, -0.5);

    assertEquals(1.5, m.get(1), 10E-6);
    assertEquals(0.0, m.get(2), 10E-6);
    assertEquals(-0.5, m.get(3), 10E-6);
  }
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.