public NNRegionMode(double[][] data) { this.data = data; this.nn = nnf.create(data); } @Override
@Override public Result cluster(DataSource<double[]> ds) { try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public FeatureVectorCentroidsResult<T> cluster(DataSource<T> ds) { try { final Result<T> result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (final Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(DataSource<int[]> ds) { try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(DataSource<long[]> ds) { try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(DataSource<float[]> ds) { try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(DataSource<short[]> ds) { try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(DataSource<byte[]> ds) { try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result<T> cluster(T[] data) { final ArrayBackedDataSource<T> ds = new ArrayBackedDataSource<T>(data, rng) { @Override public int numDimensions() { return data[0].length(); } }; try { final Result<T> result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (final Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(long[][] data) { DataSource<long[]> ds = new LongArrayBackedDataSource(data, rng); try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(float[][] data) { DataSource<float[]> ds = new FloatArrayBackedDataSource(data, rng); try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(byte[][] data) { DataSource<byte[]> ds = new ByteArrayBackedDataSource(data, rng); try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(double[][] data) { DataSource<double[]> ds = new DoubleArrayBackedDataSource(data, rng); try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(int[][] data) { DataSource<int[]> ds = new IntArrayBackedDataSource(data, rng); try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
@Override public Result cluster(short[][] data) { DataSource<short[]> ds = new ShortArrayBackedDataSource(data, rng); try { Result result = cluster(ds, conf.K); result.nn = conf.factory.create(result.centroids); return result; } catch (Exception e) { throw new RuntimeException(e); } }
Arrays.fill(new_counts, 0); ShortNearestNeighbours nno = conf.factory.create(centroids);
Arrays.fill(new_counts, 0); DoubleNearestNeighbours nno = conf.factory.create(centroids);
Arrays.fill(new_counts, 0); IntNearestNeighbours nno = conf.factory.create(centroids);
Arrays.fill(new_counts, 0); LongNearestNeighbours nno = conf.factory.create(centroids);
Arrays.fill(new_counts, 0); ByteNearestNeighbours nno = conf.factory.create(centroids);