Package com.nr

Examples of com.nr.Complex.abs()


      Complex r = a[4].add(rts[i].mul(a[5]));
      r = a[3].add(rts[i].mul(r));
      r = a[2].add(rts[i].mul(r));
      r = a[1].add(rts[i].mul(r));
      r = a[0].add(rts[i].mul(r));
      dy[i]=r.abs();
    }
    System.out.printf("zroots: Maximum discrepancy = %f\n", maxel(dy));
    localflag = maxel(dy) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here


      Complex r = a[4].add(x.mul(a[5]));
      r = a[3].add(x.mul(r));
      r = a[2].add(x.mul(r));
      r = a[1].add(x.mul(r));
      r = a[0].add(x.mul(r));
      dy[i] = r.abs();
      //dy[i]=abs(a[0]+x*(a[1]+x*(a[2]+x*(a[3]+x*(a[4]+x*a[5])))));
     
    }
    System.out.printf("laguer: Maximum discrepancy = %f\n", maxel(dy));
    localflag = maxel(dy) > sbeps;
View Full Code Here

      r = p[3].add(rts2[j].mul(r));
      r = p[2].add(rts2[j].mul(r));
      r = p[1].add(rts2[j].mul(r));
      r = p[0].add(rts2[j].mul(r));
     
      err += r.abs();
    }
    System.out.printf("qroot: Discrepancy = %f\n", abs(err));
    localflag = abs(err) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here

      Complex r = p[4].add(rts2[j].mul(p[5]));
      r = p[3].add(rts2[j].mul(r));
      r = p[2].add(rts2[j].mul(r));
      r = p[1].add(rts2[j].mul(r));
      r = p[0].add(rts2[j].mul(r));
      err += r.abs();
    }
    System.out.printf("qroot: Discrepancy = %f\n", abs(err));
    localflag = abs(err) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here

    // Roots of polynomial 
    zrhqr(aa,rts);
    for (i=0;i<N;i++) {
      b=new Complex(a[5]);
      for (j=0;j<5;j++) b=b.mul(rts[i]).add(new Complex(a[4-j]));
      dy[i]=b.abs();
//      System.out.printf(b << "  %f\n", dy[i]);
    }
    System.out.printf("zrhqr: Maximum discrepancy = %f\n", maxel(dy));
    localflag = maxel(dy) > sbeps;
    globalflag = globalflag || 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.