Package com.nr.min

Examples of com.nr.min.Bracketmethod


    // Test Bracketmethod
    System.out.println("Testing Bracketmethod");

    Ran myran=new Ran(17);
    Bracketmethod br = new Bracketmethod();
    for (i=0;i<N;i++) {
      a=50.0*myran.doub();
      b=a+span;
      br.bracket(a,b,this);
//      System.out.printf(br.ax << " " << br.bx << " " << br.cx);
//      System.out.printf(br.fa << " " << br.fb << " " << br.fc << endl);
      localflag = localflag || (br.fa < br.fb) || (br.fc < br.fb);
    }
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Bracketmethod: Faulty bracket center value not the smallest");
     
    }

    double sbeps=3.e-16;
    for (i=0;i<N;i++) {
      a=50.0*myran.doub();
      b=a+span;
      br.bracket(a,b,this);
      localflag = localflag || abs(br.fa - funk(br.ax))>sbeps
        || abs(br.fb - funk(br.bx))>sbeps
        || abs(br.fc - funk(br.cx))>sbeps;
    }
    globalflag = globalflag || localflag;
View Full Code Here

TOP

Related Classes of com.nr.min.Bracketmethod

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.