Examples of aggregate()


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

// 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

// Number of all cells with 0.8 <= Log2(value) <= 1.2
System.out.println(matrix.aggregate(F.plus,F.chain(F.between(0.8,1.2),F.log2)));
//--> 1
View Full Code Here

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

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

// Number of all cells with 0.8 <= Log2(value) <= 1.2
System.out.println(matrix.aggregate(F.plus,F.chain(F.between(0.8,1.2),F.log2)));
//--> 1

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

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

// Number of all cells with 0.8 <= Log2(value) <= 1.2
System.out.println(matrix.aggregate(F.plus,F.chain(F.between(0.8,1.2),F.log2)));
//--> 1

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

// Product( x[i] ) of all x[i] > limit
final double limit = 1;
DoubleFunction f = new DoubleFunction() {
View Full Code Here

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

// Product( x[i] ) of all x[i] > limit
final double limit = 1;
DoubleFunction f = new DoubleFunction() {
  public final double apply(double a) { return a>limit ? a : 1; }
};
System.out.println(matrix.aggregate(F.mult,f));
//--> 6

// Sum( (x[i]+y[i])^2 )
DoubleMatrix1D otherMatrix1D = matrix.copy();
System.out.println(matrix.aggregate(otherMatrix1D, F.plus, F.chain(F.square,F.plus)));
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

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

DoubleMatrix3D x = cern.colt.matrix.DoubleFactory3D.dense.ascending(2,2,2);
System.out.println(x);

// Sum( x[slice,row,col]*x[slice,row,col] )
System.out.println(x.aggregate(F.plus,F.square));
//--> 140


DoubleMatrix3D y = x.copy();
// Sum( (x[i]+y[i])^2 )
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.