Package org.apache.commons.rng
Interface RestorableUniformRandomProvider
- All Superinterfaces:
UniformRandomProvider
- All Known Implementing Classes:
AbstractL128
,AbstractL64
,AbstractL64X128
,AbstractPcg6432
,AbstractPcgMcg6432
,AbstractWell
,AbstractXoRoShiRo1024
,AbstractXoRoShiRo128
,AbstractXoRoShiRo64
,AbstractXoShiRo128
,AbstractXoShiRo256
,AbstractXoShiRo512
,BaseProvider
,DotyHumphreySmallFastCounting32
,DotyHumphreySmallFastCounting64
,IntProvider
,ISAACRandom
,JDKRandom
,JenkinsSmallFast32
,JenkinsSmallFast64
,KISSRandom
,L128X1024Mix
,L128X128Mix
,L128X256Mix
,L32X64Mix
,L64X1024Mix
,L64X128Mix
,L64X128StarStar
,L64X256Mix
,LongProvider
,MersenneTwister
,MersenneTwister64
,MiddleSquareWeylSequence
,MultiplyWithCarry256
,PcgMcgXshRr32
,PcgMcgXshRs32
,PcgRxsMXs64
,PcgXshRr32
,PcgXshRs32
,SplitMix64
,TwoCmres
,Well1024a
,Well19937a
,Well19937c
,Well44497a
,Well44497b
,Well512a
,XoRoShiRo1024PlusPlus
,XoRoShiRo1024Star
,XoRoShiRo1024StarStar
,XoRoShiRo128Plus
,XoRoShiRo128PlusPlus
,XoRoShiRo128StarStar
,XoRoShiRo64Star
,XoRoShiRo64StarStar
,XorShift1024Star
,XorShift1024StarPhi
,XoShiRo128Plus
,XoShiRo128PlusPlus
,XoShiRo128StarStar
,XoShiRo256Plus
,XoShiRo256PlusPlus
,XoShiRo256StarStar
,XoShiRo512Plus
,XoShiRo512PlusPlus
,XoShiRo512StarStar
Applies to generators whose internal state can be saved and restored.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionvoid
restoreState
(RandomProviderState state) Restores the state of a generator.Saves the state of a generator.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
-
saveState
RandomProviderState saveState()Saves the state of a generator.- Returns:
- the current state of this instance. It is a value that can
subsequently be passed to the
restore
method. - Throws:
UnsupportedOperationException
- if the underlying source of randomness does not support this functionality.
-
restoreState
Restores the state of a generator.- Parameters:
state
- State which this instance will be set to. This parameter would usually have been obtained by a call tosaveState
performed either on the same object as this one, or an object of the exact same class.- Throws:
UnsupportedOperationException
- if the underlying source of randomness does not support this functionality.IllegalArgumentException
- if it was detected that thestate
argument is incompatible with this instance.
-