| 
001 /*002  * Java Genetic Algorithm Library (jenetics-3.0.0).
 003  * Copyright (c) 2007-2014 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  * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 077  * @since 1.1
 078  * @version 2.0 — <em>$Date: 2014-12-28 $</em>
 079  */
 080 public class LCG64ShiftRandom extends Random64 {
 081
 082     private static final long serialVersionUID = 1L;
 083
 084     /**
 085      * This class represents a <i>thread local</i> implementation of the
 086      * {@code LCG64ShiftRandom} PRNG.
 087      *
 088      * It's recommended to initialize the {@code RandomRegistry} the following
 089      * way:
 090      *
 091      * [code]
 092      * // Register the PRNG with the default parameters.
 093      * RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal());
 094      *
 095      * // Register the PRNG with the {@code LECUYER3} parameters.
 096      * RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal(
 097      *     LCG64ShiftRandom.LECUYER3
 098      * ));
 099      * [/code]
 100      *
 101      * Be aware, that calls of the {@code setSeed(long)} method will throw an
 102      * {@code UnsupportedOperationException} for <i>thread local</i> instances.
 103      * [code]
 104      * RandomRegistry.setRandom(new LCG64ShiftRandom.ThreadLocal());
 105      *
 106      * // Will throw 'UnsupportedOperationException'.
 107      * RandomRegistry.getRandom().setSeed(1234);
 108      * [/code]
 109      *
 110      * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 111      * @since 1.1
 112      * @version 3.0 — <em>$Date: 2014-12-28 $</em>
 113      */
 114     public static final class ThreadLocal
 115         extends java.lang.ThreadLocal<LCG64ShiftRandom>
 116     {
 117         private static final long STEP_BASE = 1L << 56;
 118
 119         private int _block = 0;
 120         private long _seed = random.seed();
 121
 122         private final Param _param;
 123
 124         /**
 125          * Create a new <i>thread local</i> instance of the
 126          * {@code LCG64ShiftRandom} PRNG with the {@code DEFAULT} parameters.
 127          */
 128         public ThreadLocal() {
 129             this(Param.DEFAULT);
 130         }
 131
 132         /**
 133          * Create a new <i>thread local</i> instance of the
 134          * {@code LCG64ShiftRandom} PRNG with the given parameters.
 135          *
 136          * @param param the LC parameters.
 137          * @throws NullPointerException if the given parameters are null.
 138          */
 139         public ThreadLocal(final Param param) {
 140             _param = requireNonNull(param, "PRNG param must not be null.");
 141         }
 142
 143         /**
 144          * Create a new PRNG using <i>block splitting</i> for guaranteeing well
 145          * distributed PRN for every thread.
 146          *
 147          * <p>
 148          * <strong>Tina’s Random Number Generator Library</strong>
 149          * <br>
 150          * <em>Chapter 2. Pseudo-random numbers for parallel Monte Carlo
 151          *     simulations, Page 7</em>
 152          * <br>
 153          * <small>Heiko Bauke</small>
 154          * <br>
 155          * [<a href="http://numbercrunch.de/trng/trng.pdf">
 156          *  http://numbercrunch.de/trng/trng.pdf
 157          *  </a>].
 158          */
 159         @Override
 160         protected synchronized LCG64ShiftRandom initialValue() {
 161             if (_block > 127) {
 162                 _block = 0;
 163                 _seed = random.seed();
 164             }
 165
 166             final LCG64ShiftRandom random = new TLLCG64ShiftRandom(_seed, _param);
 167             random.jump((_block++)*STEP_BASE);
 168             return random;
 169         }
 170
 171     }
 172
 173     private static final class TLLCG64ShiftRandom extends LCG64ShiftRandom {
 174
 175         private static final long serialVersionUID = 1L;
 176
 177         private final Boolean _sentry = Boolean.TRUE;
 178
 179         private TLLCG64ShiftRandom(final long seed, final Param param) {
 180             super(param, seed);
 181         }
 182
 183         @Override
 184         public void setSeed(final long seed) {
 185             if (_sentry != null) {
 186                 throw new UnsupportedOperationException(
 187                     "The 'setSeed(long)' method is not supported " +
 188                     "for thread local instances."
 189                 );
 190             }
 191         }
 192
 193     }
 194
 195     /**
 196      * This is a <i>thread safe</i> variation of the this PRNG—by
 197      * synchronizing the random number generation.
 198      *
 199      * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 200      * @since 1.1
 201      * @version 3.0 — <em>$Date: 2014-12-28 $</em>
 202      */
 203     public static final class ThreadSafe extends LCG64ShiftRandom {
 204         private static final long serialVersionUID = 1L;
 205
 206         /**
 207          * Create a new PRNG instance with the given parameter and seed.
 208          *
 209          * @param seed the seed of the PRNG.
 210          * @param param the parameter of the PRNG.
 211          * @throws NullPointerException if the given {@code param} is null.
 212          */
 213         public ThreadSafe(final long seed, final Param param) {
 214             super(param, seed);
 215         }
 216
 217         /**
 218          * Create a new PRNG instance with {@link Param#DEFAULT} parameter and
 219          * the given seed.
 220          *
 221          * @param seed the seed of the PRNG
 222          */
 223         public ThreadSafe(final long seed) {
 224             this(seed, Param.DEFAULT);
 225         }
 226
 227         /**
 228          * Create a new PRNG instance with the given parameter and a safe
 229          * default seed.
 230          *
 231          * @param param the PRNG parameter.
 232          * @throws NullPointerException if the given {@code param} is null.
 233          */
 234         public ThreadSafe(final Param param) {
 235             this(random.seed(), param);
 236         }
 237
 238         /**
 239          * Create a new PRNG instance with {@link Param#DEFAULT} parameter and
 240          * a safe seed.
 241          */
 242         public ThreadSafe() {
 243             this(random.seed(), Param.DEFAULT);
 244         }
 245
 246         @Override
 247         public synchronized void setSeed(final long seed) {
 248             super.setSeed(seed);
 249         }
 250
 251         @Override
 252         public synchronized long nextLong() {
 253             return super.nextLong();
 254         }
 255
 256         @Override
 257         public synchronized void split(final int p, final int s) {
 258             super.split(p, s);
 259         }
 260
 261         @Override
 262         public synchronized void jump2(final int s) {
 263             super.jump2(s);
 264         }
 265
 266         @Override
 267         public synchronized void jump(final long step) {
 268             super.jump(step);
 269         }
 270
 271     }
 272
 273     /**
 274      * Parameter class for the {@code LCG64ShiftRandom} generator, for the
 275      * parameters <i>a</i> and <i>b</i> of the LC recursion
 276      * <i>r<sub>i+1</sub> = a · r<sub>i</sub> + b</i> mod <i>2<sup>64</sup></i>.
 277      *
 278      * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 279      * @since 1.1
 280      * @version 2.0 — <em>$Date: 2014-12-28 $</em>
 281      */
 282     public static final class Param implements Serializable {
 283
 284         private static final long serialVersionUID = 1L;
 285
 286         /**
 287          * The default PRNG parameters: a = 0xFBD19FBBC5C07FF5L; b = 1
 288          */
 289         public static final Param DEFAULT = Param.of(0xFBD19FBBC5C07FF5L, 1L);
 290
 291         /**
 292          * LEcuyer 1 parameters: a = 0x27BB2EE687B0B0FDL; b = 1
 293          */
 294         public static final Param LECUYER1 = Param.of(0x27BB2EE687B0B0FDL, 1L);
 295
 296         /**
 297          * LEcuyer 2 parameters: a = 0x2C6FE96EE78B6955L; b = 1
 298          */
 299         public static final Param LECUYER2 = Param.of(0x2C6FE96EE78B6955L, 1L);
 300
 301         /**
 302          * LEcuyer 3 parameters: a = 0x369DEA0F31A53F85L; b = 1
 303          */
 304         public static final Param LECUYER3 = Param.of(0x369DEA0F31A53F85L, 1L);
 305
 306
 307         /**
 308          * The parameter <i>a</i> of the LC recursion.
 309          */
 310         public final long a;
 311
 312         /**
 313          * The parameter <i>b</i> of the LC recursion.
 314          */
 315         public final long b;
 316
 317         /**
 318          * Create a new parameter object.
 319          *
 320          * @param a the parameter <i>a</i> of the LC recursion.
 321          * @param b the parameter <i>b</i> of the LC recursion.
 322          */
 323         private Param(final long a, final long b) {
 324             this.a = a;
 325             this.b = b;
 326         }
 327
 328         public static Param of(final long a, final long b) {
 329             return new Param(a, b);
 330         }
 331
 332         @Override
 333         public int hashCode() {
 334             return 31*(int)(a^(a >>> 32)) + 31*(int)(b^(b >>> 32));
 335         }
 336
 337         @Override
 338         public boolean equals(final Object obj) {
 339             return Equality.of(this, obj).test(p -> a == p.a && b == p.b);
 340         }
 341
 342         @Override
 343         public String toString() {
 344             return format("%s[a=%d, b=%d]", getClass().getName(), a, b);
 345         }
 346     }
 347
 348     /**
 349      * Represents the state of this random engine
 350      */
 351     private final static class State implements Serializable {
 352         private static final long serialVersionUID = 1L;
 353
 354         long _r;
 355
 356         State(final long seed) {
 357             setSeed(seed);
 358         }
 359
 360         void setSeed(final long seed) {
 361             _r = seed;
 362         }
 363
 364         @Override
 365         public int hashCode() {
 366             return Hash.of(getClass()).and(_r).value();
 367         }
 368
 369         @Override
 370         public boolean equals(final Object obj) {
 371             return Equality.of(this, obj).test(state -> state._r == _r);
 372         }
 373
 374         @Override
 375         public String toString() {
 376             return format("State[%d]", _r);
 377         }
 378     }
 379
 380
 381     private Param _param;
 382     private final State _state;
 383
 384     /**
 385      * Create a new PRNG instance with the given parameter and seed.
 386      *
 387      * @param param the parameter of the PRNG.
 388      * @param seed the seed of the PRNG.
 389      * @throws NullPointerException if the given {@code param} is null.
 390      */
 391     public LCG64ShiftRandom(final Param param, final long seed) {
 392         _param = requireNonNull(param, "PRNG param must not be null.");
 393         _state = new State(seed);
 394     }
 395
 396     /**
 397      * Create a new PRNG instance with the given parameter and a safe seed
 398      *
 399      * @param param the PRNG parameter.
 400      * @throws NullPointerException if the given {@code param} is null.
 401      */
 402     public LCG64ShiftRandom(final Param param) {
 403         this(param, random.seed());
 404     }
 405
 406     /**
 407      * Create a new PRNG instance with {@link Param#DEFAULT} parameter and the
 408      * given seed.
 409      *
 410      * @param seed the seed of the PRNG
 411      */
 412     public LCG64ShiftRandom(final long seed) {
 413         this(Param.DEFAULT, seed);
 414     }
 415
 416     /**
 417      * Create a new PRNG instance with {@link Param#DEFAULT} parameter and safe
 418      * seed.
 419      */
 420     public LCG64ShiftRandom() {
 421         this(Param.DEFAULT, random.seed());
 422     }
 423
 424     @Override
 425     public long nextLong() {
 426         step();
 427
 428         long t = _state._r;
 429         t ^= t >>> 17;
 430         t ^= t << 31;
 431         t ^= t >>> 8;
 432         return t;
 433     }
 434
 435     private void step() {
 436         _state._r = _param.a*_state._r + _param.b;
 437     }
 438
 439     @Override
 440     public void setSeed(final long seed) {
 441         if (_state != null) _state.setSeed(seed);
 442     }
 443
 444     /**
 445      * Changes the internal state of the PRNG in a way that future calls to
 446      * {@link #nextLong()} will generated the s<sup>th</sup> sub-stream of
 447      * p<sup>th</sup> sub-streams. <i>s</i> must be within the range of
 448      * {@code [0, p-1)}. This method is mainly used for <i>parallelization</i>
 449      * via <i>leap-frogging</i>.
 450      *
 451      * @param p the overall number of sub-streams
 452      * @param s the s<sup>th</sup> sub-stream
 453      * @throws IllegalArgumentException if {@code p < 1 || s >= p}.
 454      */
 455     public void split(final int p, final int s) {
 456         if (p < 1) {
 457             throw new IllegalArgumentException(format(
 458                 "p must be >= 1 but was %d.", p
 459             ));
 460         }
 461         if (s >= p) {
 462             throw new IllegalArgumentException(format(
 463                 "s must be < %d but was %d.", p, s
 464             ));
 465         }
 466
 467         if (p > 1) {
 468             jump(s + 1);
 469             final long b = _param.b*f(p, _param.a);
 470             final long a = arithmetic.pow(_param.a, p);
 471             _param = Param.of(a, b);
 472             backward();
 473         }
 474     }
 475
 476     /**
 477      * Changes the internal state of the PRNG in such a way that the engine
 478      * <i>jumps</i> 2<sup>s</sup> steps ahead.
 479      *
 480      * @param s the 2<sup>s</sup> steps to jump ahead.
 481      * @throws IllegalArgumentException if {@code s < 0}.
 482      */
 483     public void jump2(final int s) {
 484         if (s < 0) {
 485             throw new IllegalArgumentException(format(
 486                 "s must be positive but was %d.", s
 487             ));
 488         }
 489
 490         if (s >= Long.SIZE) {
 491             throw new IllegalArgumentException(format(
 492                 "The 'jump2' size must be smaller than %d but was %d.",
 493                 Long.SIZE, s
 494             ));
 495         }
 496
 497         _state._r = _state._r*arithmetic.pow(_param.a, 1L << s) +
 498                     f(1L << s, _param.a)*_param.b;
 499     }
 500
 501     /**
 502      * Changes the internal state of the PRNG in such a way that the engine
 503      * <i>jumps</i> s steps ahead.
 504      *
 505      * @param step the steps to jump ahead.
 506      * @throws IllegalArgumentException if {@code s < 0}.
 507      */
 508     public void jump(final long step) {
 509         if (step < 0) {
 510             throw new IllegalArgumentException(format(
 511                 "step must be positive but was %d", step
 512             ));
 513         }
 514
 515         if (step < 16) {
 516             for (int i = 0; i < step; ++i) {
 517                 step();
 518             }
 519         } else {
 520             long s = step;
 521             int i = 0;
 522             while (s > 0) {
 523                 if (s%2 == 1) {
 524                     jump2(i);
 525                 }
 526                 ++i;
 527                 s >>= 1;
 528             }
 529         }
 530     }
 531
 532     private void backward() {
 533         for (int i = 0; i < Long.SIZE; ++i) {
 534             jump2(i);
 535         }
 536     }
 537
 538     public Param getParam() {
 539         return _param;
 540     }
 541
 542     @Override
 543     public int hashCode() {
 544         return Hash.of(getClass())
 545             .and(_param)
 546             .and(_state).value();
 547     }
 548
 549     @Override
 550     public boolean equals(final Object obj) {
 551         return Equality.of(this, obj).test(random ->
 552             eq(_param, random._param) &&
 553             eq(_state, random._state)
 554         );
 555     }
 556
 557     @Override
 558     public String toString() {
 559         return format("%s[%s, %s]", getClass().getSimpleName(), _param, _state);
 560     }
 561
 562
 563
 564     /* *************************************************************************
 565      * Some static helper methods
 566      ***************************************************************************/
 567
 568     /**
 569      * Compute prod(1+a^(2^i), i=0..l-1).
 570      */
 571     private static long g(final int l, final long a) {
 572         long p = a;
 573         long res = 1;
 574         for (int i = 0; i < l; ++i) {
 575             res *= 1 + p;
 576             p *= p;
 577         }
 578
 579         return res;
 580     }
 581
 582     /**
 583      * Compute sum(a^i, i=0..s-1).
 584      */
 585     private static long f(final long s, final long a) {
 586         long y = 0;
 587
 588         if (s != 0) {
 589             long e = log2Floor(s);
 590             long p = a;
 591
 592             for (int l = 0; l <= e; ++l) {
 593                 if (((1L << l) & s) != 0) {
 594                     y = g(l, a) + p*y;
 595                 }
 596                 p *= p;
 597             }
 598         }
 599
 600         return y;
 601     }
 602
 603     private static long log2Floor(final long s) {
 604         long x = s;
 605         long y = 0;
 606
 607         while (x != 0) {
 608             x >>>= 1;
 609             ++y;
 610         }
 611
 612         return y - 1;
 613     }
 614
 615 }
 616
 617 /*
 618 #=============================================================================#
 619 # Testing: org.jenetics.util.LCG64ShiftRandom (2014-12-22 20:06)              #
 620 #=============================================================================#
 621 #=============================================================================#
 622 # Linux 3.16.0-28-generic (amd64)                                             #
 623 # java version "1.8.0_25"                                                     #
 624 # Java(TM) SE Runtime Environment (build 1.8.0_25-b17)                        #
 625 # Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02)                         #
 626 #=============================================================================#
 627 #=============================================================================#
 628 #            dieharder version 3.31.1 Copyright 2003 Robert G. Brown          #
 629 #=============================================================================#
 630    rng_name    |rands/second|   Seed   |
 631 stdin_input_raw|  3.36e+07  | 995404065|
 632 #=============================================================================#
 633         test_name   |ntup| tsamples |psamples|  p-value |Assessment
 634 #=============================================================================#
 635    diehard_birthdays|   0|       100|     100|0.88513397|  PASSED
 636       diehard_operm5|   0|   1000000|     100|0.62485774|  PASSED
 637   diehard_rank_32x32|   0|     40000|     100|0.25787172|  PASSED
 638     diehard_rank_6x8|   0|    100000|     100|0.82310594|  PASSED
 639    diehard_bitstream|   0|   2097152|     100|0.25410565|  PASSED
 640         diehard_opso|   0|   2097152|     100|0.27994196|  PASSED
 641         diehard_oqso|   0|   2097152|     100|0.29423503|  PASSED
 642          diehard_dna|   0|   2097152|     100|0.94754044|  PASSED
 643 diehard_count_1s_str|   0|    256000|     100|0.54264055|  PASSED
 644 diehard_count_1s_byt|   0|    256000|     100|0.22965023|  PASSED
 645  diehard_parking_lot|   0|     12000|     100|0.45602493|  PASSED
 646     diehard_2dsphere|   2|      8000|     100|0.78207294|  PASSED
 647     diehard_3dsphere|   3|      4000|     100|0.04516364|  PASSED
 648      diehard_squeeze|   0|    100000|     100|0.90977421|  PASSED
 649         diehard_sums|   0|       100|     100|0.00384163|   WEAK
 650         diehard_runs|   0|    100000|     100|0.58757856|  PASSED
 651         diehard_runs|   0|    100000|     100|0.68126568|  PASSED
 652        diehard_craps|   0|    200000|     100|0.98405727|  PASSED
 653        diehard_craps|   0|    200000|     100|0.43748297|  PASSED
 654  marsaglia_tsang_gcd|   0|  10000000|     100|0.99909354|   WEAK
 655  marsaglia_tsang_gcd|   0|  10000000|     100|0.42705390|  PASSED
 656          sts_monobit|   1|    100000|     100|0.05277954|  PASSED
 657             sts_runs|   2|    100000|     100|0.74724764|  PASSED
 658           sts_serial|   1|    100000|     100|0.53431948|  PASSED
 659           sts_serial|   2|    100000|     100|0.45235557|  PASSED
 660           sts_serial|   3|    100000|     100|0.59547923|  PASSED
 661           sts_serial|   3|    100000|     100|0.13653712|  PASSED
 662           sts_serial|   4|    100000|     100|0.88745241|  PASSED
 663           sts_serial|   4|    100000|     100|0.75849526|  PASSED
 664           sts_serial|   5|    100000|     100|0.63956697|  PASSED
 665           sts_serial|   5|    100000|     100|0.50638398|  PASSED
 666           sts_serial|   6|    100000|     100|0.50970181|  PASSED
 667           sts_serial|   6|    100000|     100|0.74301220|  PASSED
 668           sts_serial|   7|    100000|     100|0.72536115|  PASSED
 669           sts_serial|   7|    100000|     100|0.42918461|  PASSED
 670           sts_serial|   8|    100000|     100|0.51745297|  PASSED
 671           sts_serial|   8|    100000|     100|0.27665980|  PASSED
 672           sts_serial|   9|    100000|     100|0.07219154|  PASSED
 673           sts_serial|   9|    100000|     100|0.16007881|  PASSED
 674           sts_serial|  10|    100000|     100|0.68864336|  PASSED
 675           sts_serial|  10|    100000|     100|0.64663821|  PASSED
 676           sts_serial|  11|    100000|     100|0.51544583|  PASSED
 677           sts_serial|  11|    100000|     100|0.04750204|  PASSED
 678           sts_serial|  12|    100000|     100|0.98324239|  PASSED
 679           sts_serial|  12|    100000|     100|0.73888233|  PASSED
 680           sts_serial|  13|    100000|     100|0.99796458|   WEAK
 681           sts_serial|  13|    100000|     100|0.57405237|  PASSED
 682           sts_serial|  14|    100000|     100|0.99820199|   WEAK
 683           sts_serial|  14|    100000|     100|0.74966215|  PASSED
 684           sts_serial|  15|    100000|     100|0.66130491|  PASSED
 685           sts_serial|  15|    100000|     100|0.27502970|  PASSED
 686           sts_serial|  16|    100000|     100|0.76403577|  PASSED
 687           sts_serial|  16|    100000|     100|0.77906323|  PASSED
 688          rgb_bitdist|   1|    100000|     100|0.85986918|  PASSED
 689          rgb_bitdist|   2|    100000|     100|0.19194081|  PASSED
 690          rgb_bitdist|   3|    100000|     100|0.37765353|  PASSED
 691          rgb_bitdist|   4|    100000|     100|0.40284131|  PASSED
 692          rgb_bitdist|   5|    100000|     100|0.63742901|  PASSED
 693          rgb_bitdist|   6|    100000|     100|0.81457600|  PASSED
 694          rgb_bitdist|   7|    100000|     100|0.98271991|  PASSED
 695          rgb_bitdist|   8|    100000|     100|0.74518833|  PASSED
 696          rgb_bitdist|   9|    100000|     100|0.25408860|  PASSED
 697          rgb_bitdist|  10|    100000|     100|0.71098196|  PASSED
 698          rgb_bitdist|  11|    100000|     100|0.32293476|  PASSED
 699          rgb_bitdist|  12|    100000|     100|0.64350515|  PASSED
 700 rgb_minimum_distance|   2|     10000|    1000|0.61947836|  PASSED
 701 rgb_minimum_distance|   3|     10000|    1000|0.60592190|  PASSED
 702 rgb_minimum_distance|   4|     10000|    1000|0.25531102|  PASSED
 703 rgb_minimum_distance|   5|     10000|    1000|0.69122761|  PASSED
 704     rgb_permutations|   2|    100000|     100|0.80529402|  PASSED
 705     rgb_permutations|   3|    100000|     100|0.02362682|  PASSED
 706     rgb_permutations|   4|    100000|     100|0.38540180|  PASSED
 707     rgb_permutations|   5|    100000|     100|0.41191808|  PASSED
 708       rgb_lagged_sum|   0|   1000000|     100|0.10725403|  PASSED
 709       rgb_lagged_sum|   1|   1000000|     100|0.28049411|  PASSED
 710       rgb_lagged_sum|   2|   1000000|     100|0.94452071|  PASSED
 711       rgb_lagged_sum|   3|   1000000|     100|0.24582457|  PASSED
 712       rgb_lagged_sum|   4|   1000000|     100|0.32474902|  PASSED
 713       rgb_lagged_sum|   5|   1000000|     100|0.62662596|  PASSED
 714       rgb_lagged_sum|   6|   1000000|     100|0.05315903|  PASSED
 715       rgb_lagged_sum|   7|   1000000|     100|0.87896717|  PASSED
 716       rgb_lagged_sum|   8|   1000000|     100|0.49840401|  PASSED
 717       rgb_lagged_sum|   9|   1000000|     100|0.34628462|  PASSED
 718       rgb_lagged_sum|  10|   1000000|     100|0.60873298|  PASSED
 719       rgb_lagged_sum|  11|   1000000|     100|0.55503249|  PASSED
 720       rgb_lagged_sum|  12|   1000000|     100|0.04282574|  PASSED
 721       rgb_lagged_sum|  13|   1000000|     100|0.91309214|  PASSED
 722       rgb_lagged_sum|  14|   1000000|     100|0.34015015|  PASSED
 723       rgb_lagged_sum|  15|   1000000|     100|0.13777151|  PASSED
 724       rgb_lagged_sum|  16|   1000000|     100|0.94326616|  PASSED
 725       rgb_lagged_sum|  17|   1000000|     100|0.55337305|  PASSED
 726       rgb_lagged_sum|  18|   1000000|     100|0.07791838|  PASSED
 727       rgb_lagged_sum|  19|   1000000|     100|0.88717640|  PASSED
 728       rgb_lagged_sum|  20|   1000000|     100|0.46169416|  PASSED
 729       rgb_lagged_sum|  21|   1000000|     100|0.28732211|  PASSED
 730       rgb_lagged_sum|  22|   1000000|     100|0.73427824|  PASSED
 731       rgb_lagged_sum|  23|   1000000|     100|0.74579333|  PASSED
 732       rgb_lagged_sum|  24|   1000000|     100|0.94979002|  PASSED
 733       rgb_lagged_sum|  25|   1000000|     100|0.90588183|  PASSED
 734       rgb_lagged_sum|  26|   1000000|     100|0.37617442|  PASSED
 735       rgb_lagged_sum|  27|   1000000|     100|0.86960028|  PASSED
 736       rgb_lagged_sum|  28|   1000000|     100|0.80661374|  PASSED
 737       rgb_lagged_sum|  29|   1000000|     100|0.57067702|  PASSED
 738       rgb_lagged_sum|  30|   1000000|     100|0.97767659|  PASSED
 739       rgb_lagged_sum|  31|   1000000|     100|0.96858026|  PASSED
 740       rgb_lagged_sum|  32|   1000000|     100|0.03607615|  PASSED
 741      rgb_kstest_test|   0|     10000|    1000|0.07252636|  PASSED
 742      dab_bytedistrib|   0|  51200000|       1|0.13820055|  PASSED
 743              dab_dct| 256|     50000|       1|0.63195233|  PASSED
 744 Preparing to run test 207.  ntuple = 0
 745         dab_filltree|  32|  15000000|       1|0.81023471|  PASSED
 746         dab_filltree|  32|  15000000|       1|0.64402067|  PASSED
 747 Preparing to run test 208.  ntuple = 0
 748        dab_filltree2|   0|   5000000|       1|0.94066606|  PASSED
 749        dab_filltree2|   1|   5000000|       1|0.06674646|  PASSED
 750 Preparing to run test 209.  ntuple = 0
 751         dab_monobit2|  12|  65000000|       1|0.49588718|  PASSED
 752 #=============================================================================#
 753 # Summary: PASSED=110, WEAK=4, FAILED=0                                       #
 754 #          235,031.469 MB of random data created with 99.057 MB/sec           #
 755 #=============================================================================#
 756 #=============================================================================#
 757 # Runtime: 0:39:32                                                            #
 758 #=============================================================================#
 759 */
 |