Package orestes.bloomfilter.HashProvider

Examples of orestes.bloomfilter.HashProvider.HashFunction


    public static void testDistribution(HashMethod hm, int hashesPerRound, int m, int k, int rounds,
                                        List<List<byte[]>> hashData, StringBuilder chi, StringBuilder pvalue) {
        DescriptiveStatistics pValues = new DescriptiveStatistics();
        DescriptiveStatistics xs = new DescriptiveStatistics();

        HashFunction hf = hm.getHashFunction();
        int hashRounds = hashesPerRound / k;

        for (int i = 0; i < rounds; i++) {
            List<byte[]> data = hashData.get(i);

            long[] observed = new long[m];
            for (int j = 0; j < hashRounds; j++) {
                int[] hashes = hf.hash(data.get(j), m, k);
                for (int h : hashes) {
                    observed[h]++;
                }
            }
            //MemoryBFTest.plotHistogram(observed, hm.toString());
View Full Code Here


  }

  public static String testSpeed(HashMethod hm, List<List<byte[]>> hashData, int hashesPerRound, int m, int k, int rounds) {
    DescriptiveStatistics speed = new DescriptiveStatistics();

        HashFunction hf = hm.getHashFunction();
        int hashRounds = hashesPerRound / k;

    Random r = new Random();
    for (int i = 0; i < rounds; i++) {
      List<byte[]> data = hashData.get(i);

      long start_hash = System.nanoTime();
      for (int i1 = 0; i1 < hashRounds; i1++) {
        int[] hashes = hf.hash(data.get(i1), m, k);
      }
      long end_hash = System.nanoTime();

      speed.addValue((1.0 * end_hash - start_hash) / 1000000);
    }
View Full Code Here

TOP

Related Classes of orestes.bloomfilter.HashProvider.HashFunction

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.