Examples of interp()


Examples of com.nr.interp.BaryRat_interp.interp()

    Ran myran = new Ran(17);
    for (j=0;j<M;j++) {
      BaryRat_interp z = new BaryRat_interp(x,y,j);
      for (i=0;i<N;i++) {
        xx[i]=2.0*myran.doub();
        yy[i]=z.interp(xx[i]);      // interpolated values
        zz[i]=func_BaryRat(xx[i]);    // Actual values
      }
      dy=maxel(vecsub(zz,yy));
      System.out.printf("     BaryRat_interp: Order: %d  Max. error:    %f\n", j, dy);
      sbeps=pow(10.0,-(j+4.0)/2)*ymax;
 
View Full Code Here

Examples of com.nr.interp.Bilin_interp.interp()

    Bilin_interp z = new Bilin_interp(x1,x2,y);
    Ran myran = new Ran(17);
    for (i=0;i<N;i++) {
      xx1=myran.doub();
      xx2=myran.doub();
      yy[i]=z.interp(xx1,xx2)// interpolated values
      zz[i]=xx1+xx2;        // Actual values
    }
    sbeps=1.e-15;
    System.out.printf("     Bilin_interp: Max. actual error:    %f\n", maxel(vecsub(zz,yy)));
    localflag = maxel(vecsub(zz,yy)) > sbeps;
View Full Code Here

Examples of com.nr.interp.Curve_interp.interp()

    target[0]=2.5*vec[0];
    target[1]=2.5*vec[1];
    target[2]=2.5*vec[2];
//    System.out.printf(target[0] << " " << target[1] << " " << target[2] << endl;
    Curve_interp myCurve = new Curve_interp(ptsin);
    double[] f=myCurve.interp(2.5/(NPTS-1))
//    System.out.printf(f[0]/target[0] << " " << f[1]/target[1] << " " << f[2]/target[2] << endl;
    sbeps=1.e-3;
    System.out.printf("     Discrepancy (straight line): %f\n", maxel(vecsub(f,target)));
    localflag = maxel(vecsub(f,target)) > sbeps;
    globalflag = globalflag || localflag;
View Full Code Here

Examples of com.nr.interp.Curve_interp.interp()

    target[1]=a[1]*cos(theta)+b[1]*sin(theta);
    target[2]=a[2]*cos(theta)+b[2]*sin(theta);
//    System.out.printf(target[0] << " " << target[1] << " " << target[2] << endl;
    close=true;
    Curve_interp myCurve2 = new Curve_interp(ptsin,close);
    f=myCurve2.interp(2.5/NPTS);
//    System.out.printf(f[0]/target[0] << " " << f[1]/target[1] << " " << f[2]/target[2] << endl;
    sbeps=1.e-4;
    System.out.printf("     Discrepancy (circle): %f\n", maxel(vecsub(f,target)));
    localflag = maxel(vecsub(f,target)) > sbeps;
    globalflag = globalflag || localflag;
View Full Code Here

Examples of com.nr.interp.Krig.interp()

    Powvargram vgram = new Powvargram(pts,y);
    Krig krig = new Krig(pts,y,vgram);
    for (i=0;i<M;i++) {
      ppt[0]=pt[i][0];
      ppt[1]=pt[i][1];
      estim[i]=krig.interp(ppt);
    }
    System.out.printf("     Discrepancy: %f\n", maxel(vecsub(actual,estim)));
    localflag = maxel(vecsub(actual,estim)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here

Examples of com.nr.interp.Linear_interp.interp()

    }
    Linear_interp z = new Linear_interp(x,y);
    Ran myran = new Ran(17);
    for (i=0;i<N;i++) {
      xx[i]=(N-1)*myran.doub();
      yy[i]=z.interp(xx[i]);    // interpolated values
      zz[i]=2.0*xx[i];      // Correct values
    }
    localflag = maxel(vecsub(zz,yy)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here

Examples of com.nr.interp.Poly2D_interp.interp()

   

    // Test Poly2D_interp
    System.out.println("Testing Poly2D_interp");
    Poly2D_interp z = new Poly2D_interp(x1,x2,y,3,3);
    localflag = abs(z.interp(2.5,2.5)-5.0) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Poly2D_interp: Inaccurate 2D polynomial interpolation.");
     
    }
View Full Code Here

Examples of com.nr.interp.Poly_interp.interp()

    }
    Ran myran = new Ran(17);
    Poly_interp z = new Poly_interp(x,y,3);
    for (i=0;i<N;i++) {
      xx[i]=myran.doub();
      yy[i]=z.interp(xx[i]);    // interpolated values
      dyy[i]=z.dy;        // Estimated errors
      zz[i]=1.0+xx[i]*(1.0+xx[i]*(1.0+xx[i]*(1.0+xx[i])))// Actual Values
    }
    System.out.printf("     Poly_interp: Max. estimated error: %f\n", maxel(dyy));
    System.out.printf("     Poly_interp: Max. actual error:    %f\n", maxel(vecsub(zz,yy)));
View Full Code Here

Examples of com.nr.interp.RBF_interp.interp()

    RBF_multiquadric multiquadric = new RBF_multiquadric(scale);
    RBF_interp myRBFmqf = new RBF_interp(pts,y,multiquadric,false);
    for (i=0;i<M;i++) {
      ppt[0]=pt[i][0];
      ppt[1]=pt[i][1];
      estim[i]=myRBFmqf.interp(ppt);
    }
    System.out.printf("     Discrepancy: %f\n", maxel(vecsub(actual,estim)));
    localflag = maxel(vecsub(actual,estim)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here

Examples of com.nr.interp.RBF_interp.interp()

    RBF_thinplate thinplate = new RBF_thinplate(scale);
    RBF_interp myRBFtpf = new RBF_interp(pts,y,thinplate,false);
    for (i=0;i<M;i++) {
      ppt[0]=pt[i][0];
      ppt[1]=pt[i][1];
      estim[i]=myRBFtpf.interp(ppt);
    }
    System.out.printf("     Discrepancy: %f\n", maxel(vecsub(actual,estim)));
    localflag = maxel(vecsub(actual,estim)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
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.