[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: RE: koffice/krita/image
From: "Matthew Woehlke" <mwoehlke () tibco ! com>
Date: 2009-03-31 21:55:06
Message-ID: C04A623342E01549B395A84F4D61FDBADE555E () NA-PA-VBE03 ! na ! tibco ! com
[Download RAW message or body]
Bah. /me grumbles something about d->'s. Sorry.
--
Matthew
-----Original Message-----
From: Boudewijn Rempt [mailto:boud@valdyas.org]
Sent: Tuesday, March 31, 2009 13:52
To: kde-commits@kde.org; Matthew Woehlke
Subject: Re: koffice/krita/image
On Tuesday 31 March 2009, Matthew Woehlke wrote:
> SVN commit 947541 by mwoehlke:
>
> Modest changes to the PRNG algorithm.
>
> This gives better high-order bits (there was still some patterning in
> the top-most bits) but shouldn't change the distribution
> charasteristics otherwise. After much work, this version gets my
> official seal of approval :-).
>
And does the unittest pass now?
>
> M +4 -4 kis_random_generator.cc
>
>
> --- trunk/koffice/krita/image/kis_random_generator.cc #947540:947541
> @@ -62,13 +62,13 @@
>
> // Generate salts
> quint64 n1 = (quint64(x + 5) * kxa) * d->seed;
> - quint64 n2 = (quint64(y + 7) * kya) + d->seed;
> + quint64 n2 = (quint64(y + 7) * kya) + (d->seed *
> + 1040097393733LL);
> n1 = permuteWhole(n1, 8759824322359LL, 13);
> + n2 = permuteWhole(n2, 200560490131LL, 2707);
> n1 = (n1 >> 32) ^ (n1 << 32);
> - n2 = permuteWhole(n2, 200560490131LL, 2707);
> n2 = (n2 >> 32) ^ (n2 << 32);
> - n1 ^= x ^ (y * 1040097393733LL) ^ kxb;
> - n2 ^= y ^ (x * 1040097393733LL) ^ kyb;
> + n1 ^= x ^ (quint64(y ^ seed) * kyb);
> + n2 ^= y ^ (quint64(x + 13) * kxb);
>
> // Combine salts
> quint64 v = 0;
--
Boudewijn Rempt | http://www.valdyas.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic