Package org.apache.commons.rng
Interface JumpableUniformRandomProvider
- All Superinterfaces:
UniformRandomProvider
- All Known Subinterfaces:
LongJumpableUniformRandomProvider
- All Known Implementing Classes:
AbstractL128
,AbstractL64
,AbstractL64X128
,AbstractXoRoShiRo1024
,AbstractXoRoShiRo128
,AbstractXoShiRo128
,AbstractXoShiRo256
,AbstractXoShiRo512
,L128X1024Mix
,L128X128Mix
,L128X256Mix
,L32X64Mix
,L64X1024Mix
,L64X128Mix
,L64X128StarStar
,L64X256Mix
,XoRoShiRo1024PlusPlus
,XoRoShiRo1024Star
,XoRoShiRo1024StarStar
,XoRoShiRo128Plus
,XoRoShiRo128PlusPlus
,XoRoShiRo128StarStar
,XorShift1024Star
,XorShift1024StarPhi
,XoShiRo128Plus
,XoShiRo128PlusPlus
,XoShiRo128StarStar
,XoShiRo256Plus
,XoShiRo256PlusPlus
,XoShiRo256StarStar
,XoShiRo512Plus
,XoShiRo512PlusPlus
,XoShiRo512StarStar
Applies to generators that can be advanced a large number of
steps of the output sequence in a single operation.
- Since:
- 1.3
-
Method Summary
Modifier and TypeMethodDescriptionjump()
Creates a copy of the UniformRandomProvider and then advances the state of the current instance.default Stream
<UniformRandomProvider> jumps()
Returns an effectively unlimited stream of new random generators, each of which implements theUniformRandomProvider
interface.default Stream
<UniformRandomProvider> jumps
(long streamSize) Returns a stream producing the givenstreamSize
number of new random generators, each of which implements theUniformRandomProvider
interface.Methods inherited from interface org.apache.commons.rng.UniformRandomProvider
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs, nextBoolean, nextBytes, nextBytes, nextDouble, nextDouble, nextDouble, nextFloat, nextFloat, nextFloat, nextInt, nextInt, nextInt, nextLong, nextLong, nextLong
-
Method Details
-
jump
UniformRandomProvider jump()Creates a copy of the UniformRandomProvider and then advances the state of the current instance. The copy is returned.The current state will be advanced in a single operation by the equivalent of a number of sequential calls to a method that updates the state of the provider. The size of the jump is implementation dependent.
Repeat invocations of this method will create a series of generators that are uniformly spaced at intervals of the output sequence. Each generator provides non-overlapping output for the length of the jump for use in parallel computations.
- Returns:
- A copy of the current state.
-
jumps
Returns an effectively unlimited stream of new random generators, each of which implements theUniformRandomProvider
interface.- Returns:
- a stream of random generators.
- Since:
- 1.5
-
jumps
Returns a stream producing the givenstreamSize
number of new random generators, each of which implements theUniformRandomProvider
interface.- Parameters:
streamSize
- Number of objects to generate.- Returns:
- a stream of random generators; the stream is limited to the given
streamSize
. - Throws:
IllegalArgumentException
- ifstreamSize
is negative.- Since:
- 1.5
-