[cvs] / jsr166 / src / main / java / util / SplittableRandom.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/SplittableRandom.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.13, Thu Jul 25 13:19:09 2013 UTC revision 1.14, Mon Aug 5 13:58:02 2013 UTC
# Line 129  Line 129 
129       * calls to nextSeed(): Each instance carries the state of this       * calls to nextSeed(): Each instance carries the state of this
130       * generator as nextSplit. Gammas are treated as 57bit values,       * generator as nextSplit. Gammas are treated as 57bit values,
131       * advancing by adding GAMMA_GAMMA mod GAMMA_PRIME, and bit-mixed       * advancing by adding GAMMA_GAMMA mod GAMMA_PRIME, and bit-mixed
132       * with a 57-bit version of mix, using the "Mix01" multiplicative       * with a 57-bit version of mix, using the "Mix13" multiplicative
133       * constants for MurmurHash3 described by David Stafford       * constants for MurmurHash3 described by David Stafford
134       * (http://zimbry.blogspot.com/2011/09/better-bit-mixing-improving-on.html).       * (http://zimbry.blogspot.com/2011/09/better-bit-mixing-improving-on.html).
135       * The value of GAMMA_GAMMA is arbitrary (except must be at least       * The value of GAMMA_GAMMA is arbitrary (except must be at least
# Line 262  Line 262 
262       * above for explanation.       * above for explanation.
263       */       */
264      private static long mix57(long z) {      private static long mix57(long z) {
265          z ^= (z >>> 33);          z = (z ^ (z >>> 30)) * 0xbf58476d1ce4e5b9L;
         z *= 0x7fb5d329728ea185L;  
266          z &= 0x01FFFFFFFFFFFFFFL;          z &= 0x01FFFFFFFFFFFFFFL;
267          z ^= (z >>> 33);          z = (z ^ (z >>> 27)) * 0x94d049bb133111ebL;
         z *= 0x81dadef4bc2dd44dL;  
268          z &= 0x01FFFFFFFFFFFFFFL;          z &= 0x01FFFFFFFFFFFFFFL;
269          z ^= (z >>> 33);          z ^= (z >>> 31);
270          return z;          return z;
271      }      }
272    

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.14

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8