Package cern.colt.matrix

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


double[] values = {0, 1, 2, 3};
DoubleMatrix1D matrix = new DenseDoubleMatrix1D(values);
System.out.println(matrix);

// Sum( x[i]*x[i] )
System.out.println(matrix.viewSelection(
  new cern.colt.function.DoubleProcedure() {
    public final boolean apply(double a) { return a % 2 == 0; }
  }
));
//--> 14
View Full Code Here


double[] values = {0, 1, 2, 3};
DoubleMatrix1D matrix = new DenseDoubleMatrix1D(values);
System.out.println(matrix);

// Sum( x[i]*x[i] )
System.out.println(matrix.viewSelection(
  new cern.colt.function.DoubleProcedure() {
    public final boolean apply(double a) { return a % 2 == 0; }
  }
));
//--> 14
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.