message: Changed to use mwc64; seems a lot faster...
diff: #ifndef _MWC_H_
  #define _MWC_H_
  +#include <iostream>
  #include <stdio.h>
  #include "common.h"
  +//#include <assert.h>
  +//#define d_assert assert
  +
  +#include "xoro.hh"
  +#include "sx.hh"
  +#include "mwc64.h"
  /**
  * @class MWC
  * @note Copyright (C) 2005-2011 by Emery Berger, University of Massachusetts Amherst.
  */
  -class MWC {
  +class RealMWC {
  public:
  - explicit MWC(unsigned int seed1, unsigned int seed2) : z(seed1), w(seed2) {
  + explicit RealMWC(unsigned int seed1, unsigned int seed2) : z(seed1), w(seed2) {
  d_assert(seed1 != 0);
  d_assert(seed2 != 0);
  //debug("MWC seed1: %u seed2: %u\n", seed1, seed2);
  @@ -37,6 +44,15 @@ public:
  return x;
  }
  +private:
  + unsigned int z;
  + unsigned int w;
  +};
  +
  +#if 0
  +class MWC : public RealMWC {
  + using RealMWC::RealMWC;
  +public:
  // returns a number between min and max (inclusive)
  inline unsigned int inRange(size_t min, size_t max) {
  size_t range = 1 + max - min;
  @@ -45,11 +61,35 @@ public:
  // adapted from https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
  return min + (((uint64_t) next() * (uint64_t) range) >> 32);
  }
  +};
  +#else
  +class MWC : public MWC64 { // public sx { // xoro {
  +public:
  +#if 0
  + // using xoro::xoro;
  + MWC(uint32_t s1, uint32_t s2)
  + // : xoro::xoro(s1, s2)
  + : sx::sx(s1, s2)
  + {
  + }
  +#else
  + // using xoro::xoro;
  + MWC(uint32_t s1, uint32_t s2)
  + // : xoro::xoro(s1, s2)
  + : MWC64::MWC64(s1, s2)
  + {
  + }
  +#endif
  + // returns a number between min and max (inclusive)
  + inline unsigned int inRange(size_t min, size_t max) {
  + size_t range = 1 + max - min;
  -private:
  - unsigned int z;
  - unsigned int w;
  + // return min + next() % range;
  + // adapted from https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/
  + return min + (((uint64_t) next() * (uint64_t) range) >> 32);
  + }
  };
  +#endif
  #endif
  