Search in sources :

Example 46 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project hazelcast-jet by hazelcast.

the class CollectorsTest method list_summarizingDouble.

@Test
public void list_summarizingDouble() {
    DoubleSummaryStatistics summary = streamList().collect(DistributedCollectors.summarizingDouble(m -> (double) m));
    assertEquals(COUNT, summary.getCount());
    assertEquals(COUNT - 1, summary.getMax(), 0d);
    assertEquals(0, summary.getMin(), 0d);
    assertEquals(COUNT * (COUNT - 1) / 2d, summary.getSum(), 0d);
    assertEquals((COUNT - 1) / 2d, summary.getAverage(), 0d);
}
Also used : Collection(java.util.Collection) IMapJet(com.hazelcast.jet.IMapJet) Set(java.util.Set) Assert.assertTrue(org.junit.Assert.assertTrue) DistributedComparator(com.hazelcast.jet.function.DistributedComparator) Test(org.junit.Test) IListJet(com.hazelcast.jet.IListJet) DoubleSummaryStatistics(java.util.DoubleSummaryStatistics) TreeSet(java.util.TreeSet) List(java.util.List) ICacheJet(com.hazelcast.jet.ICacheJet) Assert.assertFalse(org.junit.Assert.assertFalse) Map(java.util.Map) Entry(java.util.Map.Entry) Optional(java.util.Optional) IntSummaryStatistics(java.util.IntSummaryStatistics) Comparator(java.util.Comparator) LongSummaryStatistics(java.util.LongSummaryStatistics) Assert.assertEquals(org.junit.Assert.assertEquals) DoubleSummaryStatistics(java.util.DoubleSummaryStatistics) Test(org.junit.Test)

Example 47 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project hazelcast-jet by hazelcast.

the class DoubleStreamTest method summaryStatistics.

@Test
public void summaryStatistics() {
    DoubleSummaryStatistics longSummaryStatistics = stream.summaryStatistics();
    assertEquals(COUNT, longSummaryStatistics.getCount());
    assertEquals(COUNT - 1, longSummaryStatistics.getMax(), 0D);
    assertEquals(0, longSummaryStatistics.getMin(), 0D);
    assertEquals(COUNT * (COUNT - 1) / 2, longSummaryStatistics.getSum(), 0D);
    assertEquals((COUNT - 1) / 2D, longSummaryStatistics.getAverage(), 0D);
}
Also used : DoubleSummaryStatistics(java.util.DoubleSummaryStatistics) Test(org.junit.Test)

Example 48 with DoubleSummaryStatistics

use of java.util.DoubleSummaryStatistics in project keycloak by keycloak.

the class ClosingDoubleStream method summaryStatistics.

@Override
public DoubleSummaryStatistics summaryStatistics() {
    DoubleSummaryStatistics result = delegate.summaryStatistics();
    close();
    return result;
}
Also used : DoubleSummaryStatistics(java.util.DoubleSummaryStatistics)

Aggregations

DoubleSummaryStatistics (java.util.DoubleSummaryStatistics)48 Arrays (java.util.Arrays)9 List (java.util.List)9 Nullable (javax.annotation.Nullable)9 Test (org.junit.Test)9 Layer (com.simiacryptus.mindseye.lang.Layer)8 Tensor (com.simiacryptus.mindseye.lang.Tensor)8 LongSummaryStatistics (java.util.LongSummaryStatistics)8 IntStream (java.util.stream.IntStream)8 Nonnull (javax.annotation.Nonnull)8 TrainingMonitor (com.simiacryptus.mindseye.opt.TrainingMonitor)7 Map (java.util.Map)6 LoggingWrapperLayer (com.simiacryptus.mindseye.layers.java.LoggingWrapperLayer)5 MonitoringWrapperLayer (com.simiacryptus.mindseye.layers.java.MonitoringWrapperLayer)5 StochasticComponent (com.simiacryptus.mindseye.layers.java.StochasticComponent)5 DAGNetwork (com.simiacryptus.mindseye.network.DAGNetwork)5 DAGNode (com.simiacryptus.mindseye.network.DAGNode)5 Step (com.simiacryptus.mindseye.opt.Step)5 MonitoredObject (com.simiacryptus.util.MonitoredObject)5 DoubleStatistics (com.simiacryptus.util.data.DoubleStatistics)5