public class org.apache.commons.math.distribution.EnumeratedDistribution extends java.lang.Object implements java.io.Serializable
{
private static final long serialVersionUID;
protected final org.apache.commons.math.random.RandomGenerator random;
private final java.util.List singletons;
private final double[] probabilities;
public void <init>(java.util.List) throws org.apache.commons.math.exception.NotPositiveException, org.apache.commons.math.exception.MathArithmeticException, org.apache.commons.math.exception.NotFiniteNumberException, org.apache.commons.math.exception.NotANumberException
{
org.apache.commons.math.random.Well19937c v;
java.util.List v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v := @parameter: java.util.List;
v = new org.apache.commons.math.random.Well19937c;
specialinvoke v.<org.apache.commons.math.random.Well19937c: void <init>()>();
specialinvoke v.<org.apache.commons.math.distribution.EnumeratedDistribution: void <init>(org.apache.commons.math.random.RandomGenerator,java.util.List)>(v, v);
return;
}
public void <init>(org.apache.commons.math.random.RandomGenerator, java.util.List) throws org.apache.commons.math.exception.NotPositiveException, org.apache.commons.math.exception.MathArithmeticException, org.apache.commons.math.exception.NotFiniteNumberException, org.apache.commons.math.exception.NotANumberException
{
java.lang.Object[] v;
org.apache.commons.math.exception.NotANumberException v;
java.lang.Double v;
double[] v, v;
java.util.ArrayList v;
byte v;
org.apache.commons.math.exception.NotPositiveException v;
int v, v, v, v;
boolean v, v;
double v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
java.util.List v, v;
org.apache.commons.math.random.RandomGenerator v;
java.lang.Object v, v, v, v;
org.apache.commons.math.exception.NotFiniteNumberException v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v := @parameter: org.apache.commons.math.random.RandomGenerator;
v := @parameter: java.util.List;
specialinvoke v.<java.lang.Object: void <init>()>();
v.<org.apache.commons.math.distribution.EnumeratedDistribution: org.apache.commons.math.random.RandomGenerator random> = v;
v = new java.util.ArrayList;
v = interfaceinvoke v.<java.util.List: int size()>();
specialinvoke v.<java.util.ArrayList: void <init>(int)>(v);
v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons> = v;
v = interfaceinvoke v.<java.util.List: int size()>();
v = newarray (double)[v];
v = 0;
label:
v = interfaceinvoke v.<java.util.List: int size()>();
if v >= v goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons>;
v = virtualinvoke v.<org.apache.commons.math.util.Pair: java.lang.Object getKey()>();
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
v = virtualinvoke v.<org.apache.commons.math.util.Pair: java.lang.Object getValue()>();
v = virtualinvoke v.<java.lang.Double: double doubleValue()>();
v = v cmpg 0.0;
if v >= 0 goto label;
v = new org.apache.commons.math.exception.NotPositiveException;
v = virtualinvoke v.<org.apache.commons.math.util.Pair: java.lang.Object getValue()>();
specialinvoke v.<org.apache.commons.math.exception.NotPositiveException: void <init>(java.lang.Number)>(v);
throw v;
label:
v = staticinvoke <java.lang.Double: boolean isInfinite(double)>(v);
if v == 0 goto label;
v = new org.apache.commons.math.exception.NotFiniteNumberException;
v = staticinvoke <java.lang.Double: java.lang.Double valueOf(double)>(v);
v = newarray (java.lang.Object)[0];
specialinvoke v.<org.apache.commons.math.exception.NotFiniteNumberException: void <init>(java.lang.Number,java.lang.Object[])>(v, v);
throw v;
label:
v = staticinvoke <java.lang.Double: boolean isNaN(double)>(v);
if v == 0 goto label;
v = new org.apache.commons.math.exception.NotANumberException;
specialinvoke v.<org.apache.commons.math.exception.NotANumberException: void <init>()>();
throw v;
label:
v[v] = v;
v = v + 1;
goto label;
label:
v = staticinvoke <org.apache.commons.math.util.MathArrays: double[] normalizeArray(double[],double)>(v, 1.0);
v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities> = v;
return;
}
public void reseedRandomGenerator(long)
{
long v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
org.apache.commons.math.random.RandomGenerator v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v := @parameter: long;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: org.apache.commons.math.random.RandomGenerator random>;
interfaceinvoke v.<org.apache.commons.math.random.RandomGenerator: void setSeed(long)>(v);
return;
}
double probability(java.lang.Object)
{
double[] v, v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
java.util.List v, v;
int v, v;
java.lang.Object v, v, v;
boolean v;
double v, v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v := @parameter: java.lang.Object;
v = 0.0;
v = 0;
label:
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities>;
v = lengthof v;
if v >= v goto label;
if v != null goto label;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons>;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
if v == null goto label;
label:
if v == null goto label;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons>;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = virtualinvoke v.<java.lang.Object: boolean equals(java.lang.Object)>(v);
if v == 0 goto label;
label:
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities>;
v = v[v];
v = v + v;
label:
v = v + 1;
goto label;
label:
return v;
}
public java.util.List getPmf()
{
org.apache.commons.math.util.Pair v;
java.lang.Double v;
double[] v, v, v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
java.util.ArrayList v;
java.util.List v;
int v, v, v;
java.lang.Object v;
double v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v = new java.util.ArrayList;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities>;
v = lengthof v;
specialinvoke v.<java.util.ArrayList: void <init>(int)>(v);
v = 0;
label:
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities>;
v = lengthof v;
if v >= v goto label;
v = new org.apache.commons.math.util.Pair;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons>;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities>;
v = v[v];
v = staticinvoke <java.lang.Double: java.lang.Double valueOf(double)>(v);
specialinvoke v.<org.apache.commons.math.util.Pair: void <init>(java.lang.Object,java.lang.Object)>(v, v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
v = v + 1;
goto label;
label:
return v;
}
public java.lang.Object sample()
{
double[] v, v;
byte v;
int v, v, v, v;
double v, v, v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
java.util.List v, v, v;
org.apache.commons.math.random.RandomGenerator v;
java.lang.Object v, v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: org.apache.commons.math.random.RandomGenerator random>;
v = interfaceinvoke v.<org.apache.commons.math.random.RandomGenerator: double nextDouble()>();
v = 0.0;
v = 0;
label:
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities>;
v = lengthof v;
if v >= v goto label;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: double[] probabilities>;
v = v[v];
v = v + v;
v = v cmpg v;
if v >= 0 goto label;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons>;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
return v;
label:
v = v + 1;
goto label;
label:
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons>;
v = v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.util.List singletons>;
v = interfaceinvoke v.<java.util.List: int size()>();
v = v - 1;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
return v;
}
public java.lang.Object[] sample(int) throws org.apache.commons.math.exception.NotStrictlyPositiveException
{
java.lang.Object[] v;
org.apache.commons.math.exception.util.LocalizedFormats v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
java.lang.Integer v;
org.apache.commons.math.exception.NotStrictlyPositiveException v;
int v, v;
java.lang.Object v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v := @parameter: int;
if v > 0 goto label;
v = new org.apache.commons.math.exception.NotStrictlyPositiveException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats NUMBER_OF_SAMPLES>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
specialinvoke v.<org.apache.commons.math.exception.NotStrictlyPositiveException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Number)>(v, v);
throw v;
label:
v = newarray (java.lang.Object)[v];
v = 0;
label:
if v >= v goto label;
v = virtualinvoke v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.lang.Object sample()>();
v[v] = v;
v = v + 1;
goto label;
label:
return v;
}
public java.lang.Object[] sample(int, java.lang.Object[]) throws org.apache.commons.math.exception.NotStrictlyPositiveException
{
java.lang.Object[] v, v, v;
java.lang.Integer v;
int v, v, v;
org.apache.commons.math.exception.util.LocalizedFormats v, v;
org.apache.commons.math.distribution.EnumeratedDistribution v;
org.apache.commons.math.exception.NotStrictlyPositiveException v;
org.apache.commons.math.exception.NullArgumentException v;
java.lang.Class v, v;
java.lang.Object v, v;
v := @this: org.apache.commons.math.distribution.EnumeratedDistribution;
v := @parameter: int;
v := @parameter: java.lang.Object[];
if v > 0 goto label;
v = new org.apache.commons.math.exception.NotStrictlyPositiveException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats NUMBER_OF_SAMPLES>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
specialinvoke v.<org.apache.commons.math.exception.NotStrictlyPositiveException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Number)>(v, v);
throw v;
label:
if v != null goto label;
v = new org.apache.commons.math.exception.NullArgumentException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats INPUT_ARRAY>;
v = newarray (java.lang.Object)[0];
specialinvoke v.<org.apache.commons.math.exception.NullArgumentException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Object[])>(v, v);
throw v;
label:
v = lengthof v;
if v >= v goto label;
v = virtualinvoke v.<java.lang.Object: java.lang.Class getClass()>();
v = virtualinvoke v.<java.lang.Class: java.lang.Class getComponentType()>();
v = staticinvoke <java.lang.reflect.Array: java.lang.Object newInstance(java.lang.Class,int)>(v, v);
v = v;
goto label;
label:
v = v;
label:
v = 0;
label:
if v >= v goto label;
v = virtualinvoke v.<org.apache.commons.math.distribution.EnumeratedDistribution: java.lang.Object sample()>();
v[v] = v;
v = v + 1;
goto label;
label:
return v;
}
}