LCG64ShiftRandom.java
001 /*
002  * Java Genetic Algorithm Library (jenetics-3.9.0).
003  * Copyright (c) 2007-2017 Franz Wilhelmstötter
004  *
005  * Licensed under the Apache License, Version 2.0 (the "License");
006  * you may not use this file except in compliance with the License.
007  * You may obtain a copy of the License at
008  *
009  *      http://www.apache.org/licenses/LICENSE-2.0
010  *
011  * Unless required by applicable law or agreed to in writing, software
012  * distributed under the License is distributed on an "AS IS" BASIS,
013  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014  * See the License for the specific language governing permissions and
015  * limitations under the License.
016  *
017  * Author:
018  *    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
019  */
020 package org.jenetics.util;
021 
022 import static java.lang.String.format;
023 import static java.util.Objects.requireNonNull;
024 import static org.jenetics.internal.util.Equality.eq;
025 
026 import java.io.Serializable;
027 
028 import org.jenetics.internal.math.arithmetic;
029 import org.jenetics.internal.math.random;
030 import org.jenetics.internal.util.Equality;
031 import org.jenetics.internal.util.Hash;
032 
033 /**
034  * This class implements a linear congruential PRNG with additional bit-shift
035  * transition. The base recursion
036  <p>
037  <img
038  *     alt="r_{i+1} = (a\cdot r_i + b) \mod 2^{64}"
039  *     src="doc-files/lcg-recursion.gif"
040  * >
041  </p>
042  * is followed by a non-linear transformation
043  <p>
044  <img
045  *     alt="\begin{eqnarray*}
046  *           t &=& r_i                \\
047  *           t &=& t \oplus (t >> 17) \\
048  *           t &=& t \oplus (t << 31) \\
049  *           t &=& t \oplus (t >> 8)
050  *         \end{eqnarray*}"
051  *     src="doc-files/lcg-non-linear.gif"
052  * >
053  </p>
054  * which destroys the lattice structure introduced by the recursion. The period
055  * of this PRNG is 2<sup>64</sup>, {@code iff} <i>b</i> is odd and <i>a</i>
056  * {@code mod} 4 = 1.
057  <p>
058  *
059  <em>
060  * This is an re-implementation of the
061  * <a href="https://github.com/rabauke/trng4/blob/master/src/lcg64_shift.hpp">
062  * trng::lcg64_shift</a> PRNG class of the
063  * <a href="http://numbercrunch.de/trng/">TRNG</a> library created by Heiko
064  * Bauke.</em>
065  *
066  <p>
067  <strong>Not that the base implementation of the {@code LCG64ShiftRandom}
068  * class is not thread-safe.</strong> If multiple threads requests random
069  * numbers from this class, it <i>must</i> be synchronized externally.
070  * Alternatively you can use the thread-safe implementations
071  {@link LCG64ShiftRandom.ThreadSafe} or {@link LCG64ShiftRandom.ThreadLocal}.
072  *
073  @see <a href="http://numbercrunch.de/trng/">TRNG</a>
074  @see RandomRegistry
075  *
076  @deprecated This random class implementation has been moved to a separate
077  *             module. Use the implementation of the
078  *             <a href="https://github.com/jenetics/prngine">PRNGine</a>
079  *             project instead.
080  *
081  @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
082  @since 1.1
083  @version 2.0
084  */
085 @Deprecated
086 public class LCG64ShiftRandom extends Random64 {
087 
088     private static final long serialVersionUID = 1L;
089 
090     /**
091      * This class represents a <i>thread local</i> implementation of the
092      * {@code LCG64ShiftRandom} PRNG.
093      *
094      * It's recommended to initialize the {@code RandomRegistry} the following
095      * way:
096      *
097      <pre>{@code
098      * // Register the PRNG with the default parameters.
099      * RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal());
100      *
101      * // Register the PRNG with the {@code LECUYER3} parameters.
102      * RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal(
103      *     LCG64ShiftRandom.LECUYER3
104      * ));
105      * }</pre>
106      *
107      * Be aware, that calls of the {@code setSeed(long)} method will throw an
108      * {@code UnsupportedOperationException} for <i>thread local</i> instances.
109      <pre>{@code
110      * RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal());
111      *
112      * // Will throw 'UnsupportedOperationException'.
113      * RandomRegistry.getRandom().setSeed(1234);
114      * }</pre>
115      *
116      @deprecated This random class implementation has been moved to a separate
117      *             module. Use the implementation of the
118      *             <a href="https://github.com/jenetics/prngine">PRNGine</a>
119      *             project instead.
120      *
121      @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
122      @since 1.1
123      @version 3.0
124      */
125     @Deprecated
126     public static final class ThreadLocal
127         extends java.lang.ThreadLocal<LCG64ShiftRandom>
128     {
129         private static final long STEP_BASE = 1L << 56;
130 
131         private int _block = 0;
132         private long _seed = random.seed();
133 
134         private final Param _param;
135 
136         /**
137          * Create a new <i>thread local</i> instance of the
138          * {@code LCG64ShiftRandom} PRNG with the {@code DEFAULT} parameters.
139          */
140         public ThreadLocal() {
141             this(Param.DEFAULT);
142         }
143 
144         /**
145          * Create a new <i>thread local</i> instance of the
146          * {@code LCG64ShiftRandom} PRNG with the given parameters.
147          *
148          @param param the LC parameters.
149          @throws NullPointerException if the given parameters are null.
150          */
151         public ThreadLocal(final Param param) {
152             _param = requireNonNull(param, "PRNG param must not be null.");
153         }
154 
155         /**
156          * Create a new PRNG using <i>block splitting</i> for guaranteeing well
157          * distributed PRN for every thread.
158          *
159          <p>
160          <strong>Tina’s Random Number Generator Library</strong>
161          <br>
162          <em>Chapter 2. Pseudo-random numbers for parallel Monte Carlo
163          *     simulations, Page 7</em>
164          <br>
165          <small>Heiko Bauke</small>
166          <br>
167          * [<a href="http://numbercrunch.de/trng/trng.pdf">
168          *  http://numbercrunch.de/trng/trng.pdf
169          *  </a>].
170          */
171         @Override
172         protected synchronized LCG64ShiftRandom initialValue() {
173             if (_block > 127) {
174                 _block = 0;
175                 _seed = random.seed();
176             }
177 
178             final LCG64ShiftRandom random = new TLLCG64ShiftRandom(_seed, _param);
179             random.jump(_block++*STEP_BASE);
180             return random;
181         }
182 
183     }
184 
185     private static final class TLLCG64ShiftRandom extends LCG64ShiftRandom {
186         private static final long serialVersionUID = 1L;
187 
188         private final Boolean _sentry = Boolean.TRUE;
189 
190         private TLLCG64ShiftRandom(final long seed, final Param param) {
191             super(param, seed);
192         }
193 
194         @Override
195         public void setSeed(final long seed) {
196             if (_sentry != null) {
197                 throw new UnsupportedOperationException(
198                     "The 'setSeed(long)' method is not supported " +
199                     "for thread local instances."
200                 );
201             }
202         }
203 
204     }
205 
206     /**
207      * This is a <i>thread safe</i> variation of the this PRNG&mdash;by
208      * synchronizing the random number generation.
209      *
210      @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
211      @since 1.1
212      @version 3.0
213      */
214     @Deprecated
215     public static final class ThreadSafe extends LCG64ShiftRandom {
216         private static final long serialVersionUID = 1L;
217 
218         /**
219          * Create a new PRNG instance with the given parameter and seed.
220          *
221          @param seed the seed of the PRNG.
222          @param param the parameter of the PRNG.
223          @throws NullPointerException if the given {@code param} is null.
224          *
225          @deprecated Use {@code LCG64ShiftRandom.ThreadSafe(Param, long)}
226          *             instead.
227          */
228         @Deprecated
229         public ThreadSafe(final long seed, final Param param) {
230             super(param, seed);
231         }
232 
233         /**
234          * Create a new PRNG instance with the given parameter and seed.
235          *
236          @param seed the seed of the PRNG.
237          @param param the parameter of the PRNG.
238          @throws NullPointerException if the given {@code param} is null.
239          */
240         public ThreadSafe(final Param param, final long seed) {
241             super(param, seed);
242         }
243 
244         /**
245          * Create a new PRNG instance with {@link Param#DEFAULT} parameter and
246          * the given seed.
247          *
248          @param seed the seed of the PRNG
249          */
250         public ThreadSafe(final long seed) {
251             this(Param.DEFAULT, seed);
252         }
253 
254         /**
255          * Create a new PRNG instance with the given parameter and a safe
256          * default seed.
257          *
258          @param param the PRNG parameter.
259          @throws NullPointerException if the given {@code param} is null.
260          */
261         public ThreadSafe(final Param param) {
262             this(param, random.seed());
263         }
264 
265         /**
266          * Create a new PRNG instance with {@link Param#DEFAULT} parameter and
267          * a safe seed.
268          */
269         public ThreadSafe() {
270             this(Param.DEFAULT, random.seed());
271         }
272 
273         @Override
274         public synchronized void setSeed(final long seed) {
275             super.setSeed(seed);
276         }
277 
278         @Override
279         public synchronized long nextLong() {
280             return super.nextLong();
281         }
282 
283         @Override
284         public synchronized void split(final int p, final int s) {
285             super.split(p, s);
286         }
287 
288         @Override
289         public synchronized void jump2(final int s) {
290             super.jump2(s);
291         }
292 
293         @Override
294         public synchronized void jump(final long step) {
295             super.jump(step);
296         }
297 
298     }
299 
300     /**
301      * Parameter class for the {@code LCG64ShiftRandom} generator, for the
302      * parameters <i>a</i> and <i>b</i> of the LC recursion
303      <i>r<sub>i+1</sub> = a · r<sub>i</sub> + b</i> mod <i>2<sup>64</sup></i>.
304      *
305      @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
306      @since 1.1
307      @version 2.0
308      */
309     @Deprecated
310     public static final class Param implements Serializable {
311 
312         private static final long serialVersionUID = 1L;
313 
314         /**
315          * The default PRNG parameters: a = 0xFBD19FBBC5C07FF5L; b = 1
316          */
317         public static final Param DEFAULT = Param.of(0xFBD19FBBC5C07FF5L1L);
318 
319         /**
320          * LEcuyer 1 parameters: a = 0x27BB2EE687B0B0FDL; b = 1
321          */
322         public static final Param LECUYER1 = Param.of(0x27BB2EE687B0B0FDL1L);
323 
324         /**
325          * LEcuyer 2 parameters: a = 0x2C6FE96EE78B6955L; b = 1
326          */
327         public static final Param LECUYER2 = Param.of(0x2C6FE96EE78B6955L1L);
328 
329         /**
330          * LEcuyer 3 parameters: a = 0x369DEA0F31A53F85L; b = 1
331          */
332         public static final Param LECUYER3 = Param.of(0x369DEA0F31A53F85L1L);
333 
334 
335         /**
336          * The parameter <i>a</i> of the LC recursion.
337          */
338         public final long a;
339 
340         /**
341          * The parameter <i>b</i> of the LC recursion.
342          */
343         public final long b;
344 
345         /**
346          * Create a new parameter object.
347          *
348          @param a the parameter <i>a</i> of the LC recursion.
349          @param b the parameter <i>b</i> of the LC recursion.
350          */
351         private Param(final long a, final long b) {
352             this.a = a;
353             this.b = b;
354         }
355 
356         public static Param of(final long a, final long b) {
357             return new Param(a, b);
358         }
359 
360         @Override
361         public int hashCode() {
362             return 31*(int)(a^(a >>> 32)) 31*(int)(b^(b >>> 32));
363         }
364 
365         @Override
366         public boolean equals(final Object obj) {
367             return obj instanceof Param &&
368                 ((Param)obj).a == a &&
369                 ((Param)obj).b == b;
370         }
371 
372         @Override
373         public String toString() {
374             return format("%s[a=%d, b=%d]", getClass().getName(), a, b);
375         }
376     }
377 
378     /**
379      * Represents the state of this random engine
380      */
381     private final static class State implements Serializable {
382         private static final long serialVersionUID = 1L;
383 
384         long _r;
385 
386         State(final long seed) {
387             setSeed(seed);
388         }
389 
390         void setSeed(final long seed) {
391             _r = seed;
392         }
393 
394         @Override
395         public int hashCode() {
396             return Hash.of(getClass()).and(_r).value();
397         }
398 
399         @Override
400         public boolean equals(final Object obj) {
401             return obj instanceof State && ((State)obj)._r == _r;
402         }
403 
404         @Override
405         public String toString() {
406             return format("State[%d]", _r);
407         }
408     }
409 
410 
411     private Param _param;
412     private final State _state;
413 
414     /**
415      * Create a new PRNG instance with the given parameter and seed.
416      *
417      @param param the parameter of the PRNG.
418      @param seed the seed of the PRNG.
419      @throws NullPointerException if the given {@code param} is null.
420      */
421     public LCG64ShiftRandom(final Param param, final long seed) {
422         _param = requireNonNull(param, "PRNG param must not be null.");
423         _state = new State(seed);
424     }
425 
426     /**
427      * Create a new PRNG instance with the given parameter and a safe seed
428      *
429      @param param the PRNG parameter.
430      @throws NullPointerException if the given {@code param} is null.
431      */
432     public LCG64ShiftRandom(final Param param) {
433         this(param, random.seed());
434     }
435 
436     /**
437      * Create a new PRNG instance with {@link Param#DEFAULT} parameter and the
438      * given seed.
439      *
440      @param seed the seed of the PRNG
441      */
442     public LCG64ShiftRandom(final long seed) {
443         this(Param.DEFAULT, seed);
444     }
445 
446     /**
447      * Create a new PRNG instance with {@link Param#DEFAULT} parameter and safe
448      * seed.
449      */
450     public LCG64ShiftRandom() {
451         this(Param.DEFAULT, random.seed());
452     }
453 
454     @Override
455     public long nextLong() {
456         step();
457 
458         long t = _state._r;
459         t ^= t >>> 17;
460         t ^= t << 31;
461         t ^= t >>> 8;
462         return t;
463     }
464 
465     private void step() {
466         _state._r = _param.a*_state._r + _param.b;
467     }
468 
469     @Override
470     public void setSeed(final long seed) {
471         if (_state != null_state.setSeed(seed);
472     }
473 
474     /**
475      * Changes the internal state of the PRNG in a way that future calls to
476      {@link #nextLong()} will generated the s<sup>th</sup> sub-stream of
477      * p<sup>th</sup> sub-streams. <i>s</i> must be within the range of
478      * {@code [0, p-1)}. This method is mainly used for <i>parallelization</i>
479      * via <i>leap-frogging</i>.
480      *
481      @param p the overall number of sub-streams
482      @param s the s<sup>th</sup> sub-stream
483      @throws IllegalArgumentException if {@code p < 1 || s >= p}.
484      */
485     public void split(final int p, final int s) {
486         if (p < 1) {
487             throw new IllegalArgumentException(format(
488                 "p must be >= 1 but was %d.", p
489             ));
490         }
491         if (s >= p) {
492             throw new IllegalArgumentException(format(
493                 "s must be < %d but was %d.", p, s
494             ));
495         }
496 
497         if (p > 1) {
498             jump(s + 1);
499             final long b = _param.b*f(p, _param.a);
500             final long a = arithmetic.pow(_param.a, p);
501             _param = Param.of(a, b);
502             backward();
503         }
504     }
505 
506     /**
507      * Changes the internal state of the PRNG in such a way that the engine
508      <i>jumps</i> 2<sup>s</sup> steps ahead.
509      *
510      @param s the 2<sup>s</sup> steps to jump ahead.
511      @throws IllegalArgumentException if {@code s < 0}.
512      */
513     public void jump2(final int s) {
514         if (s < 0) {
515             throw new IllegalArgumentException(format(
516                 "s must be positive but was %d.", s
517             ));
518         }
519 
520         if (s >= Long.SIZE) {
521             throw new IllegalArgumentException(format(
522                 "The 'jump2' size must be smaller than %d but was %d.",
523                 Long.SIZE, s
524             ));
525         }
526 
527         _state._r = _state._r*arithmetic.pow(_param.a, 1L << s+
528                     f(1L << s, _param.a)*_param.b;
529     }
530 
531     /**
532      * Changes the internal state of the PRNG in such a way that the engine
533      <i>jumps</i> s steps ahead.
534      *
535      @param step the steps to jump ahead.
536      @throws IllegalArgumentException if {@code s < 0}.
537      */
538     public void jump(final long step) {
539         if (step < 0) {
540             throw new IllegalArgumentException(format(
541                 "step must be positive but was %d", step
542             ));
543         }
544 
545         if (step < 16) {
546             for (int i = 0; i < step; ++i) {
547                 step();
548             }
549         else {
550             long s = step;
551             int i = 0;
552             while (s > 0) {
553                 if (s%== 1) {
554                     jump2(i);
555                 }
556                 ++i;
557                 s >>= 1;
558             }
559         }
560     }
561 
562     private void backward() {
563         for (int i = 0; i < Long.SIZE; ++i) {
564             jump2(i);
565         }
566     }
567 
568     public Param getParam() {
569         return _param;
570     }
571 
572     @Override
573     public int hashCode() {
574         return Hash.of(getClass())
575             .and(_param)
576             .and(_state).value();
577     }
578 
579     @Override
580     public boolean equals(final Object obj) {
581         return Equality.of(this, obj).test(random ->
582             eq(_param, random._param&&
583             eq(_state, random._state)
584         );
585     }
586 
587     @Override
588     public String toString() {
589         return format("%s[%s, %s]", getClass().getSimpleName(), _param, _state);
590     }
591 
592 
593 
594     /* *************************************************************************
595      * Some static helper methods
596      ***************************************************************************/
597 
598     /**
599      * Compute prod(1+a^(2^i), i=0..l-1).
600      */
601     private static long g(final int l, final long a) {
602         long p = a;
603         long res = 1;
604         for (int i = 0; i < l; ++i) {
605             res *= + p;
606             p *= p;
607         }
608 
609         return res;
610     }
611 
612     /**
613      * Compute sum(a^i, i=0..s-1).
614      */
615     private static long f(final long s, final long a) {
616         long y = 0;
617 
618         if (s != 0) {
619             long e = log2Floor(s);
620             long p = a;
621 
622             for (int l = 0; l <= e; ++l) {
623                 if (((1L << l& s!= 0) {
624                     y = g(l, a+ p*y;
625                 }
626                 p *= p;
627             }
628         }
629 
630         return y;
631     }
632 
633     private static long log2Floor(final long s) {
634         long x = s;
635         long y = 0;
636 
637         while (x != 0) {
638             x >>>= 1;
639             ++y;
640         }
641 
642         return y - 1;
643     }
644 
645 }
646 
647 /*
648 #=============================================================================#
649 # Testing: org.jenetics.util.LCG64ShiftRandom (2015-07-12 01:22)              #
650 #=============================================================================#
651 #=============================================================================#
652 # Linux 3.19.0-22-generic (amd64)                                             #
653 # java version "1.8.0_45"                                                     #
654 # Java(TM) SE Runtime Environment (build 1.8.0_45-b14)                        #
655 # Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02)                         #
656 #=============================================================================#
657 #=============================================================================#
658 #            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
659 #=============================================================================#
660    rng_name    |rands/second|   Seed   |
661 stdin_input_raw|  3.26e+07  |2198533946|
662 #=============================================================================#
663         test_name   |ntup| tsamples |psamples|  p-value |Assessment
664 #=============================================================================#
665    diehard_birthdays|   0|       100|     100|0.96061667|  PASSED
666       diehard_operm5|   0|   1000000|     100|0.49388035|  PASSED
667   diehard_rank_32x32|   0|     40000|     100|0.76944223|  PASSED
668     diehard_rank_6x8|   0|    100000|     100|0.81999775|  PASSED
669    diehard_bitstream|   0|   2097152|     100|0.66213596|  PASSED
670         diehard_opso|   0|   2097152|     100|0.35244278|  PASSED
671         diehard_oqso|   0|   2097152|     100|0.30642433|  PASSED
672          diehard_dna|   0|   2097152|     100|0.31111322|  PASSED
673 diehard_count_1s_str|   0|    256000|     100|0.29900596|  PASSED
674 diehard_count_1s_byt|   0|    256000|     100|0.84049939|  PASSED
675  diehard_parking_lot|   0|     12000|     100|0.25249632|  PASSED
676     diehard_2dsphere|   2|      8000|     100|0.89898431|  PASSED
677     diehard_3dsphere|   3|      4000|     100|0.87592069|  PASSED
678      diehard_squeeze|   0|    100000|     100|0.46151457|  PASSED
679         diehard_sums|   0|       100|     100|0.09988415|  PASSED
680         diehard_runs|   0|    100000|     100|0.71496719|  PASSED
681         diehard_runs|   0|    100000|     100|0.84035529|  PASSED
682        diehard_craps|   0|    200000|     100|0.39228628|  PASSED
683        diehard_craps|   0|    200000|     100|0.43227446|  PASSED
684  marsaglia_tsang_gcd|   0|  10000000|     100|0.92226509|  PASSED
685  marsaglia_tsang_gcd|   0|  10000000|     100|0.14768717|  PASSED
686          sts_monobit|   1|    100000|     100|0.99459043|  PASSED
687             sts_runs|   2|    100000|     100|0.14017900|  PASSED
688           sts_serial|   1|    100000|     100|0.93191375|  PASSED
689           sts_serial|   2|    100000|     100|0.78130569|  PASSED
690           sts_serial|   3|    100000|     100|0.48954386|  PASSED
691           sts_serial|   3|    100000|     100|0.20669186|  PASSED
692           sts_serial|   4|    100000|     100|0.51752304|  PASSED
693           sts_serial|   4|    100000|     100|0.81217070|  PASSED
694           sts_serial|   5|    100000|     100|0.61151292|  PASSED
695           sts_serial|   5|    100000|     100|0.43893995|  PASSED
696           sts_serial|   6|    100000|     100|0.70098249|  PASSED
697           sts_serial|   6|    100000|     100|0.88111033|  PASSED
698           sts_serial|   7|    100000|     100|0.08860893|  PASSED
699           sts_serial|   7|    100000|     100|0.10888449|  PASSED
700           sts_serial|   8|    100000|     100|0.48682957|  PASSED
701           sts_serial|   8|    100000|     100|0.79253724|  PASSED
702           sts_serial|   9|    100000|     100|0.57005454|  PASSED
703           sts_serial|   9|    100000|     100|0.57300065|  PASSED
704           sts_serial|  10|    100000|     100|0.60555174|  PASSED
705           sts_serial|  10|    100000|     100|0.26010863|  PASSED
706           sts_serial|  11|    100000|     100|0.23181253|  PASSED
707           sts_serial|  11|    100000|     100|0.55889710|  PASSED
708           sts_serial|  12|    100000|     100|0.50349009|  PASSED
709           sts_serial|  12|    100000|     100|0.67703032|  PASSED
710           sts_serial|  13|    100000|     100|0.09716434|  PASSED
711           sts_serial|  13|    100000|     100|0.01651733|  PASSED
712           sts_serial|  14|    100000|     100|0.58227903|  PASSED
713           sts_serial|  14|    100000|     100|0.49816453|  PASSED
714           sts_serial|  15|    100000|     100|0.35547243|  PASSED
715           sts_serial|  15|    100000|     100|0.77801465|  PASSED
716           sts_serial|  16|    100000|     100|0.55611062|  PASSED
717           sts_serial|  16|    100000|     100|0.45764285|  PASSED
718          rgb_bitdist|   1|    100000|     100|0.74657121|  PASSED
719          rgb_bitdist|   2|    100000|     100|0.95265707|  PASSED
720          rgb_bitdist|   3|    100000|     100|0.71143353|  PASSED
721          rgb_bitdist|   4|    100000|     100|0.99995544|   WEAK
722          rgb_bitdist|   5|    100000|     100|0.99616318|   WEAK
723          rgb_bitdist|   6|    100000|     100|0.66956720|  PASSED
724          rgb_bitdist|   7|    100000|     100|0.95378286|  PASSED
725          rgb_bitdist|   8|    100000|     100|0.46355875|  PASSED
726          rgb_bitdist|   9|    100000|     100|0.21831657|  PASSED
727          rgb_bitdist|  10|    100000|     100|0.97851877|  PASSED
728          rgb_bitdist|  11|    100000|     100|0.35608637|  PASSED
729          rgb_bitdist|  12|    100000|     100|0.11482554|  PASSED
730 rgb_minimum_distance|   2|     10000|    1000|0.67569619|  PASSED
731 rgb_minimum_distance|   3|     10000|    1000|0.40169012|  PASSED
732 rgb_minimum_distance|   4|     10000|    1000|0.68466980|  PASSED
733 rgb_minimum_distance|   5|     10000|    1000|0.85971777|  PASSED
734     rgb_permutations|   2|    100000|     100|0.98547170|  PASSED
735     rgb_permutations|   3|    100000|     100|0.13346308|  PASSED
736     rgb_permutations|   4|    100000|     100|0.30098202|  PASSED
737     rgb_permutations|   5|    100000|     100|0.49670259|  PASSED
738       rgb_lagged_sum|   0|   1000000|     100|0.00376838|   WEAK
739       rgb_lagged_sum|   1|   1000000|     100|0.84875325|  PASSED
740       rgb_lagged_sum|   2|   1000000|     100|0.47618795|  PASSED
741       rgb_lagged_sum|   3|   1000000|     100|0.74638546|  PASSED
742       rgb_lagged_sum|   4|   1000000|     100|0.66367284|  PASSED
743       rgb_lagged_sum|   5|   1000000|     100|0.38277246|  PASSED
744       rgb_lagged_sum|   6|   1000000|     100|0.89022413|  PASSED
745       rgb_lagged_sum|   7|   1000000|     100|0.20961380|  PASSED
746       rgb_lagged_sum|   8|   1000000|     100|0.85608212|  PASSED
747       rgb_lagged_sum|   9|   1000000|     100|0.98007494|  PASSED
748       rgb_lagged_sum|  10|   1000000|     100|0.11658240|  PASSED
749       rgb_lagged_sum|  11|   1000000|     100|0.59955707|  PASSED
750       rgb_lagged_sum|  12|   1000000|     100|0.00017001|   WEAK
751       rgb_lagged_sum|  13|   1000000|     100|0.90147191|  PASSED
752       rgb_lagged_sum|  14|   1000000|     100|0.41636295|  PASSED
753       rgb_lagged_sum|  15|   1000000|     100|0.37015147|  PASSED
754       rgb_lagged_sum|  16|   1000000|     100|0.66453012|  PASSED
755       rgb_lagged_sum|  17|   1000000|     100|0.18865006|  PASSED
756       rgb_lagged_sum|  18|   1000000|     100|0.12419575|  PASSED
757       rgb_lagged_sum|  19|   1000000|     100|0.39883314|  PASSED
758       rgb_lagged_sum|  20|   1000000|     100|0.09942580|  PASSED
759       rgb_lagged_sum|  21|   1000000|     100|0.53467964|  PASSED
760       rgb_lagged_sum|  22|   1000000|     100|0.97551479|  PASSED
761       rgb_lagged_sum|  23|   1000000|     100|0.53709182|  PASSED
762       rgb_lagged_sum|  24|   1000000|     100|0.97407004|  PASSED
763       rgb_lagged_sum|  25|   1000000|     100|0.19308485|  PASSED
764       rgb_lagged_sum|  26|   1000000|     100|0.02836261|  PASSED
765       rgb_lagged_sum|  27|   1000000|     100|0.09286364|  PASSED
766       rgb_lagged_sum|  28|   1000000|     100|0.64833884|  PASSED
767       rgb_lagged_sum|  29|   1000000|     100|0.50128799|  PASSED
768       rgb_lagged_sum|  30|   1000000|     100|0.18237609|  PASSED
769       rgb_lagged_sum|  31|   1000000|     100|0.92914172|  PASSED
770       rgb_lagged_sum|  32|   1000000|     100|0.11809175|  PASSED
771      rgb_kstest_test|   0|     10000|    1000|0.40816346|  PASSED
772      dab_bytedistrib|   0|  51200000|       1|0.21337569|  PASSED
773              dab_dct| 256|     50000|       1|0.25233302|  PASSED
774 Preparing to run test 207.  ntuple = 0
775         dab_filltree|  32|  15000000|       1|0.29102117|  PASSED
776         dab_filltree|  32|  15000000|       1|0.48186931|  PASSED
777 Preparing to run test 208.  ntuple = 0
778        dab_filltree2|   0|   5000000|       1|0.48666498|  PASSED
779        dab_filltree2|   1|   5000000|       1|0.90599317|  PASSED
780 Preparing to run test 209.  ntuple = 0
781         dab_monobit2|  12|  65000000|       1|0.98621807|  PASSED
782 #=============================================================================#
783 # Summary: PASSED=110, WEAK=4, FAILED=0                                       #
784 #          235,031.406 MB of random data created with 99.045 MB/sec           #
785 #=============================================================================#
786 #=============================================================================#
787 # Runtime: 0:39:32                                                            #
788 #=============================================================================#
789 */