Package com.nr.la

Examples of com.nr.la.SVD.solve()


    // Test SVD (not very deeply, however)
    System.out.println("Testing SVD");
    SVD svd = new SVD(a);
    double[][] x = new double[b.length][b[0].length];
    svd.solve(b,x);
    sbeps = 1.e-14;
    localflag = maxel(matsub(matmul(a,x),b)) > sbeps;
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** SVD: Inconsistent solution vector");
View Full Code Here


            power *= xs[i];
            u[i][j]=power;
          }
        }
        SVD svd = new SVD(u);
        svd.solve(bb,coff);
        devmax=sum=0.0;
        Ratfn rat = new Ratfn(coff,mm+1,kk+1);
        for (j=0;j<npt;j++) {
          ee[j]=rat.get(xs[j])-fs[j];
          wt[j]=abs(ee[j]);
View Full Code Here

    double[] x = new double[3];
    System.out.println(svd.inv_condition());
    System.out.println(svd.rank());
    System.out.println(svd.nullity());
   
    svd.solve(b, x);
    System.out.println(NRUtil.toString(x));
  }
}
View Full Code Here

      for (j=0;j<ma;j++) aa[i][j]=afunc[j]*tmp;
      b[i]=y[i]*tmp;
    }
    SVD svd = new SVD(aa);   // Singular value decomposition
    thresh = (tol > 0. ? tol*svd.w[0] : -1.);
    svd.solve(b,a,thresh);    // Solve for the coefficients
    chisq=0.0;   // Evaluate chi-square
    for (i=0;i<ndat;i++) {
      sum=0.;
      for (j=0;j<ma;j++) sum += aa[i][j]*a[j];
      chisq += SQR(sum-b[i]);
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.