public class org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer extends org.apache.commons.math.ml.clustering.Clusterer
{
private final int k;
private final int maxIterations;
private final org.apache.commons.math.random.RandomGenerator random;
private final org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy emptyStrategy;
public void <init>(int)
{
int v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: int;
v = (int) -1;
specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: void <init>(int,int)>(v, v);
return;
}
public void <init>(int, int)
{
int v, v;
org.apache.commons.math.ml.distance.EuclideanDistance v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: int;
v := @parameter: int;
v = new org.apache.commons.math.ml.distance.EuclideanDistance;
specialinvoke v.<org.apache.commons.math.ml.distance.EuclideanDistance: void <init>()>();
specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: void <init>(int,int,org.apache.commons.math.ml.distance.DistanceMeasure)>(v, v, v);
return;
}
public void <init>(int, int, org.apache.commons.math.ml.distance.DistanceMeasure)
{
org.apache.commons.math.random.JDKRandomGenerator v;
int v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
org.apache.commons.math.ml.distance.DistanceMeasure v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: int;
v := @parameter: int;
v := @parameter: org.apache.commons.math.ml.distance.DistanceMeasure;
v = new org.apache.commons.math.random.JDKRandomGenerator;
specialinvoke v.<org.apache.commons.math.random.JDKRandomGenerator: void <init>()>();
specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: void <init>(int,int,org.apache.commons.math.ml.distance.DistanceMeasure,org.apache.commons.math.random.RandomGenerator)>(v, v, v, v);
return;
}
public void <init>(int, int, org.apache.commons.math.ml.distance.DistanceMeasure, org.apache.commons.math.random.RandomGenerator)
{
org.apache.commons.math.random.RandomGenerator v;
int v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
org.apache.commons.math.ml.distance.DistanceMeasure v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: int;
v := @parameter: int;
v := @parameter: org.apache.commons.math.ml.distance.DistanceMeasure;
v := @parameter: org.apache.commons.math.random.RandomGenerator;
v = <org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy LARGEST_VARIANCE>;
specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: void <init>(int,int,org.apache.commons.math.ml.distance.DistanceMeasure,org.apache.commons.math.random.RandomGenerator,org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy)>(v, v, v, v, v);
return;
}
public void <init>(int, int, org.apache.commons.math.ml.distance.DistanceMeasure, org.apache.commons.math.random.RandomGenerator, org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy)
{
org.apache.commons.math.random.RandomGenerator v;
int v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
org.apache.commons.math.ml.distance.DistanceMeasure v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: int;
v := @parameter: int;
v := @parameter: org.apache.commons.math.ml.distance.DistanceMeasure;
v := @parameter: org.apache.commons.math.random.RandomGenerator;
v := @parameter: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy;
specialinvoke v.<org.apache.commons.math.ml.clustering.Clusterer: void <init>(org.apache.commons.math.ml.distance.DistanceMeasure)>(v);
v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int k> = v;
v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int maxIterations> = v;
v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.random.RandomGenerator random> = v;
v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy emptyStrategy> = v;
return;
}
public int getK()
{
int v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int k>;
return v;
}
public int getMaxIterations()
{
int v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int maxIterations>;
return v;
}
public org.apache.commons.math.random.RandomGenerator getRandomGenerator()
{
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
org.apache.commons.math.random.RandomGenerator v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.random.RandomGenerator random>;
return v;
}
public org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy getEmptyClusterStrategy()
{
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy emptyStrategy>;
return v;
}
public java.util.List cluster(java.util.Collection) throws org.apache.commons.math.exception.MathIllegalArgumentException, org.apache.commons.math.exception.ConvergenceException
{
org.apache.commons.math.ml.clustering.CentroidCluster v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy v;
java.lang.Integer v, v;
int[] v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v, v, v;
java.util.Collection v;
org.apache.commons.math.exception.ConvergenceException v;
java.util.List v, v, v;
java.lang.Object[] v;
double[] v;
org.apache.commons.math.ml.clustering.Clusterable v, v;
java.util.ArrayList v;
org.apache.commons.math.exception.NumberIsTooSmallException v;
int v, v, v, v, v, v, v, v, v, v, v, v, v;
java.util.Iterator v;
org.apache.commons.math.exception.util.LocalizedFormats v;
java.lang.Object v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.Collection;
staticinvoke <org.apache.commons.math.util.MathUtils: void checkNotNull(java.lang.Object)>(v);
v = interfaceinvoke v.<java.util.Collection: int size()>();
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int k>;
if v >= v goto label;
v = new org.apache.commons.math.exception.NumberIsTooSmallException;
v = interfaceinvoke v.<java.util.Collection: int size()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int k>;
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
specialinvoke v.<org.apache.commons.math.exception.NumberIsTooSmallException: void <init>(java.lang.Number,java.lang.Number,boolean)>(v, v, 0);
throw v;
label:
v = specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: java.util.List chooseInitialCenters(java.util.Collection)>(v);
v = interfaceinvoke v.<java.util.Collection: int size()>();
v = newarray (int)[v];
specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int assignPointsToClusters(java.util.List,java.util.Collection,int[])>(v, v, v);
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int maxIterations>;
if v >= 0 goto label;
v = 2147483647;
goto label;
label:
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int maxIterations>;
label:
v = v;
v = 0;
label:
if v >= v goto label;
v = 0;
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: java.util.List getPoints()>();
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v == 0 goto label;
v = <org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$1: int[] $SwitchMap$org$apache$commons$math3$ml$clustering$KMeansPlusPlusClusterer$EmptyClusterStrategy>;
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy emptyStrategy>;
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer$EmptyClusterStrategy: int ordinal()>();
v = v[v];
tableswitch(v)
{
case 1: goto label;
case 2: goto label;
case 3: goto label;
default: goto label;
};
label:
v = specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.ml.clustering.Clusterable getPointFromLargestVarianceCluster(java.util.Collection)>(v);
goto label;
label:
v = specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.ml.clustering.Clusterable getPointFromLargestNumberCluster(java.util.Collection)>(v);
goto label;
label:
v = specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.ml.clustering.Clusterable getFarthestPoint(java.util.Collection)>(v);
goto label;
label:
v = new org.apache.commons.math.exception.ConvergenceException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats EMPTY_CLUSTER_IN_K_MEANS>;
v = newarray (java.lang.Object)[0];
specialinvoke v.<org.apache.commons.math.exception.ConvergenceException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Object[])>(v, v);
throw v;
label:
v = 1;
goto label;
label:
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: java.util.List getPoints()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: org.apache.commons.math.ml.clustering.Clusterable getCenter()>();
v = interfaceinvoke v.<org.apache.commons.math.ml.clustering.Clusterable: double[] getPoint()>();
v = lengthof v;
v = specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.ml.clustering.Clusterable centroidOf(java.util.Collection,int)>(v, v);
label:
v = new org.apache.commons.math.ml.clustering.CentroidCluster;
specialinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: void <init>(org.apache.commons.math.ml.clustering.Clusterable)>(v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
goto label;
label:
v = specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int assignPointsToClusters(java.util.List,java.util.Collection,int[])>(v, v, v);
v = v;
if v != 0 goto label;
if v != 0 goto label;
return v;
label:
v = v + 1;
goto label;
label:
return v;
}
private int assignPointsToClusters(java.util.List, java.util.Collection, int[])
{
java.util.Iterator v;
java.util.Collection v;
java.util.List v;
int[] v;
int v, v, v, v, v;
java.lang.Object v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.List;
v := @parameter: java.util.Collection;
v := @parameter: int[];
v = 0;
v = 0;
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = specialinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int getNearestCluster(java.util.Collection,org.apache.commons.math.ml.clustering.Clusterable)>(v, v);
v = v[v];
if v == v goto label;
v = v + 1;
label:
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: void addPoint(org.apache.commons.math.ml.clustering.Clusterable)>(v);
v = v;
v = v + 1;
v[v] = v;
goto label;
label:
return v;
}
private java.util.List chooseInitialCenters(java.util.Collection)
{
org.apache.commons.math.ml.clustering.CentroidCluster v, v;
byte v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v, v, v, v;
java.util.Collection v;
java.util.List v;
double[] v;
java.util.ArrayList v, v;
int v, v, v, v, v, v, v, v, v, v, v, v, v, v;
double v, v, v, v, v, v, v, v, v, v, v;
boolean[] v;
org.apache.commons.math.random.RandomGenerator v, v;
java.lang.Object v, v, v, v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.Collection;
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>(java.util.Collection)>(v);
v = staticinvoke <java.util.Collections: java.util.List unmodifiableList(java.util.List)>(v);
v = interfaceinvoke v.<java.util.List: int size()>();
v = newarray (boolean)[v];
v = new java.util.ArrayList;
specialinvoke v.<java.util.ArrayList: void <init>()>();
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.random.RandomGenerator random>;
v = interfaceinvoke v.<org.apache.commons.math.random.RandomGenerator: int nextInt(int)>(v);
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = new org.apache.commons.math.ml.clustering.CentroidCluster;
specialinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: void <init>(org.apache.commons.math.ml.clustering.Clusterable)>(v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
v[v] = 1;
v = newarray (double)[v];
v = 0;
label:
if v >= v goto label;
if v == v goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: double distance(org.apache.commons.math.ml.clustering.Clusterable,org.apache.commons.math.ml.clustering.Clusterable)>(v, v);
v = v * v;
v[v] = v;
label:
v = v + 1;
goto label;
label:
v = interfaceinvoke v.<java.util.List: int size()>();
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int k>;
if v >= v goto label;
v = 0.0;
v = 0;
label:
if v >= v goto label;
v = v[v];
if v != 0 goto label;
v = v[v];
v = v + v;
label:
v = v + 1;
goto label;
label:
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.random.RandomGenerator random>;
v = interfaceinvoke v.<org.apache.commons.math.random.RandomGenerator: double nextDouble()>();
v = v * v;
v = (int) -1;
v = v;
v = 0.0;
v = 0;
label:
if v >= v goto label;
v = v[v];
if v != 0 goto label;
v = v[v];
v = v + v;
v = v cmpl v;
if v < 0 goto label;
v = v;
goto label;
label:
v = v + 1;
goto label;
label:
v = (int) -1;
if v != v goto label;
v = v - 1;
label:
if v < 0 goto label;
v = v[v];
if v != 0 goto label;
v = v;
goto label;
label:
v = v - 1;
goto label;
label:
if v < 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = new org.apache.commons.math.ml.clustering.CentroidCluster;
specialinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: void <init>(org.apache.commons.math.ml.clustering.Clusterable)>(v);
interfaceinvoke v.<java.util.List: boolean add(java.lang.Object)>(v);
v[v] = 1;
v = interfaceinvoke v.<java.util.List: int size()>();
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: int k>;
if v >= v goto label;
v = 0;
label:
if v >= v goto label;
v = v[v];
if v != 0 goto label;
v = interfaceinvoke v.<java.util.List: java.lang.Object get(int)>(v);
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: double distance(org.apache.commons.math.ml.clustering.Clusterable,org.apache.commons.math.ml.clustering.Clusterable)>(v, v);
v = v * v;
v = v[v];
v = v cmpg v;
if v >= 0 goto label;
v[v] = v;
label:
v = v + 1;
goto label;
label:
return v;
}
private org.apache.commons.math.ml.clustering.Clusterable getPointFromLargestVarianceCluster(java.util.Collection) throws org.apache.commons.math.exception.ConvergenceException
{
java.lang.Object[] v;
org.apache.commons.math.ml.clustering.CentroidCluster v;
org.apache.commons.math.ml.clustering.Clusterable v;
byte v;
int v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v, v, v;
double v, v, v;
java.util.Iterator v, v;
org.apache.commons.math.exception.util.LocalizedFormats v;
java.util.Collection v;
org.apache.commons.math.exception.ConvergenceException v;
java.util.List v, v, v;
org.apache.commons.math.random.RandomGenerator v;
org.apache.commons.math.stat.descriptive.moment.Variance v;
java.lang.Object v, v, v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.Collection;
v = #-Infinity;
v = null;
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: java.util.List getPoints()>();
v = interfaceinvoke v.<java.util.List: boolean isEmpty()>();
if v != 0 goto label;
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: org.apache.commons.math.ml.clustering.Clusterable getCenter()>();
v = new org.apache.commons.math.stat.descriptive.moment.Variance;
specialinvoke v.<org.apache.commons.math.stat.descriptive.moment.Variance: void <init>()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: java.util.List getPoints()>();
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: double distance(org.apache.commons.math.ml.clustering.Clusterable,org.apache.commons.math.ml.clustering.Clusterable)>(v, v);
virtualinvoke v.<org.apache.commons.math.stat.descriptive.moment.Variance: void increment(double)>(v);
goto label;
label:
v = virtualinvoke v.<org.apache.commons.math.stat.descriptive.moment.Variance: double getResult()>();
v = v cmpl v;
if v <= 0 goto label;
v = v;
v = v;
goto label;
label:
if v != null goto label;
v = new org.apache.commons.math.exception.ConvergenceException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats EMPTY_CLUSTER_IN_K_MEANS>;
v = newarray (java.lang.Object)[0];
specialinvoke v.<org.apache.commons.math.exception.ConvergenceException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Object[])>(v, v);
throw v;
label:
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.Cluster: java.util.List getPoints()>();
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.random.RandomGenerator random>;
v = interfaceinvoke v.<java.util.List: int size()>();
v = interfaceinvoke v.<org.apache.commons.math.random.RandomGenerator: int nextInt(int)>(v);
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(v);
return v;
}
private org.apache.commons.math.ml.clustering.Clusterable getPointFromLargestNumberCluster(java.util.Collection) throws org.apache.commons.math.exception.ConvergenceException
{
java.lang.Object[] v;
int v, v, v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v;
java.util.Iterator v;
org.apache.commons.math.exception.util.LocalizedFormats v;
java.util.Collection v;
org.apache.commons.math.exception.ConvergenceException v;
java.util.List v, v;
org.apache.commons.math.random.RandomGenerator v;
java.lang.Object v, v;
org.apache.commons.math.ml.clustering.Cluster v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.Collection;
v = 0;
v = null;
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.Cluster: java.util.List getPoints()>();
v = interfaceinvoke v.<java.util.List: int size()>();
if v <= v goto label;
v = v;
v = v;
goto label;
label:
if v != null goto label;
v = new org.apache.commons.math.exception.ConvergenceException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats EMPTY_CLUSTER_IN_K_MEANS>;
v = newarray (java.lang.Object)[0];
specialinvoke v.<org.apache.commons.math.exception.ConvergenceException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Object[])>(v, v);
throw v;
label:
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.Cluster: java.util.List getPoints()>();
v = v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: org.apache.commons.math.random.RandomGenerator random>;
v = interfaceinvoke v.<java.util.List: int size()>();
v = interfaceinvoke v.<org.apache.commons.math.random.RandomGenerator: int nextInt(int)>(v);
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(v);
return v;
}
private org.apache.commons.math.ml.clustering.Clusterable getFarthestPoint(java.util.Collection) throws org.apache.commons.math.exception.ConvergenceException
{
java.lang.Object[] v;
org.apache.commons.math.ml.clustering.CentroidCluster v;
org.apache.commons.math.ml.clustering.Clusterable v;
byte v;
int v, v, v, v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v;
double v, v;
java.util.Iterator v;
org.apache.commons.math.exception.util.LocalizedFormats v;
java.util.Collection v;
org.apache.commons.math.exception.ConvergenceException v;
java.util.List v, v;
java.lang.Object v, v, v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.Collection;
v = #-Infinity;
v = null;
v = (int) -1;
v = v;
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: org.apache.commons.math.ml.clustering.Clusterable getCenter()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: java.util.List getPoints()>();
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 = virtualinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: double distance(org.apache.commons.math.ml.clustering.Clusterable,org.apache.commons.math.ml.clustering.Clusterable)>(v, v);
v = v cmpl v;
if v <= 0 goto label;
v = v;
v = v;
v = v;
label:
v = v + 1;
goto label;
label:
if v != null goto label;
v = new org.apache.commons.math.exception.ConvergenceException;
v = <org.apache.commons.math.exception.util.LocalizedFormats: org.apache.commons.math.exception.util.LocalizedFormats EMPTY_CLUSTER_IN_K_MEANS>;
v = newarray (java.lang.Object)[0];
specialinvoke v.<org.apache.commons.math.exception.ConvergenceException: void <init>(org.apache.commons.math.exception.util.Localizable,java.lang.Object[])>(v, v);
throw v;
label:
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.Cluster: java.util.List getPoints()>();
v = interfaceinvoke v.<java.util.List: java.lang.Object remove(int)>(v);
return v;
}
private int getNearestCluster(java.util.Collection, org.apache.commons.math.ml.clustering.Clusterable)
{
java.util.Iterator v;
java.util.Collection v;
org.apache.commons.math.ml.clustering.Clusterable v, v;
byte v;
int v, v;
java.lang.Object v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v;
double v, v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.Collection;
v := @parameter: org.apache.commons.math.ml.clustering.Clusterable;
v = 1.7976931348623157E308;
v = 0;
v = 0;
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.CentroidCluster: org.apache.commons.math.ml.clustering.Clusterable getCenter()>();
v = virtualinvoke v.<org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer: double distance(org.apache.commons.math.ml.clustering.Clusterable,org.apache.commons.math.ml.clustering.Clusterable)>(v, v);
v = v cmpg v;
if v >= 0 goto label;
v = v;
v = v;
label:
v = v + 1;
goto label;
label:
return v;
}
private org.apache.commons.math.ml.clustering.Clusterable centroidOf(java.util.Collection, int)
{
double[] v, v;
int v, v, v, v, v, v;
org.apache.commons.math.ml.clustering.DoublePoint v;
org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer v;
boolean v;
double v, v, v, v, v;
java.util.Iterator v;
java.util.Collection v;
java.lang.Object v;
v := @this: org.apache.commons.math.ml.clustering.KMeansPlusPlusClusterer;
v := @parameter: java.util.Collection;
v := @parameter: int;
v = newarray (double)[v];
v = interfaceinvoke v.<java.util.Collection: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
v = interfaceinvoke v.<org.apache.commons.math.ml.clustering.Clusterable: double[] getPoint()>();
v = 0;
label:
v = lengthof v;
if v >= v goto label;
v = v[v];
v = v[v];
v = v + v;
v[v] = v;
v = v + 1;
goto label;
label:
v = 0;
label:
v = lengthof v;
if v >= v goto label;
v = v[v];
v = interfaceinvoke v.<java.util.Collection: int size()>();
v = v / v;
v[v] = v;
v = v + 1;
goto label;
label:
v = new org.apache.commons.math.ml.clustering.DoublePoint;
specialinvoke v.<org.apache.commons.math.ml.clustering.DoublePoint: void <init>(double[])>(v);
return v;
}
}