Package com.nr.ran

Examples of com.nr.ran.Ran.doub()


    System.out.println("Testing Shep_interp");
    Ran myran = new Ran(17);
    double[][] pt = new double[M][2];
    for (i=0;i<M;i++) {
      pt[i][0]=(double)(N)*myran.doub();
      pt[i][1]=(double)(N)*myran.doub();
      actual[i]=cos(pt[i][0]/20.0)*cos(pt[i][1]/20.0);
    }
    for (i=0;i<N;i++) {
      for (j=0;j<N;j++) {
        k=N*i+j;
 
View Full Code Here


    Studenttdist normc = new Studenttdist(n,m,s);
    Ran myran = new Ran(17);
    sbeps=1.0e-13;
    localflag=false;
    for (i=0;i<1000;i++) {
      u=m-3.0*s+6.0*s*myran.doub();
      a=normc.cdf(u);
      b=normc.invcdf(a);
//      System.out.printf(setprecision(15) << u << " %f\n", b << " %f\n", abs(u-b));
      localflag = localflag || abs(u-b) > sbeps;
    }
View Full Code Here

    n=2.0;m=0.5;s=1.5;
    Studenttdist normaa2 = new Studenttdist(n,m,s);
    sbeps=1.0e-13;
    localflag=false;
    for (i=0;i<1000;i++) {
      u=m+3.0*s*myran.doub();
      a=normaa2.aa(u);
      b=normaa2.invaa(a);
//      System.out.printf(setprecision(15) << u << " %f\n", b << " %f\n", abs(u-b));
      localflag = localflag || abs(u-b) > sbeps;
    }
View Full Code Here

      p31.x[1]=myran.doub();
      p31.x[2]=myran.doub();
      radius1=myran.doub();
      Sphcirc sph1=new Sphcirc(p31,radius1);

      p32.x[0]=myran.doub();
      p32.x[1]=myran.doub();
      p32.x[2]=myran.doub();

//      System.out.printf(sph2.contains(p32));
      test=(sph1.contains(p32) != 0);
View Full Code Here

      p31.x[2]=myran.doub();
      radius1=myran.doub();
      Sphcirc sph1=new Sphcirc(p31,radius1);

      p32.x[0]=myran.doub();
      p32.x[1]=myran.doub();
      p32.x[2]=myran.doub();

//      System.out.printf(sph2.contains(p32));
      test=(sph1.contains(p32) != 0);
      localflag = (test != (dist(p31,p32) < radius1));
View Full Code Here

      radius1=myran.doub();
      Sphcirc sph1=new Sphcirc(p31,radius1);

      p32.x[0]=myran.doub();
      p32.x[1]=myran.doub();
      p32.x[2]=myran.doub();

//      System.out.printf(sph2.contains(p32));
      test=(sph1.contains(p32) != 0);
      localflag = (test != (dist(p31,p32) < radius1));
      globalflag = globalflag || localflag;
View Full Code Here

      }
    }

    // Test method collides() in 3D
    for (i=0;i<N;i++) {
      p31.x[0]=myran.doub();
      p31.x[1]=myran.doub();
      p31.x[2]=myran.doub();
      radius1=0.5*myran.doub();
      Sphcirc sph1=new Sphcirc(p31,radius1);

View Full Code Here

    }

    // Test method collides() in 3D
    for (i=0;i<N;i++) {
      p31.x[0]=myran.doub();
      p31.x[1]=myran.doub();
      p31.x[2]=myran.doub();
      radius1=0.5*myran.doub();
      Sphcirc sph1=new Sphcirc(p31,radius1);

      p32.x[0]=myran.doub();
View Full Code Here

    // Test method collides() in 3D
    for (i=0;i<N;i++) {
      p31.x[0]=myran.doub();
      p31.x[1]=myran.doub();
      p31.x[2]=myran.doub();
      radius1=0.5*myran.doub();
      Sphcirc sph1=new Sphcirc(p31,radius1);

      p32.x[0]=myran.doub();
      p32.x[1]=myran.doub();
View Full Code Here

    // Create two disjoint sets of points
    Ran myran=new Ran(17);
    for (i=0;i<M/2;i++) {
      y[i]=1.0;
      a=myran.doub();
      b=2.0*myran.doub()-1.0;
      data[i][0]=1.0+(a-b);
      data[i][1]=1.0+(a+b);
    }

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.