Package com.nr.la

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


      }
      if (norm) rhs[i] = sum*vals[i];
      else rhs[i] = vals[i];
    }
    LUdcmp lu = new LUdcmp(rbf);   // Solve the set of linear equations
    lu.solve(rhs,w);
  }

  /**
   * Return the interpolated function value at a dim-dimensional point pt.
   *
 
View Full Code Here


    for (j=0;j<n;j++) {
      y[j]=cof[n+j+1];
      for (k=0;k<n;k++) q[j][k]=cof[j-k+n];
    }
    LUdcmp lu = new LUdcmp(q);
    lu.solve(y,x);
    for (j=0;j<4;j++) lu.mprove(y,x);
    for (k=0;k<n;k++) {
      for (sum=cof[k+1],j=0;j<=k;j++) sum -= x[j]*cof[k-j];
      y[k]=sum;
    }
View Full Code Here

    LUdcmp alu = new LUdcmp(a);
    double xnew=x+h;
    derivs.derivs(xnew,y,del);
    for (int i=0;i<n;i++)
      ytemp[i]=y[i];
    alu.solve(del,del);
    if (dense && nstep==k+1) {
      ipt.val++;
      for (int i=0;i<n;i++)
        fsave[ipt.val][i]=del[i];
    }
View Full Code Here

          del1 += SQR(del[i]/scale[i]);
        del1=sqrt(del1);
        derivs.derivs(x+h,ytemp,dytemp);
        for (int i=0;i<n;i++)
          del[i]=dytemp[i]-del[i]/h;
        alu.solve(del,del);
        double del2=0.0;
        for (int i=0;i<n;i++)
          del2 += SQR(del[i]/scale[i]);
        del2=sqrt(del2);
        theta=del2/max(1.0,del1);
View Full Code Here

        del2=sqrt(del2);
        theta=del2/max(1.0,del1);
        if (theta > 1.0)
          return false;
      }
      alu.solve(yend,del);
      if (dense && nn >= nstep-k-1) {
        ipt.val++;
        for (int i=0;i<n;i++)
          fsave[ipt.val][i]=del[i];
      }
View Full Code Here

      a[i][i] += 1.0/(gam*h);
    }
    LUdcmp alu = new LUdcmp(a);
    for (i=0;i<n;i++)
      ytemp[i]=dydx[i]+h*d1*dfdx[i];
    alu.solve(ytemp,k1);
    for (i=0;i<n;i++)
      ytemp[i]=y[i]+a21*k1[i];
    derivs.derivs(x+c2*h,ytemp,dydxnew);
    for (i=0;i<n;i++)
      ytemp[i]=dydxnew[i]+h*d2*dfdx[i]+c21*k1[i]/h;
 
View Full Code Here

    for (i=0;i<n;i++)
      ytemp[i]=y[i]+a21*k1[i];
    derivs.derivs(x+c2*h,ytemp,dydxnew);
    for (i=0;i<n;i++)
      ytemp[i]=dydxnew[i]+h*d2*dfdx[i]+c21*k1[i]/h;
    alu.solve(ytemp,k2);
    for (i=0;i<n;i++)
      ytemp[i]=y[i]+a31*k1[i]+a32*k2[i];
    derivs.derivs(x+c3*h,ytemp,dydxnew);
    for (i=0;i<n;i++)
      ytemp[i]=dydxnew[i]+h*d3*dfdx[i]+(c31*k1[i]+c32*k2[i])/h;
 
View Full Code Here

    for (i=0;i<n;i++)
      ytemp[i]=y[i]+a31*k1[i]+a32*k2[i];
    derivs.derivs(x+c3*h,ytemp,dydxnew);
    for (i=0;i<n;i++)
      ytemp[i]=dydxnew[i]+h*d3*dfdx[i]+(c31*k1[i]+c32*k2[i])/h;
    alu.solve(ytemp,k3);
    for (i=0;i<n;i++)
      ytemp[i]=y[i]+a41*k1[i]+a42*k2[i]+a43*k3[i];
    derivs.derivs(x+c4*h,ytemp,dydxnew);
    for (i=0;i<n;i++)
      ytemp[i]=dydxnew[i]+h*d4*dfdx[i]+(c41*k1[i]+c42*k2[i]+c43*k3[i])/h;
 
View Full Code Here

    for (i=0;i<n;i++)
      ytemp[i]=y[i]+a41*k1[i]+a42*k2[i]+a43*k3[i];
    derivs.derivs(x+c4*h,ytemp,dydxnew);
    for (i=0;i<n;i++)
      ytemp[i]=dydxnew[i]+h*d4*dfdx[i]+(c41*k1[i]+c42*k2[i]+c43*k3[i])/h;
    alu.solve(ytemp,k4);
    for (i=0;i<n;i++)
      ytemp[i]=y[i]+a51*k1[i]+a52*k2[i]+a53*k3[i]+a54*k4[i];
    double xph=x+h;
    derivs.derivs(xph,ytemp,dydxnew);
    for (i=0;i<n;i++)
View Full Code Here

      ytemp[i]=y[i]+a51*k1[i]+a52*k2[i]+a53*k3[i]+a54*k4[i];
    double xph=x+h;
    derivs.derivs(xph,ytemp,dydxnew);
    for (i=0;i<n;i++)
      k6[i]=dydxnew[i]+(c51*k1[i]+c52*k2[i]+c53*k3[i]+c54*k4[i])/h;
    alu.solve(k6,k5);
    for (i=0;i<n;i++)
      ytemp[i] += k5[i];
    derivs.derivs(xph,ytemp,dydxnew);
    for (i=0;i<n;i++)
      k6[i]=dydxnew[i]+(c61*k1[i]+c62*k2[i]+c63*k3[i]+c64*k4[i]+c65*k5[i])/h;
 
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.