Enum ProviderBuilder.RandomSourceInternal
- java.lang.Object
-
- java.lang.Enum<ProviderBuilder.RandomSourceInternal>
-
- org.apache.commons.rng.simple.internal.ProviderBuilder.RandomSourceInternal
-
- All Implemented Interfaces:
Serializable
,Comparable<ProviderBuilder.RandomSourceInternal>
- Enclosing class:
- ProviderBuilder
public static enum ProviderBuilder.RandomSourceInternal extends Enum<ProviderBuilder.RandomSourceInternal>
Identifiers of the generators.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ISAAC
Source of randomness isISAACRandom
.JDK
Source of randomness isJDKRandom
.JSF_32
Source of randomness isJenkinsSmallFast32
.JSF_64
Source of randomness isJenkinsSmallFast64
.KISS
Source of randomness isKISSRandom
.MSWS
Source of randomness isMiddleSquareWeylSequence
.MT
Source of randomness isMersenneTwister
.MT_64
Source of randomness isMersenneTwister64
.MWC_256
Source of randomness isMultiplyWithCarry256
.PCG_MCG_XSH_RR_32
Source of randomness isPcgMcgXshRr32
.PCG_MCG_XSH_RS_32
Source of randomness isPcgMcgXshRs32
.PCG_RXS_M_XS_64
Source of randomness isPcgRxsMXs64
.PCG_RXS_M_XS_64_OS
Source of randomness isPcgRxsMXs64
.PCG_XSH_RR_32
Source of randomness isPcgXshRr32
.PCG_XSH_RR_32_OS
Source of randomness isPcgXshRr32
.PCG_XSH_RS_32
Source of randomness isPcgXshRs32
.PCG_XSH_RS_32_OS
Source of randomness isPcgXshRs32
.SFC_32
Source of randomness isDotyHumphreySmallFastCounting32
.SFC_64
Source of randomness isDotyHumphreySmallFastCounting64
.SPLIT_MIX_64
Source of randomness isSplitMix64
.TWO_CMRES
Source of randomness isTwoCmres
.TWO_CMRES_SELECT
Source of randomness isTwoCmres
with explicit selection of the two subcycle generators.WELL_1024_A
Source of randomness isWell1024a
.WELL_19937_A
Source of randomness isWell19937a
.WELL_19937_C
Source of randomness isWell19937c
.WELL_44497_A
Source of randomness isWell44497a
.WELL_44497_B
Source of randomness isWell44497b
.WELL_512_A
Source of randomness isWell512a
.XO_RO_SHI_RO_1024_PP
Source of randomness isXoRoShiRo1024PlusPlus
.XO_RO_SHI_RO_1024_S
Source of randomness isXoRoShiRo1024Star
.XO_RO_SHI_RO_1024_SS
Source of randomness isXoRoShiRo1024StarStar
.XO_RO_SHI_RO_128_PLUS
Source of randomness isXoRoShiRo128Plus
.XO_RO_SHI_RO_128_PP
Source of randomness isXoRoShiRo128PlusPlus
.XO_RO_SHI_RO_128_SS
Source of randomness isXoRoShiRo128StarStar
.XO_RO_SHI_RO_64_S
Source of randomness isXoRoShiRo64Star
.XO_RO_SHI_RO_64_SS
Source of randomness isXoRoShiRo64StarStar
.XO_SHI_RO_128_PLUS
Source of randomness isXoShiRo128Plus
.XO_SHI_RO_128_PP
Source of randomness isXoShiRo128PlusPlus
.XO_SHI_RO_128_SS
Source of randomness isXoShiRo128StarStar
.XO_SHI_RO_256_PLUS
Source of randomness isXoShiRo256Plus
.XO_SHI_RO_256_PP
Source of randomness isXoShiRo256PlusPlus
.XO_SHI_RO_256_SS
Source of randomness isXoShiRo256StarStar
.XO_SHI_RO_512_PLUS
Source of randomness isXoShiRo512Plus
.XO_SHI_RO_512_PP
Source of randomness isXoShiRo512PlusPlus
.XO_SHI_RO_512_SS
Source of randomness isXoShiRo512StarStar
.XOR_SHIFT_1024_S
Source of randomness isXorShift1024Star
.XOR_SHIFT_1024_S_PHI
Source of randomness isXorShift1024StarPhi
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
convertSeed(Object seed)
Converts a seed from any of the supported seed types to a native seed.protected byte[]
createByteArraySeed(org.apache.commons.rng.UniformRandomProvider source)
Creates abyte[]
seed using the provided source of randomness.protected Object
createSeed()
Creates a native seed.byte[]
createSeedBytes()
Creates a seed suitable for the implementing class represented by this random source.byte[]
createSeedBytes(org.apache.commons.rng.UniformRandomProvider source)
Creates a seed suitable for the implementing class represented by this random source using the supplied source of randomness.Class<?>
getRng()
Gets the implementing class of the random source.<SEED> boolean
isNativeSeed(SEED seed)
Checks whether the type of givenseed
is the native type of the implementation.static ProviderBuilder.RandomSourceInternal
valueOf(String name)
Returns the enum constant of this type with the specified name.static ProviderBuilder.RandomSourceInternal[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
JDK
public static final ProviderBuilder.RandomSourceInternal JDK
Source of randomness isJDKRandom
.
-
WELL_512_A
public static final ProviderBuilder.RandomSourceInternal WELL_512_A
Source of randomness isWell512a
.
-
WELL_1024_A
public static final ProviderBuilder.RandomSourceInternal WELL_1024_A
Source of randomness isWell1024a
.
-
WELL_19937_A
public static final ProviderBuilder.RandomSourceInternal WELL_19937_A
Source of randomness isWell19937a
.
-
WELL_19937_C
public static final ProviderBuilder.RandomSourceInternal WELL_19937_C
Source of randomness isWell19937c
.
-
WELL_44497_A
public static final ProviderBuilder.RandomSourceInternal WELL_44497_A
Source of randomness isWell44497a
.
-
WELL_44497_B
public static final ProviderBuilder.RandomSourceInternal WELL_44497_B
Source of randomness isWell44497b
.
-
MT
public static final ProviderBuilder.RandomSourceInternal MT
Source of randomness isMersenneTwister
.
-
ISAAC
public static final ProviderBuilder.RandomSourceInternal ISAAC
Source of randomness isISAACRandom
.
-
SPLIT_MIX_64
public static final ProviderBuilder.RandomSourceInternal SPLIT_MIX_64
Source of randomness isSplitMix64
.
-
XOR_SHIFT_1024_S
public static final ProviderBuilder.RandomSourceInternal XOR_SHIFT_1024_S
Source of randomness isXorShift1024Star
.
-
TWO_CMRES
public static final ProviderBuilder.RandomSourceInternal TWO_CMRES
Source of randomness isTwoCmres
.
-
TWO_CMRES_SELECT
public static final ProviderBuilder.RandomSourceInternal TWO_CMRES_SELECT
Source of randomness isTwoCmres
with explicit selection of the two subcycle generators.
-
MT_64
public static final ProviderBuilder.RandomSourceInternal MT_64
Source of randomness isMersenneTwister64
.
-
MWC_256
public static final ProviderBuilder.RandomSourceInternal MWC_256
Source of randomness isMultiplyWithCarry256
.
-
KISS
public static final ProviderBuilder.RandomSourceInternal KISS
Source of randomness isKISSRandom
.
-
XOR_SHIFT_1024_S_PHI
public static final ProviderBuilder.RandomSourceInternal XOR_SHIFT_1024_S_PHI
Source of randomness isXorShift1024StarPhi
.
-
XO_RO_SHI_RO_64_S
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_64_S
Source of randomness isXoRoShiRo64Star
.
-
XO_RO_SHI_RO_64_SS
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_64_SS
Source of randomness isXoRoShiRo64StarStar
.
-
XO_SHI_RO_128_PLUS
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_128_PLUS
Source of randomness isXoShiRo128Plus
.
-
XO_SHI_RO_128_SS
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_128_SS
Source of randomness isXoShiRo128StarStar
.
-
XO_RO_SHI_RO_128_PLUS
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_128_PLUS
Source of randomness isXoRoShiRo128Plus
.
-
XO_RO_SHI_RO_128_SS
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_128_SS
Source of randomness isXoRoShiRo128StarStar
.
-
XO_SHI_RO_256_PLUS
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_256_PLUS
Source of randomness isXoShiRo256Plus
.
-
XO_SHI_RO_256_SS
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_256_SS
Source of randomness isXoShiRo256StarStar
.
-
XO_SHI_RO_512_PLUS
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_512_PLUS
Source of randomness isXoShiRo512Plus
.
-
XO_SHI_RO_512_SS
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_512_SS
Source of randomness isXoShiRo512StarStar
.
-
PCG_XSH_RR_32
public static final ProviderBuilder.RandomSourceInternal PCG_XSH_RR_32
Source of randomness isPcgXshRr32
.
-
PCG_XSH_RS_32
public static final ProviderBuilder.RandomSourceInternal PCG_XSH_RS_32
Source of randomness isPcgXshRs32
.
-
PCG_RXS_M_XS_64
public static final ProviderBuilder.RandomSourceInternal PCG_RXS_M_XS_64
Source of randomness isPcgRxsMXs64
.
-
PCG_MCG_XSH_RR_32
public static final ProviderBuilder.RandomSourceInternal PCG_MCG_XSH_RR_32
Source of randomness isPcgMcgXshRr32
.
-
PCG_MCG_XSH_RS_32
public static final ProviderBuilder.RandomSourceInternal PCG_MCG_XSH_RS_32
Source of randomness isPcgMcgXshRs32
.
-
MSWS
public static final ProviderBuilder.RandomSourceInternal MSWS
Source of randomness isMiddleSquareWeylSequence
.
-
SFC_32
public static final ProviderBuilder.RandomSourceInternal SFC_32
Source of randomness isDotyHumphreySmallFastCounting32
.
-
SFC_64
public static final ProviderBuilder.RandomSourceInternal SFC_64
Source of randomness isDotyHumphreySmallFastCounting64
.
-
JSF_32
public static final ProviderBuilder.RandomSourceInternal JSF_32
Source of randomness isJenkinsSmallFast32
.
-
JSF_64
public static final ProviderBuilder.RandomSourceInternal JSF_64
Source of randomness isJenkinsSmallFast64
.
-
XO_SHI_RO_128_PP
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_128_PP
Source of randomness isXoShiRo128PlusPlus
.
-
XO_RO_SHI_RO_128_PP
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_128_PP
Source of randomness isXoRoShiRo128PlusPlus
.
-
XO_SHI_RO_256_PP
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_256_PP
Source of randomness isXoShiRo256PlusPlus
.
-
XO_SHI_RO_512_PP
public static final ProviderBuilder.RandomSourceInternal XO_SHI_RO_512_PP
Source of randomness isXoShiRo512PlusPlus
.
-
XO_RO_SHI_RO_1024_PP
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_1024_PP
Source of randomness isXoRoShiRo1024PlusPlus
.
-
XO_RO_SHI_RO_1024_S
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_1024_S
Source of randomness isXoRoShiRo1024Star
.
-
XO_RO_SHI_RO_1024_SS
public static final ProviderBuilder.RandomSourceInternal XO_RO_SHI_RO_1024_SS
Source of randomness isXoRoShiRo1024StarStar
.
-
PCG_XSH_RR_32_OS
public static final ProviderBuilder.RandomSourceInternal PCG_XSH_RR_32_OS
Source of randomness isPcgXshRr32
.
-
PCG_XSH_RS_32_OS
public static final ProviderBuilder.RandomSourceInternal PCG_XSH_RS_32_OS
Source of randomness isPcgXshRs32
.
-
PCG_RXS_M_XS_64_OS
public static final ProviderBuilder.RandomSourceInternal PCG_RXS_M_XS_64_OS
Source of randomness isPcgRxsMXs64
.
-
-
Method Detail
-
values
public static ProviderBuilder.RandomSourceInternal[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ProviderBuilder.RandomSourceInternal c : ProviderBuilder.RandomSourceInternal.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ProviderBuilder.RandomSourceInternal valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getRng
public Class<?> getRng()
Gets the implementing class of the random source.- Returns:
- the random source class.
-
isNativeSeed
public <SEED> boolean isNativeSeed(SEED seed)
Checks whether the type of givenseed
is the native type of the implementation.- Type Parameters:
SEED
- Seed type.- Parameters:
seed
- Seed value.- Returns:
true
if the seed can be passed to the builder for this RNG type.
-
createSeed
protected Object createSeed()
Creates a native seed.The default implementation creates a seed of the native type and, for array seeds, ensures not all bits are zero.
This method should be over-ridden to satisfy seed requirements for the generator.
- Returns:
- the native seed
- Since:
- 1.3
-
createByteArraySeed
protected byte[] createByteArraySeed(org.apache.commons.rng.UniformRandomProvider source)
Creates abyte[]
seed using the provided source of randomness.The default implementation creates a full-length seed and ensures not all bits are zero.
This method should be over-ridden to satisfy seed requirements for the generator.
- Parameters:
source
- Source of randomness.- Returns:
- the byte[] seed
- Since:
- 1.3
-
convertSeed
protected Object convertSeed(Object seed)
Converts a seed from any of the supported seed types to a native seed.The default implementation delegates to the native seed type conversion.
This method should be over-ridden to satisfy seed requirements for the generator.
- Parameters:
seed
- Input seed (must not be null).- Returns:
- the native seed
- Throws:
UnsupportedOperationException
- if theseed
type is invalid.- Since:
- 1.3
-
createSeedBytes
public final byte[] createSeedBytes()
Creates a seed suitable for the implementing class represented by this random source.It will satisfy the seed size and any other seed requirements for the implementing class. The seed is converted from the native type to bytes.
- Returns:
- the seed bytes
- Since:
- 1.3
-
createSeedBytes
public final byte[] createSeedBytes(org.apache.commons.rng.UniformRandomProvider source)
Creates a seed suitable for the implementing class represented by this random source using the supplied source of randomness.It will satisfy the seed size and any other seed requirements for the implementing class. The seed is converted from the native type to bytes.
- Parameters:
source
- Source of randomness.- Returns:
- the seed bytes
- Since:
- 1.3
-
-