Development

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • tr1/random adjust some typdefs

    0 answers - 1586 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    consistently with N2032 and avoiding problems when ints are 16 bits.
    Paolo.
    //////////////
    2006-07-14 Paolo Carlini <pcarlini (AT) suse (DOT) de>
    * include/tr1/random (minstd_rand0, minstd_rand, ranlux3, ranlux4):
    Use unsigned long as implementation-defined type.
    Index: include/tr1/random
    include/tr1/random(revision 115444)
    include/tr1/random(working copy)
    @@ -443,12 +443,12 @@
    /**
    * The classic Minimum Standard rand0 of Lewis, Goodman, and Miller.
    */
    - typedef linear_congruential<unsigned int, 16807, 0, 2147483647minstd_rand0;
    + typedef linear_congruential<unsigned long, 16807, 0, 2147483647minstd_rand0;
    /**
    * An alternative LCR (Lehmer Generator function) .
    */
    - typedef linear_congruential<unsigned int, 48271, 0, 2147483647minstd_rand;
    + typedef linear_congruential<unsigned long, 48271, 0, 2147483647minstd_rand;
    /**
    @@ -1056,7 +1056,7 @@
    * James's luxury-level-3 integer adaptation of Luescher's generator.
    */
    typedef discard_block<
    - subtract_with_carry<int, (1 << 24), 10, 24>,
    + subtract_with_carry<unsigned long, (1 << 24), 10, 24>,
    223,
    24
    ranlux3;
    @@ -1065,7 +1065,7 @@
    * James's luxury-level-4 integer adaptation of Luescher's generator.
    */
    typedef discard_block<
    - subtract_with_carry<int, (1 << 24), 10, 24>,
    + subtract_with_carry<unsigned long, (1 << 24), 10, 24>,
    389,
    24
    ranlux4;

Re: tr1/random adjust some typdefs


max 4000 letters.
Your nickname that display:
In order to stop the spam: 8 + 7 =
QUESTION ON "Development"

EMSDN.COM