Package com.nr.min

Examples of com.nr.min.Linemethod


   

    // Test Linemethod
    System.out.println("Testing Linemethod");
    Linemethod line=new Linemethod(this);

    p[0]=p[1]=p[2]=0.0;
    xi[0]=1.0;
    xi[1]=xi[2]=0.0;
    line.p=p;
    line.xi=xi;
    f0=line.linmin();
    d0=sqrt(SQR(line.p[0])+SQR(line.p[1])+SQR(line.p[2]));

    for (i=0;i<N;i++) {
      p[0]=0.1;
      p[1]=0.1;
      p[2]=-0.1;
      theta=pi*i/N;
      phi=pi*i/N;
      xi[0]=sin(phi)*cos(theta);
      xi[1]=sin(phi)*sin(theta);
      xi[2]=cos(phi);
      line.p=p;
      line.xi=xi;
      f=line.linmin();
      d=sqrt(SQR(line.p[0])+SQR(line.p[1])+SQR(line.p[2]));
//      System.out.printf(abs(d-d0) << " " << abs(f-f0));

      localflag = localflag || abs(d-d0) > sbeps1;
      globalflag = globalflag || localflag;
View Full Code Here

TOP

Related Classes of com.nr.min.Linemethod

Copyright © 2018 www.massapicom. 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.