Package com.nr.ran

Examples of com.nr.ran.Primpolytest


   

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

    Primpolytest ptest = new Primpolytest();
    for (i=0;i<N;i++) {
      nflag=ptest.test(pp[i]);
      localflag = localflag || nflag==0;
    }
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Primpolytest: A known primitive polynomial was not identified as such.");
     
    }

    Ran myran = new Ran(17);
    mask = ((((long)1 << 32) - 1) >> 1);
    for (i=0;i<N;i++) {
      nflag=ptest.test((long)(myran.int32()) & mask);
      localflag = localflag || nflag!=0;
    }
    globalflag = globalflag || localflag;
    if (localflag) {
      fail("*** Primpolytest: A randomly generated 31 bit integer tested positive (unlikely).");
View Full Code Here

TOP

Related Classes of com.nr.ran.Primpolytest

Copyright © 2018 www.massapicom. 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.