blob: ca8e9b6c60dc783bf97c8a74a37a5c537435ac72 [file] [log] [blame]
<?xml version="1.0"?>
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
See the License for the specific language governing permissions and
limitations under the License.
<title>Commons RNG</title>
<section name="Apache Commons RNG: Random Numbers Generators" href="summary">
Commons RNG provides implementations of pseudo-random numbers generators that are
either faster or of higher quality (and sometimes both) than <code>java.util.Random</code>.
Casual use is as simple as:
<source class="prettyprint">import org.apache.commons.rng.UniformRandomProvider;
import org.apache.commons.rng.simple.RandomSource;
// Instantiate a "Mersenne-Twister" generator with a factory method.
UniformRandomProvider rng = RandomSource.create(RandomSource.MT);
// Use it to produce a floating-point value between 0 and 1.
double random = rng.nextDouble();
For more examples and more advanced usage, see the <a href="userguide/rng.html">userguide</a>.
Commons RNG is intended to be a repository of pure Java implementations of
random number generators that produce deterministic sequences.
The current design has made no provision for features generally needed for
cryptography applications (e.g. strong unpredictability).
The emphasis is on state-of-the-art generators that pass stringent uniformity
tests such as <a href="">TestU01 (BigCrush)</a>,
<a href="">Dieharder</a> and
<a href="">PractRand</a>.
Weaker algorithms, with known shortcomings, are also provided (for reference or
due to their historical importance) but their use is best avoided in new
<section name="Download Apache Commons RNG">
<subsection name="Releases">
Download the
<a href="">
latest release</a> of Apache Commons RNG.