Examples of nextPermutation()


Examples of ivory.lsh.data.Permutation.nextPermutation()

      return randomPermFile;
    }
    SequenceFile.Writer writer = SequenceFile.createWriter(fs, job, new Path(randomPermFile), IntWritable.class, ArrayListOfIntsWritable.class);
    Permutation p = new PermutationByBit(numBits);
    for(int i=0;i<numOfPermutations;i++){
      ArrayListOfIntsWritable perm = p.nextPermutation();
      writer.append(new IntWritable(i), perm);
      sLogger.debug(i +":"+perm);
    }
    writer.close();
    sLogger.info("Random permutations written.");
View Full Code Here

Examples of ivory.lsh.data.Permutation.nextPermutation()

  }
 
  public static void main(String[] args){
    Permutation p = new PermutationByBlock(64);
    for(int i=0;i<10;i++){
      System.out.println(p.nextPermutation());
    }
  }
}
View Full Code Here

Examples of ivory.lsh.data.PermutationByBit.nextPermutation()

      return randomPermFile;
    }
    SequenceFile.Writer writer = SequenceFile.createWriter(fs, job, new Path(randomPermFile), IntWritable.class, ArrayListOfIntsWritable.class);
    Permutation p = new PermutationByBit(numBits);
    for(int i=0;i<numOfPermutations;i++){
      ArrayListOfIntsWritable perm = p.nextPermutation();
      writer.append(new IntWritable(i), perm);
      sLogger.debug(i +":"+perm);
    }
    writer.close();
    sLogger.info("Random permutations written.");
View Full Code Here

Examples of ivory.lsh.data.PermutationByBlock.nextPermutation()

    int loopcnt = 0;
    NBitSignature permutedS = new NBitSignature(D);
    while (true) {
      try {
        ArrayListOfIntsWritable a = p.nextPermutation();
        s.perm(a, permutedS);
        System.out.println((loopcnt++) + "\n" + permutedS);
        assertTrue(cntBits == permutedS.countSetBits());
        // System.out.println(permutedS);
      } catch (RuntimeException e) {
View Full Code Here

Examples of org.apache.commons.math.random.RandomData.nextPermutation()

        RandomData rd = new RandomDataImpl();
        tstGetSortedValues(test1);
        tstGetSortedValues(test2);
        tstGetSortedValues(test3);
        for (int i = 0; i < 10; i++) {
            testi = rd.nextPermutation(10,6);
            test4 = new double[6];
            for (int j = 0; j < testi.length; j++) {
                test4[j] = (double) testi[j];
            }
            tstGetSortedValues(test4);
View Full Code Here

Examples of org.apache.commons.math.random.RandomData.nextPermutation()

                test4[j] = (double) testi[j];
            }
            tstGetSortedValues(test4);
        }
        for (int i = 0; i < 10; i++) {
            testi = rd.nextPermutation(10,5);
            test4 = new double[5];
            for (int j = 0; j < testi.length; j++) {
                test4[j] = (double) testi[j];
            }
            tstGetSortedValues(test4);
View Full Code Here

Examples of org.apache.commons.math.random.RandomData.nextPermutation()

        assertEquals("Q3",1,u.getPercentile(75),10E-12);
        assertEquals("Q2",1,u.getPercentile(50),10E-12);
       
        u.clear();
        RandomData rd = new RandomDataImpl();
        int[] testi = rd.nextPermutation(100,100); // will contain 0-99
        for (int j = 0; j < testi.length; j++) {
            u.addValue((double) testi[j])//OK, laugh at me for the cast
        }
        for (int i = 1; i < 100; i++) {
            assertEquals("percentile " + i,
View Full Code Here

Examples of org.apache.commons.math.random.RandomData.nextPermutation()

        RandomData rd = new RandomDataImpl();
        tstGetSortedValues(test1);
        tstGetSortedValues(test2);
        tstGetSortedValues(test3);
        for (int i = 0; i < 10; i++) {
            testi = rd.nextPermutation(10,6);
            test4 = new double[6];
            for (int j = 0; j < testi.length; j++) {
                test4[j] = (double) testi[j];
            }
            tstGetSortedValues(test4);
View Full Code Here

Examples of org.apache.commons.math.random.RandomData.nextPermutation()

                test4[j] = (double) testi[j];
            }
            tstGetSortedValues(test4);
        }
        for (int i = 0; i < 10; i++) {
            testi = rd.nextPermutation(10,5);
            test4 = new double[5];
            for (int j = 0; j < testi.length; j++) {
                test4[j] = (double) testi[j];
            }
            tstGetSortedValues(test4);
View Full Code Here

Examples of org.apache.commons.math.random.RandomData.nextPermutation()

        assertEquals("Q3",1,u.getPercentile(75),10E-12);
        assertEquals("Q2",1,u.getPercentile(50),10E-12);
       
        u.clear();
        RandomData rd = new RandomDataImpl();
        int[] testi = rd.nextPermutation(100,100); // will contain 0-99
        for (int j = 0; j < testi.length; j++) {
            u.addValue((double) testi[j])//OK, laugh at me for the cast
        }
        for (int i = 1; i < 100; i++) {
            assertEquals("percentile " + i,
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.