Package org.apache.commons.rng.sampling
Enum CompositeSamplers.DiscreteProbabilitySampler
- java.lang.Object
-
- java.lang.Enum<CompositeSamplers.DiscreteProbabilitySampler>
-
- org.apache.commons.rng.sampling.CompositeSamplers.DiscreteProbabilitySampler
-
- All Implemented Interfaces:
Serializable
,Comparable<CompositeSamplers.DiscreteProbabilitySampler>
,CompositeSamplers.DiscreteProbabilitySamplerFactory
- Enclosing class:
- CompositeSamplers
public static enum CompositeSamplers.DiscreteProbabilitySampler extends Enum<CompositeSamplers.DiscreteProbabilitySampler> implements CompositeSamplers.DiscreteProbabilitySamplerFactory
The DiscreteProbabilitySampler class defines implementations that sample from a user-defined discrete probability distribution.All implementations support the
SharedStateDiscreteSampler
interface.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ALIAS_METHOD
Sample using the alias method (seeAliasMethodDiscreteSampler
).GUIDE_TABLE
Sample using a guide table (seeGuideTableDiscreteSampler
).LOOKUP_TABLE
Sample using an optimised look-up table (seeMarsagliaTsangWangDiscreteSampler.Enumerated
).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CompositeSamplers.DiscreteProbabilitySampler
valueOf(String name)
Returns the enum constant of this type with the specified name.static CompositeSamplers.DiscreteProbabilitySampler[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface org.apache.commons.rng.sampling.CompositeSamplers.DiscreteProbabilitySamplerFactory
create
-
-
-
-
Enum Constant Detail
-
GUIDE_TABLE
public static final CompositeSamplers.DiscreteProbabilitySampler GUIDE_TABLE
Sample using a guide table (seeGuideTableDiscreteSampler
).
-
ALIAS_METHOD
public static final CompositeSamplers.DiscreteProbabilitySampler ALIAS_METHOD
Sample using the alias method (seeAliasMethodDiscreteSampler
).
-
LOOKUP_TABLE
public static final CompositeSamplers.DiscreteProbabilitySampler LOOKUP_TABLE
Sample using an optimised look-up table (seeMarsagliaTsangWangDiscreteSampler.Enumerated
).
-
-
Method Detail
-
values
public static CompositeSamplers.DiscreteProbabilitySampler[] 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 (CompositeSamplers.DiscreteProbabilitySampler c : CompositeSamplers.DiscreteProbabilitySampler.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static CompositeSamplers.DiscreteProbabilitySampler 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
-
-