comparison src/main/gov/nasa/jpf/util/OATHash.java @ 6:3a19eedcc13d

added a UniqueRandomPermGenerator that makes sure we don't return duplicates. It also checks the (unlikely and pointless) case that we request more permutations than N! and caps the number of samples accordingly
author Peter Mehlitz <Peter.C.Mehlitz@nasa.gov>
date Fri, 06 Feb 2015 10:12:12 -0800
parents 61d41facf527
children
comparison
equal deleted inserted replaced
5:1ba6ea44e5f9 6:3a19eedcc13d
82 int h = hashMixin( 0, key1); 82 int h = hashMixin( 0, key1);
83 h = hashMixin( h, key2); 83 h = hashMixin( h, key2);
84 h = hashMixin( h, key3); 84 h = hashMixin( h, key3);
85 85
86 return hashFinalize(h); 86 return hashFinalize(h);
87 87 }
88
89 public static int hash (int[] keys){
90 int h = 0;
91 for (int i=0; i<keys.length; i++){
92 h = hashMixin( h, keys[i]);
93 }
94 return hashFinalize(h);
88 } 95 }
89 } 96 }