Package cern.colt.function

Examples of cern.colt.function.DoubleDoubleFunction.apply()


  double b = 0.2;
  double v = Math.sin(a) + Math.pow(Math.cos(b),2);
  System.out.println(v);
  DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
  //DoubleDoubleFunction f = F.chain(plus,sin,F.chain(square,cos));
  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.sin(x) + Math.pow(Math.cos(y),2); }
  };
  System.out.println(g.apply(a,b));
  DoubleFunction m = F.plus(3);
View Full Code Here


  //DoubleDoubleFunction f = F.chain(plus,sin,F.chain(square,cos));
  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.sin(x) + Math.pow(Math.cos(y),2); }
  };
  System.out.println(g.apply(a,b));
  DoubleFunction m = F.plus(3);
  DoubleFunction n = F.plus(4);
  System.out.println(m.apply(0));
  System.out.println(n.apply(0));
}
View Full Code Here

  //DoubleDoubleFunction f = F.chain(F.plus,F.identity,F.identity);
  DoubleDoubleFunction f = F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)));
  //DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
  //DoubleDoubleFunction f = F.plus;
 
  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.abs(Math.sin(x) + Math.pow(Math.cos(y),2)); }
    //public final double apply(double x, double y) { return x+y; }
  };
  System.out.println(g.apply(a,b));
View Full Code Here

  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.abs(Math.sin(x) + Math.pow(Math.cos(y),2)); }
    //public final double apply(double x, double y) { return x+y; }
  };
  System.out.println(g.apply(a,b));

  // emptyLoop
  cern.colt.Timer emptyLoop = new cern.colt.Timer().start();
  a = 0; b = 0;
  double sum = 0;
View Full Code Here

   
  timer.reset().start();
  a = 0; b = 0;
  sum = 0;
  for (int i=size; --i >= 0; ) {
    sum += g.apply(a,b);
    a++; b++;
  }
  timer.stop().display();
  System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
  System.out.println("sum="+sum);
View Full Code Here

  double b = 0.2;
  double v = Math.sin(a) + Math.pow(Math.cos(b),2);
  System.out.println(v);
  DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
  //DoubleDoubleFunction f = F.chain(plus,sin,F.chain(square,cos));
  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.sin(x) + Math.pow(Math.cos(y),2); }
  };
  System.out.println(g.apply(a,b));
  DoubleFunction m = F.plus(3);
View Full Code Here

  //DoubleDoubleFunction f = F.chain(plus,sin,F.chain(square,cos));
  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.sin(x) + Math.pow(Math.cos(y),2); }
  };
  System.out.println(g.apply(a,b));
  DoubleFunction m = F.plus(3);
  DoubleFunction n = F.plus(4);
  System.out.println(m.apply(0));
  System.out.println(n.apply(0));
}
View Full Code Here

  //DoubleDoubleFunction f = F.chain(F.plus,F.identity,F.identity);
  DoubleDoubleFunction f = F.chain(F.abs,F.chain(F.plus,F.sin,F.chain(F.square,F.cos)));
  //DoubleDoubleFunction f = F.chain(F.plus,F.sin,F.chain(F.square,F.cos));
  //DoubleDoubleFunction f = F.plus;
 
  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.abs(Math.sin(x) + Math.pow(Math.cos(y),2)); }
    //public final double apply(double x, double y) { return x+y; }
  };
  System.out.println(g.apply(a,b));
View Full Code Here

  System.out.println(f.apply(a,b));
  DoubleDoubleFunction g = new DoubleDoubleFunction() {
    public final double apply(double x, double y) { return Math.abs(Math.sin(x) + Math.pow(Math.cos(y),2)); }
    //public final double apply(double x, double y) { return x+y; }
  };
  System.out.println(g.apply(a,b));

  // emptyLoop
  cern.colt.Timer emptyLoop = new cern.colt.Timer().start();
  a = 0; b = 0;
  double sum = 0;
View Full Code Here

   
  timer.reset().start();
  a = 0; b = 0;
  sum = 0;
  for (int i=size; --i >= 0; ) {
    sum += g.apply(a,b);
    a++; b++;
  }
  timer.stop().display();
  System.out.println("evals / sec = "+size / timer.minus(emptyLoop).seconds());
  System.out.println("sum="+sum);
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.