Examples of aggregate()


Examples of algorithm.inhereitance.AveragingAggregator.aggregate()

  @Test
  public void AveragingAggregagtor_Produces_Average() {
    AveragingAggregator aggregator = new AveragingAggregator(measurements);

    Measurement result = aggregator.aggregate();

    assertEquals(35, result.getX());
    assertEquals(10, result.getY());
  }
View Full Code Here

Examples of algorithm.inhereitance.LowPassAveragingAggregator.aggregate()

  @Test
  public void LowPassAveragingAggregator_Applys_Filter() {
    LowPassAveragingAggregator aggregator = new LowPassAveragingAggregator(measurements);

    Measurement result = aggregator.aggregate();

    assertEquals(3, result.getX());
    assertEquals(12, result.getY());
  }
View Full Code Here

Examples of algorithm.inhereitance.SummingAggregator.aggregate()

  @Test
  public void SummingAggregation_Produces_Sum() {
    SummingAggregator aggregator = new SummingAggregator(measurements);

    Measurement result = aggregator.aggregate();

    assertEquals(107, result.getX());
    assertEquals(30, result.getY());
  }
View Full Code Here

Examples of ar.Renderer.aggregate()

    Aggregator<Object,Integer> aggregator = new Numbers.Count<Object>();
    Selector<Point2D> selector = TouchesPixel.make(dataset);


    AffineTransform vt = Util.zoomFit(dataset.bounds(), width, height);
    Aggregates<Integer> aggregates = r.aggregate(dataset, selector, aggregator, vt, width, height);

   
    Map<String, Transfer<Integer,Integer>> allCarvers = new HashMap<String, Transfer<Integer,Integer>>() {{
        put("incremental", new SeamCarving.CarveIncremental<>(new SeamCarving.LeftValue<Integer>(), Direction.V, 0,seams));
        put("sweep", new SeamCarving.CarveSweep<>(new SeamCarving.LeftValue<Integer>(), Direction.V, 0, seams));
View Full Code Here

Examples of ar.renderers.ParallelRenderer.aggregate()

    Aggregator<Object,Integer> aggregator = new Numbers.Count<Object>();
    Selector<Point2D> selector = TouchesPixel.make(dataset);


    AffineTransform vt = Util.zoomFit(dataset.bounds(), width, height);
    Aggregates<Integer> aggregates = r.aggregate(dataset, selector, aggregator, vt, width, height);

   
    Map<String, Transfer<Integer,Integer>> allCarvers = new HashMap<String, Transfer<Integer,Integer>>() {{
        put("incremental", new SeamCarving.CarveIncremental<>(new SeamCarving.LeftValue<Integer>(), Direction.V, 0,seams));
        put("sweep", new SeamCarving.CarveSweep<>(new SeamCarving.LeftValue<Integer>(), Direction.V, 0, seams));
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix1D.aggregate()

  }
));
//--> 14

// Sum( x[i]*x[i] )
System.out.println(matrix.aggregate(F.plus,F.square));
//--> 14

// Sum( x[i]*x[i]*x[i] )
System.out.println(matrix.aggregate(F.plus,F.pow(3)));
//--> 36
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix1D.aggregate()

// Sum( x[i]*x[i] )
System.out.println(matrix.aggregate(F.plus,F.square));
//--> 14

// Sum( x[i]*x[i]*x[i] )
System.out.println(matrix.aggregate(F.plus,F.pow(3)));
//--> 36

// Sum( x[i] )
System.out.println(matrix.aggregate(F.plus,F.identity));
//--> 6
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix1D.aggregate()

// Sum( x[i]*x[i]*x[i] )
System.out.println(matrix.aggregate(F.plus,F.pow(3)));
//--> 36

// Sum( x[i] )
System.out.println(matrix.aggregate(F.plus,F.identity));
//--> 6

// Min( x[i] )
System.out.println(matrix.aggregate(F.min,F.identity));
//--> 0
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix1D.aggregate()

// Sum( x[i] )
System.out.println(matrix.aggregate(F.plus,F.identity));
//--> 6

// Min( x[i] )
System.out.println(matrix.aggregate(F.min,F.identity));
//--> 0

// Max( Sqrt(x[i]) / 2 )
System.out.println(matrix.aggregate(F.max,F.chain(F.div(2),F.sqrt)));
//--> 0.8660254037844386
View Full Code Here

Examples of cern.colt.matrix.DoubleMatrix1D.aggregate()

// Min( x[i] )
System.out.println(matrix.aggregate(F.min,F.identity));
//--> 0

// Max( Sqrt(x[i]) / 2 )
System.out.println(matrix.aggregate(F.max,F.chain(F.div(2),F.sqrt)));
//--> 0.8660254037844386

// Number of all cells with 0 <= value <= 2
System.out.println(matrix.aggregate(F.plus,F.between(0,2)));
//--> 3
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.