Package com.nr.ran

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


    // 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();
      p32.x[2]=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);
    }

    for (i=M/2;i<M;i++) {
View Full Code Here

      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();
      p32.x[2]=myran.doub();
      radius2=0.5*myran.doub();
      Sphcirc sph2=new Sphcirc(p32,radius2);

View Full Code Here

      data[i][1]=1.0+(a+b);
    }

    for (i=M/2;i<M;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

      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();
      p32.x[2]=myran.doub();
      radius2=0.5*myran.doub();
      Sphcirc sph2=new Sphcirc(p32,radius2);

//      System.out.printf(sph3.collides(sph4));
View Full Code Here

    }

    for (i=M/2;i<M;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);
    }
   
    // Linear kernel
View Full Code Here

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

      p32.x[0]=myran.doub();
      p32.x[1]=myran.doub();
      p32.x[2]=myran.doub();
      radius2=0.5*myran.doub();
      Sphcirc sph2=new Sphcirc(p32,radius2);

//      System.out.printf(sph3.collides(sph4));
      test=(sph1.collides(sph2) != 0);
View Full Code Here

      Sphcirc sph1=new Sphcirc(p31,radius1);

      p32.x[0]=myran.doub();
      p32.x[1]=myran.doub();
      p32.x[2]=myran.doub();
      radius2=0.5*myran.doub();
      Sphcirc sph2=new Sphcirc(p32,radius2);

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

    Ran myran=new Ran(17);
    for (i=0;i<nn.length;i++) N *= nn[i];
    N *= 2;
    double[] data1=new double[N],data2=new double[N];
    // Round-trip test for random numbers
    for (i=0;i<N;i++) data1[i] = myran.doub();
    for (i=0;i<N;i++) data2[i] = (2.0/N)*data1[i];
    fourn(data2,nn,1);
    fourn(data2,nn,-1);
//    System.out.printf(maxel(vecsub(data1,data2)));
    localflag = localflag || maxel(vecsub(data1,data2)) > sbeps;
View Full Code Here

    // Test sort
    System.out.println("Testing sort");
    localflag=false;
    Ran myran = new Ran(17);
    for (i=0;i<N;i++) x[i]=myran.doub();
    Sorter.sort(x);
    for (i=0;i<N-1;i++) localflag = localflag || (x[i] > x[i+1]);
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** sort: Sorted values are not correctly ordered");
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.