Package org.apache.hadoop.examples.pi.Util

Examples of org.apache.hadoop.examples.pi.Util.Timer.tick()


    }
  }

  private static void computeBenchmarks(final Summation2 sigma) {
    final Timer t = new Timer(false);
    t.tick("sigma=" + sigma);
    final double value = sigma.compute();
    t.tick("compute=" + value);
    assertEquals(value, sigma.compute_modular());
    t.tick("compute_modular");
    assertEquals(value, sigma.compute_montgomery());
View Full Code Here


  private static void computeBenchmarks(final Summation2 sigma) {
    final Timer t = new Timer(false);
    t.tick("sigma=" + sigma);
    final double value = sigma.compute();
    t.tick("compute=" + value);
    assertEquals(value, sigma.compute_modular());
    t.tick("compute_modular");
    assertEquals(value, sigma.compute_montgomery());
    t.tick("compute_montgomery");
    assertEquals(value, sigma.compute_montgomery2());
View Full Code Here

    final Timer t = new Timer(false);
    t.tick("sigma=" + sigma);
    final double value = sigma.compute();
    t.tick("compute=" + value);
    assertEquals(value, sigma.compute_modular());
    t.tick("compute_modular");
    assertEquals(value, sigma.compute_montgomery());
    t.tick("compute_montgomery");
    assertEquals(value, sigma.compute_montgomery2());
    t.tick("compute_montgomery2");
View Full Code Here

    final double value = sigma.compute();
    t.tick("compute=" + value);
    assertEquals(value, sigma.compute_modular());
    t.tick("compute_modular");
    assertEquals(value, sigma.compute_montgomery());
    t.tick("compute_montgomery");
    assertEquals(value, sigma.compute_montgomery2());
    t.tick("compute_montgomery2");

    assertEquals(value, sigma.compute_modBigInteger());
    t.tick("compute_modBigInteger");
View Full Code Here

    assertEquals(value, sigma.compute_modular());
    t.tick("compute_modular");
    assertEquals(value, sigma.compute_montgomery());
    t.tick("compute_montgomery");
    assertEquals(value, sigma.compute_montgomery2());
    t.tick("compute_montgomery2");

    assertEquals(value, sigma.compute_modBigInteger());
    t.tick("compute_modBigInteger");
    assertEquals(value, sigma.compute_modPow());
    t.tick("compute_modPow");
View Full Code Here

    t.tick("compute_montgomery");
    assertEquals(value, sigma.compute_montgomery2());
    t.tick("compute_montgomery2");

    assertEquals(value, sigma.compute_modBigInteger());
    t.tick("compute_modBigInteger");
    assertEquals(value, sigma.compute_modPow());
    t.tick("compute_modPow");
  }

  /** Benchmarks */
 
View Full Code Here

    t.tick("compute_montgomery2");

    assertEquals(value, sigma.compute_modBigInteger());
    t.tick("compute_modBigInteger");
    assertEquals(value, sigma.compute_modPow());
    t.tick("compute_modPow");
  }

  /** Benchmarks */
  public static void main(String[] args) {
    final long delta = 1L << 4;
View Full Code Here

    return r;
  }
 
  static void squareBenchmarks() {
    final Timer t = new Timer(false);
    t.tick("squareBenchmarks(), MAX_SQRT=" + Modular.MAX_SQRT_LONG);

    final long[][][] rn = generateRN(1000, 1000);
    t.tick("generateRN");

    for(int i = 0; i < rn.length; i++) {
View Full Code Here

  static void squareBenchmarks() {
    final Timer t = new Timer(false);
    t.tick("squareBenchmarks(), MAX_SQRT=" + Modular.MAX_SQRT_LONG);

    final long[][][] rn = generateRN(1000, 1000);
    t.tick("generateRN");

    for(int i = 0; i < rn.length; i++) {
      final long n = rn[i][0][0];
      for(int j = 1; j < rn[i].length; j++) {
        final long r = rn[i][j][0];
View Full Code Here

        final long s = square_slow(r, n);
        if (s != answer)
          assertEquals("r=" + r + ", n=" + n + ", answer=" + answer + " but s=" + s, answer, s);
      }
    }
    t.tick("square_slow");

    for(int i = 0; i < rn.length; i++) {
      final long n = rn[i][0][0];
      long r2p64 = (0x4000000000000000L % n) << 1;
      if (r2p64 >= n) r2p64 -= n;
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.