/** * performs the clustering * * @return * @throws ClusterException */ public Cluster perform() throws ClusterException { for (int i = 0; i < data.getWidth(); i++) { for (int j = 0; j < data.getHeight(); j++) { if (!cluster.isClustered(i, j)) { ClusterNode node = new SimpleClusterNode(count++); node.addCell(i, j, data.getCellAt(i, j)); cluster.setClusterNode(i, j, node); clusterLoop(i, j, node); } } } return cluster; }
/** * @param cell * @param node * @return * @throws ClusterException */ private boolean checkPixel(int i, int j, double[] cell, ClusterNode node) throws ClusterException { return !cluster.isClustered(i, j) && comparator.evaluate(node, cell); }