Package com.nr.ran

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


    // Test kstwo
    System.out.println("Testing kstwo");

    Ran myran=new Ran(17);
    for (j=0;j<NPTS;j++) data1[j]=myran.doub();
    kstwo(data1,data1,d1,prob1);
//    System.out.printf(setw(17) << d1 << setw(17) << prob1);
    localflag = localflag || (d1.val != 0.0);
    globalflag = globalflag || localflag;
    if (localflag) {
View Full Code Here


    System.out.println("Testing ks2d1s");

    Ran myran=new Ran(17);
    for (i=0;i<NTRIAL;i++) {
      for (j=1;j<NPT;j++)
        x[j]=2.0*myran.doub()-1.0;
      for (j=1;j<NPT;j++)
        y[j]=2.0*myran.doub()-1.0;
      ks2d1s(x,y,quadvl,dd,pprob);
      d[i]=dd.val;
      prob[i]=pprob.val;
View Full Code Here

    Ran myran=new Ran(17);
    for (i=0;i<NTRIAL;i++) {
      for (j=1;j<NPT;j++)
        x[j]=2.0*myran.doub()-1.0;
      for (j=1;j<NPT;j++)
        y[j]=2.0*myran.doub()-1.0;
      ks2d1s(x,y,quadvl,dd,pprob);
      d[i]=dd.val;
      prob[i]=pprob.val;
    }
    // Note: It was observed that qualitatively if the probabilities
View Full Code Here

    // Distort the distribution
    factor=0.2;
    ave=0.0;
    for (i=0;i<NTRIAL;i++) {
      for (j=1;j<NPT;j++) {
        u=myran.doub();
        u=u*((1-factor)+u*factor);
        x[j]=2.0*u-1.0;
      }
      for (j=1;j<NPT;j++) {
        u=myran.doub();
View Full Code Here

        u=myran.doub();
        u=u*((1-factor)+u*factor);
        x[j]=2.0*u-1.0;
      }
      for (j=1;j<NPT;j++) {
        u=myran.doub();
        u=u*((1-factor)+u*factor);
        y[j]=2.0*myran.doub()-1.0;
      }
      ks2d1s(x,y,quadvl,dd,pprob);
      ave += pprob.val;
View Full Code Here

        x[j]=2.0*u-1.0;
      }
      for (j=1;j<NPT;j++) {
        u=myran.doub();
        u=u*((1-factor)+u*factor);
        y[j]=2.0*myran.doub()-1.0;
      }
      ks2d1s(x,y,quadvl,dd,pprob);
      ave += pprob.val;
    }
    ave /= NTRIAL;
View Full Code Here

    // Test quadvl
    System.out.println("Testing quadvl");

    Ran myran = new Ran(16);
    for (i=0;i<NTRIES;i++) {
      x=2.0*myran.doub()-1.0;
      y=2.0*myran.doub()-1.0;
      Quadvl quadvl = new Quadvl();
      quadvl.quadvl(x,y,faW,fbW,fcW,fdW);
      fa=faW.val;fb=fbW.val;fc=fcW.val;fd=fdW.val;

View Full Code Here

    System.out.println("Testing quadvl");

    Ran myran = new Ran(16);
    for (i=0;i<NTRIES;i++) {
      x=2.0*myran.doub()-1.0;
      y=2.0*myran.doub()-1.0;
      Quadvl quadvl = new Quadvl();
      quadvl.quadvl(x,y,faW,fbW,fcW,fdW);
      fa=faW.val;fb=fbW.val;fc=fcW.val;fd=fdW.val;

      sbeps=1.e-15;
View Full Code Here

    System.out.println("Testing quadct");

    Ran myran=new Ran(17);
    j=0;
    for (i=0;i<N/4;i++) {
      xx[j]=myran.doub();   // Put a point in each x-y quadrant
      yy[j++]=myran.doub();
      xx[j]=-myran.doub();
      yy[j++]=myran.doub();
      xx[j]=-myran.doub();
      yy[j++]=-myran.doub();
View Full Code Here

    Ran myran=new Ran(17);
    j=0;
    for (i=0;i<N/4;i++) {
      xx[j]=myran.doub();   // Put a point in each x-y quadrant
      yy[j++]=myran.doub();
      xx[j]=-myran.doub();
      yy[j++]=myran.doub();
      xx[j]=-myran.doub();
      yy[j++]=-myran.doub();
      xx[j]=myran.doub();
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.