Examples of int32p()


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

    System.out.println("Testing NRsparseCol");
    Ran myran = new Ran(17);
    double[] a =new double[N];
   
    // XXX java not support unsigned int.
    for (i=0;i<nnvals;i++) a[myran.int32p() % N] = (double)(i);
    nnvals=0;   // There may be fewer than nnvals non-zero elements
    for (i=0;i<N;i++)
      if (a[i] != 0.0) nnvals++;
    NRsparseCol as = new NRsparseCol(N,nnvals);
    k=0;
View Full Code Here

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

    Ran myran = new Ran(17);
    double[][] a = new double[N][M];
    nvals=N+M;
   
    // XXX java not support unsigned int.
    for (i=0;i<nvals;i++) a[myran.int32p() % N][myran.int32p() % M] = (double)(i);
    nvals=0;    // There may be fewer than nvals non-zero elements
    for (i=0;i<N;i++)
      for(j=0;j<M;j++)
        if (a[i][j] != 0.0) nvals++;
    NRsparseMat as = new NRsparseMat(N,M,nvals);
View Full Code Here

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

    Ran myran = new Ran(17);
    double[][] a = new double[N][M];
    nvals=N+M;
   
    // XXX java not support unsigned int.
    for (i=0;i<nvals;i++) a[myran.int32p() % N][myran.int32p() % M] = (double)(i);
    nvals=0;    // There may be fewer than nvals non-zero elements
    for (i=0;i<N;i++)
      for(j=0;j<M;j++)
        if (a[i][j] != 0.0) nvals++;
    NRsparseMat as = new NRsparseMat(N,M,nvals);
View Full Code Here

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

    // Test ADAT
    System.out.println("Testing ADAT (and NRsparseMat)");
    Ran myran = new Ran(17);
    nvals=N+M;    // Create a sparse matrix with random non-zero entries
    for (i=0;i<nvals;i++) a[myran.int32p() % N][myran.int32p() % M] = (double)(i);
    nvals=0;    // There may be fewer than nvals non-zero elements
    for (i=0;i<N;i++)
      for(j=0;j<M;j++)
        if (a[i][j] != 0) nvals++;
View Full Code Here

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

    // Test ADAT
    System.out.println("Testing ADAT (and NRsparseMat)");
    Ran myran = new Ran(17);
    nvals=N+M;    // Create a sparse matrix with random non-zero entries
    for (i=0;i<nvals;i++) a[myran.int32p() % N][myran.int32p() % M] = (double)(i);
    nvals=0;    // There may be fewer than nvals non-zero elements
    for (i=0;i<N;i++)
      for(j=0;j<M;j++)
        if (a[i][j] != 0) nvals++;
View Full Code Here

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

    System.out.println("Testing selip");
    Ran myran =new Ran(17);
    for (i=0;i<N;i++) x[i]=myran.doub();
    double[] xx=buildVector(x);   // Copy of array for later test
    for (i=0;i<M;i++) {
      k=myran.int32p() % N;
      xsel=Sorter.selip(k,x);

      // Test for position in array
      count=0;
      for (j=0;j<N;j++)
View Full Code Here

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

    for (i=0;i<N;i++)
      for (j=0;j<M;j++)
        actual[i][j]=cos((double)(i)/20.0)*cos((double)(j)/20.0);
    double[][] mat = buildMatrix(actual);
    for (i=0;i<NBAD;i++) {  // insert "missing" data
      p=myran.int32p()%N;
      q=myran.int32p()%M;
      mat[p][q]=1.e99;
    }
    System.out.printf("     Initial discrepancy: %g\n", maxel(matsub(actual,mat)));
    Laplace_interp mylaplace = new Laplace_interp(mat);
View Full Code Here

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

      for (j=0;j<M;j++)
        actual[i][j]=cos((double)(i)/20.0)*cos((double)(j)/20.0);
    double[][] mat = buildMatrix(actual);
    for (i=0;i<NBAD;i++) {  // insert "missing" data
      p=myran.int32p()%N;
      q=myran.int32p()%M;
      mat[p][q]=1.e99;
    }
    System.out.printf("     Initial discrepancy: %g\n", maxel(matsub(actual,mat)));
    Laplace_interp mylaplace = new Laplace_interp(mat);
    mylaplace.solve();
View Full Code Here

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

    // Test select
    System.out.println("Testing select");
    Ran myran = new Ran(17);
    for (i=0;i<N;i++) x[i]=myran.doub();
    for (i=0;i<M;i++) {
      k=myran.int32p() % N;
      xsel=Sorter.select(k,x);

      localflag = (x[k] != xsel);
      globalflag = globalflag || localflag;
      if (localflag) {
View Full Code Here

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

    Ran myran = new Ran(17);
    for (i=0;i<N1;i++)
      string1[i]=protein[3];
    for (i=0;i<N2;i++)
      string2[i]=protein[myran.int32p()%3];

//    System.out.printf(string1);
//    System.out.printf(string2 << endl);

    // Bury a needle in the haystack
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.