Examples of sum()


Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.sum()

    scan.setStartRow(ROWS[6]);
    scan.setStopRow(ROWS[2]);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    Long sum = null;
    try {
      sum = aClient.sum(TEST_TABLE, ci, scan);
    } catch (Throwable e) {
    }
    assertEquals(null, sum);// control should go to the catch block
  }

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.sum()

    Scan scan = new Scan();
    scan.addFamily(TEST_FAMILY);
    scan.setFilter(f);
    final ColumnInterpreter<Long, Long> ci = new LongColumnInterpreter();
    Long sum = null;
    sum = aClient.sum(TEST_TABLE, ci, scan);
    assertEquals(null, sum);
  }

  /**
   * ****************************** Test Cases for Avg **************
 

Examples of org.apache.hama.commons.math.DoubleVector.sum()

  @Override
  protected void calculateTrainingError(DoubleVector labels, DoubleVector output) {
    DoubleVector errors = labels.deepCopy().applyToElements(output,
        this.costFunction);
    this.trainingError = errors.sum();
  }

  /**
   * Get the squashing function of a specified layer.
   *
 

Examples of org.apache.hama.commons.math.DoubleVector.sum()

    return compareVector(a.getVector(), o.getVector());
  }

  public static int compareVector(DoubleVector a, DoubleVector o) {
    DoubleVector subtract = a.subtractUnsafe(o);
    return (int) subtract.sum();
  }

  public static VectorWritable wrap(DoubleVector a) {
    return new VectorWritable(a);
  }

Examples of org.apache.hama.ml.math.DoubleVector.sum()

    return compareVector(a.getVector(), o.getVector());
  }

  public static int compareVector(DoubleVector a, DoubleVector o) {
    DoubleVector subtract = a.subtract(o);
    return (int) subtract.sum();
  }

  public static VectorWritable wrap(DoubleVector a) {
    return new VectorWritable(a);
  }

Examples of org.apache.openejb.itest.failover.ejb.Calculator.sum()

        server.start(1, TimeUnit.MINUTES);

        logger.info("Performing one more invocation");

        assertEquals(5, bean.sum(2, 3));
    }

    private void invoke(final String name, final StandaloneServer server) throws NamingException {
        final Properties environment = new Properties();
        environment.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());

Examples of org.apache.spark.api.java.JavaDoubleRDD.sum()

  @SuppressWarnings("unchecked")
  @Test
  public void persist() {
    JavaDoubleRDD doubleRDD = sc.parallelizeDoubles(Arrays.asList(1.0, 1.0, 2.0, 3.0, 5.0, 8.0));
    doubleRDD = doubleRDD.persist(StorageLevel.DISK_ONLY());
    Assert.assertEquals(20, doubleRDD.sum(), 0.1);

    List<Tuple2<Integer, String>> pairs = Arrays.asList(
      new Tuple2<Integer, String>(1, "a"),
      new Tuple2<Integer, String>(2, "aa"),
      new Tuple2<Integer, String>(3, "aaa")

Examples of org.apache.spark.util.StatCounter.sum()

    union = union.cache();
    Assert.assertEquals(12, union.count());

    Assert.assertEquals(20, rdd.sum(), 0.01);
    StatCounter stats = rdd.stats();
    Assert.assertEquals(20, stats.sum(), 0.01);
    Assert.assertEquals(20/6.0, rdd.mean(), 0.01);
    Assert.assertEquals(20/6.0, rdd.mean(), 0.01);
    Assert.assertEquals(6.22222, rdd.variance(), 0.01);
    Assert.assertEquals(7.46667, rdd.sampleVariance(), 0.01);
    Assert.assertEquals(2.49444, rdd.stdev(), 0.01);

Examples of org.apache.tajo.rpc.test.DummyProtocol.DummyProtocolService.BlockingInterface.sum()

    new ServerCallable<SumResponse>(RpcConnectionPool.newPool(new TajoConf(), getClass().getSimpleName(), 2),
        server.getListenAddress(), DummyProtocol.class, false) {
      @Override
      public SumResponse call(NettyClientBase client) throws Exception {
        BlockingInterface stub2 = client.getStub();
        SumResponse response1 = stub2.sum(null, request);
        return response1;
      }
    }.withRetries();

    assertTrue(8.15d == response.getResult());

Examples of org.apache.tajo.rpc.test.DummyProtocol.DummyProtocolService.BlockingInterface.sum()

        new ServerCallable<SumResponse>(RpcConnectionPool.newPool(new TajoConf(), getClass().getSimpleName(), 2),
            server.getListenAddress(), DummyProtocol.class, false) {
          @Override
          public SumResponse call(NettyClientBase client) throws Exception {
            BlockingInterface stub2 = client.getStub();
            SumResponse response1 = stub2.sum(null, request);
            return response1;
          }
        }.withoutRetries();

    assertTrue(8.15d == response.getResult());
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.