Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5090C200B7D for ; Sat, 10 Sep 2016 16:26:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4F3BC160AD2; Sat, 10 Sep 2016 14:26:46 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 24BD7160AA5 for ; Sat, 10 Sep 2016 16:26:43 +0200 (CEST) Received: (qmail 88238 invoked by uid 500); 10 Sep 2016 14:26:43 -0000 Mailing-List: contact notifications-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list notifications@commons.apache.org Received: (qmail 88229 invoked by uid 99); 10 Sep 2016 14:26:43 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 10 Sep 2016 14:26:43 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id CCB80180576 for ; Sat, 10 Sep 2016 14:26:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id PuXs1jgBimPN for ; Sat, 10 Sep 2016 14:26:34 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id C56D260D7D for ; Sat, 10 Sep 2016 14:26:33 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 81000E58E2 for ; Sat, 10 Sep 2016 14:26:32 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 50C5F3A327B for ; Sat, 10 Sep 2016 14:26:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r997106 [5/9] - in /websites/production/commons/content/proper/commons-rng: ./ apidocs/ apidocs/org/apache/commons/rng/internal/source32/ apidocs/org/apache/commons/rng/internal/source64/ apidocs/org/apache/commons/rng/internal/util/ apidoc... Date: Sat, 10 Sep 2016 14:26:31 -0000 To: notifications@commons.apache.org From: erans@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160910142632.50C5F3A327B@svn01-us-west.apache.org> archived-at: Sat, 10 Sep 2016 14:26:46 -0000 Modified: websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.source32/index.source.html ============================================================================== --- websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.source32/index.source.html (original) +++ websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.source32/index.source.html Sat Sep 10 14:26:30 2016 @@ -1 +1 @@ -org.apache.commons.rng.internal.source32

org.apache.commons.rng.internal.source32

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total18 of 2,89899%0 of 78100%01086442069014
JDKRandom.java184772%n/a046190401
ISAACRandom.java1,045100%18100%020013301101
MersenneTwister.java464100%28100%0210670701
AbstractWell.java242100%6100%01404301102
KISSRandom.java211100%6100%090330601
MultiplyWithCarry256.java188100%12100%0110340501
Well44497a.java150100%2100%040210301
Well19937a.java138100%n/a030190301
IntProvider.java125100%6100%0120280901
Well1024a.java112100%n/a030170301
Well512a.java108100%n/a03016 0301
Well44497b.java25100%n/a02060201
Well19937c.java25100%n/a02060201
\ No newline at end of file +org.apache.commons.rng.internal.source32

org.apache.commons.rng.internal.source32

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total18 of 2,78099%0 of 66100%01026433069014
JDKRandom.java184772%n/a046190401
ISAACRandom.java1,045100%18100%020013301101
MersenneTwister.java448100%28100%0210700701
AbstractWell.java242100%6100%01404301102
KISSRandom.java160100%n/a060270601
Well44497a.java150100%2100%040210< /td>301
Well19937a.java138100%n/a030190301
MultiplyWithCarry256.java137100%6100%080280501
IntProvider.java125100%6100%0120280901
Well1024a.java112100%n/a030170301
Well512a.java108100%n/a030160301
Well44497b.java25100%n/a02060201
Well19937c.java25100%n/a02060201
\ No newline at end of file Modified: websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/SeedFactory.html ============================================================================== --- websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/SeedFactory.html (original) +++ websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/SeedFactory.html Sat Sep 10 14:26:30 2016 @@ -1 +1 @@ -SeedFactory

SeedFactory

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total28 of 20686%0 of 8100%319642315
createLong(RandomIntSource, int)51676%n/a011401
createLong(RandomLongSource, int)51372%n/a011301
createInt(RandomIntSource, int)51169%n/a011301
createLongArray(int, RandomIntSource)50%n/a111111
createIntArray(int, RandomIntSource)50%n/a111111
SeedFactory()30%n/a111111
createIntArray(int, RandomLongSource, Object)36100%4100%030801
static {...}27100%n/a010601
createLongArray(int, RandomIntSource, Object)21100%2100%020501
createIntArray(int, RandomIntSource, Object)21100%2100%020501
createInt()7100%n/a010101
createLong()7100%n/a010101
createIntArray(int)7100%n/a010101
createLongArray(int)7100%n/a010101
createIntArray(int, RandomLongSource)5100%n/a010101
\ No newline at end of file +SeedFactory

SeedFactory

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethods
Total28 of 26389%0 of 14100%323652316
createLong(RandomIntSource, int)51676%n/a011401
createLong(RandomLongSource, int)51372%n/a011301
createInt(RandomIntSource, int)51169%n/a011301
createLongArray(int, RandomIntSource)50%n/a111111
createIntArray(int, RandomIntSource)50%n/a111111
SeedFactory()30%n/a111111
fillState(int[], int[])57100%6100%0401001
createIntArray(int, RandomLongSource, Object)36100%4100%030801
static {...}27100%n/a010601
createLongArray(int, RandomIntSource, Object)21100%2100%020501
createIntArray(int, RandomIntSource, Object)21100%2100%020501
createInt()7100%n/a010101
createLong()7100%n/a010101
createIntArray(int)7100%n/a010101
createLongArray(int)7100%n/a010101
createIntArray(int, RandomLongSource)5100%n/a010101
\ No newline at end of file Modified: websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/SeedFactory.java.html ============================================================================== --- websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/SeedFactory.java.html (original) +++ websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/SeedFactory.java.html Sat Sep 10 14:26:30 2016 @@ -98,6 +98,42 @@ public class SeedFactory { } /** + * Simple filling procedure. + * It will + * <ol> + * <li> + * fill the beginning of {@code state} by copying + * {@code min(seed.length, state.length)} elements from + * {@code seed}, + * </li> + * <li> + * set all remaining elements of {@code state} with non-zero + * values (even if {@code seed.length < state.length}). + * </li> + * </ol> + * + * @param state State. Must be allocated. + * @param seed Seed. Cannot be null. + */ + public static void fillState(int[] state, + int[] seed) { + final int stateSize = state.length; + final int seedSize = seed.length; + System.arraycopy(seed, 0, state, 0, Math.min(seedSize, stateSize)); + + if (seedSize < stateSize) { + for (int i = seedSize; i < stateSize; i++) { + state[i] = 26021969 * i; + } + for (int i = stateSize - 1; i > seedSize; i--) { + state[i] ^= state[stateSize - i - 1]; + } + + state[seedSize] = 0x80000000; // Ensuring non-zero initial array. + } + } + + /** * Creates an array of numbers for use as a seed. * * @param n Size of the array to create. @@ -107,7 +143,7 @@ public class SeedFactory { */ static long[] createLongArray(int n, RandomIntSource source) { - return createLongArray(n, source, null); + return createLongArray(n, source, null); } /** @@ -120,7 +156,7 @@ public class SeedFactory { */ static int[] createIntArray(int n, RandomLongSource source) { - return createIntArray(n, source, null); + return createIntArray(n, source, null); } /** @@ -133,7 +169,7 @@ public class SeedFactory { */ static int[] createIntArray(int n, RandomIntSource source) { - return createIntArray(n, source, null); + return createIntArray(n, source, null); } /** @@ -149,14 +185,14 @@ public class SeedFactory { private static long[] createLongArray(int n, RandomIntSource source, Object h) { - final long[] array = new long[n]; + final long[] array = new long[n]; - final int hash = System.identityHashCode(h); - for (int i = 0; i < n; i++) { - array[i] = createLong(source, hash); + final int hash = System.identityHashCode(h); + for (int i = 0; i < n; i++) { + array[i] = createLong(source, hash); } - return array; + return array; } /** @@ -172,20 +208,20 @@ public class SeedFactory { private static int[] createIntArray(int n, RandomLongSource source, Object h) { - final int[] array = new int[n]; + final int[] array = new int[n]; - final int hash = System.identityHashCode(h); - for (int i = 0; i < n; i += 2) { - final long v = createLong(source, hash); + final int hash = System.identityHashCode(h); + for (int i = 0; i < n; i += 2) { + final long v = createLong(source, hash); - array[i] = NumberFactory.extractHi(v); + array[i] = NumberFactory.extractHi(v); - if (i + 1 < n) { - array[i + 1] = NumberFactory.extractLo(v); + if (i + 1 < n) { + array[i + 1] = NumberFactory.extractLo(v); } } - return array; + return array; } /** @@ -201,14 +237,14 @@ public class SeedFactory { private static int[] createIntArray(int n, RandomIntSource source, Object h) { - final int[] array = new int[n]; + final int[] array = new int[n]; - final int hash = System.identityHashCode(h); - for (int i = 0; i < n; i++) { - array[i] = createInt(source, hash); + final int hash = System.identityHashCode(h); + for (int i = 0; i < n; i++) { + array[i] = createInt(source, hash); } - return array; + return array; } /** @@ -222,9 +258,9 @@ public class SeedFactory { */ private static long createLong(RandomLongSource source, int number) { - synchronized (source) { - return source.next() ^ NumberFactory.makeLong(number, number); - } + synchronized (source) { + return source.next() ^ NumberFactory.makeLong(number, number); + } } /** @@ -238,10 +274,10 @@ public class SeedFactory { */ private static long createLong(RandomIntSource source, int number) { - synchronized (source) { - return NumberFactory.makeLong(source.next() ^ number, - source.next() ^ number); - } + synchronized (source) { + return NumberFactory.makeLong(source.next() ^ number, + source.next() ^ number); + } } /** @@ -255,9 +291,9 @@ public class SeedFactory { */ private static int createInt(RandomIntSource source, int number) { - synchronized (source) { - return source.next() ^ number; - } + synchronized (source) { + return source.next() ^ number; + } } } \ No newline at end of file Modified: websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/index.html ============================================================================== --- websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/index.html (original) +++ websites/production/commons/content/proper/commons-rng/jacoco/org.apache.commons.rng.internal.util/index.html Sat Sep 10 14:26:30 2016 @@ -1 +1 @@ -org.apache.commons.rng.internal.util

org.apache.commons.rng.internal.util

ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total31 of 82596%0 of 46100%4817167458014
SeedFactory2817886%8100%31964231501
NumberFactory334999%22100%13016711901
IntArray2LongArray46100%4100%04080201
LongArray2IntArray36100%2100%03070201
Long2LongArray30100%2100%03080201
ByteArray2IntArray26100%2100%03040201
ByteArray2LongArray26100%2100%03040201
IntArray2Int22100%2100%03050201
LongArray2Long22100%2100%03050201
SeedConverterComposer19100%n/a02060201
Long2IntArray14100%n/a02040201
Int2Long13100%n/a02030201
Long2Int8100%n/a02020201
NoOpConverter5100%n/a02020201
\ No newline at end of file +org.apache.commons.rng.internal.util

org.apache.commons.rng.internal.util

0
ElementMissed InstructionsCov.Missed BranchesCov.MissedCxtyMissedLinesMissedMethodsMissedClasses
Total31 of 88296%0 of 52100%4857177459014
SeedFactory2823589%14100%3236523161
NumberFactory334999%22100%13016711901
IntArray2LongArray46100%4100%04080201
LongArray2IntArray36100%2100%03070201
Long2LongArray30100%2100%03080201
ByteArray2IntArray26100%2100%03040201
ByteArray2LongArray26100%2100%03040201
IntArray2Int22100%2100%03050201
LongArray2Long22100%2100%03050201
SeedConverterComposer19100%n/a02060201
Long2IntArray14100%n/a02040201
Int2Long13100%n/a02030201
Long2Int8100%n/a02020201
NoOpConverter5100%n/a02020201
\ No newline at end of file