Obtains the clusters for the points added. This method may be called
at any time, including between calls to add().

@return the result of clustering the points thus far added
513130
public List<GvmResult<K>> results() {
		ArrayList<GvmResult<K>> list = new ArrayList<GvmResult<K>>(count);
		for (int i = 0; i < count; i++) {
			GvmCluster<S,K> cluster = clusters[i];
			//TODO exclude massless clusters?
			list.add(new GvmResult<K>(cluster));
		}
		return list;
	}
657630
protected void determineNumberOfClusters() {
        if (!m_numberOfClustersDetermined
                && (m_cobwebTree != null)) {
            int[] numClusts = new int[1];
            numClusts[0] = 0;
            //  try {
            m_cobwebTree.assignClusterNums(numClusts);
            // }
            // catch (Exception e) {
//	e.printStackTrace();
//	numClusts[0] = 0;
            // }
            m_numberOfClusters = numClusts[0];

            m_numberOfClustersDetermined = true;
        }
    }
1199134
public Clustering addToClustering(Clustering clustering) {
		if (center != null && getClusteringFeature() != null) {
			clustering.add(getClusteringFeature().toCluster());
		}
		for (ClusteringTreeNode child : children) {
			child.addToClustering(clustering);
		}
		return clustering;
	}
953832
public long getRangeFrom() {
		final long limit = (liveUpdated ? database.getStorage().getClusterDataRange(current.clusterId)[1] : firstClusterPosition) - 1;
		if (rangeFrom > -1)
			return Math.max(rangeFrom, limit);
		return limit;
	}
1155640
public int getTotalClusterCount() {
    int clusterCount = 0;

    for(int i = 0; i < numclusters.length; i++) {
      clusterCount += numclusters[i];
    }

    return clusterCount;
  }
720853
protected Vector<Point<Integer>> listPoints() {
    Vector<Point<Integer>>	result;
    int			i;
    int[]			max;
    Integer[]			locations;
    boolean			ok;

    result = new Vector<Point<Integer>>();

    // determine maximum locations per dimension
    max = new int[dimensions()];
    for (i = 0; i < max.length; i++)
      max[i] = getDimension(i).width();

    // create first point
    locations = new Integer[dimensions()];
    for (i = 0; i < locations.length; i++)
      locations[i] = 0;
    result.add(new Point<Integer>(locations));

    ok = true;
    while (ok) {
      ok = inc(locations, max);
      if (ok)
        result.add(new Point<Integer>(locations));
    }

    return result;
  }
369497
public ArrayList<Integer> getOccurrences() {
    ArrayList<Integer> res = new ArrayList<Integer>(this.occurrences.size());
    for (Integer e : this.occurrences) {
      res.add(e);
    }
    return res;
  }
958262
public int getHighestClusterCount() {
    int maxClusters = 0;

    for(int i = 0; i < numclusters.length; i++) {
      maxClusters = Math.max(maxClusters, numclusters[i]);
    }
    return maxClusters;
  }
117533
private void iterations() {
        int iterationCount = 0;
        while ((clusteringStrategy.getTerminationCondition() != null
                        && !clusteringStrategy.getTerminationCondition().isSatisfied(iterationHistory))
                        || iterationHistory.getMostRecentIterationInfo().isStrategyApplied()) {
            currentIteration++;
            removePoints();
            classifyPoints();
            applyClusteringStrategy();
            log.trace("Completed clustering iteration {}", ++iterationCount);
        }
    }
320291
public java.util.List<ClusterDbRevision> getClusterDbRevisions() {
        if (clusterDbRevisions == null) {
            clusterDbRevisions = new com.amazonaws.internal.SdkInternalList<ClusterDbRevision>();
        }
        return clusterDbRevisions;
    }
1062723
public java.util.List<DBClusterSnapshotAttribute> getDBClusterSnapshotAttributes() {
        if (dBClusterSnapshotAttributes == null) {
            dBClusterSnapshotAttributes = new com.amazonaws.internal.SdkInternalList<DBClusterSnapshotAttribute>();
        }
        return dBClusterSnapshotAttributes;
    }
51776
public ClusterInfo getClusterInfoOrNull() {
        String clusterName = getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_NAME);
        if (clusterName == null) {
            return null;
        }
        String clusterUUID = getProperty(InternalConfigurationOptions.INTERNAL_ES_CLUSTER_UUID);
        EsMajorVersion version = getInternalVersionOrThrow();
        return new ClusterInfo(new ClusterName(clusterName, clusterUUID), version);
    }
826229
public int getNumPoints() {
		if (isEmpty()) {
			return 0;
		}
		int total = 0;
		for (Polygon polygon : polygons) {
			total += polygon.getNumPoints();
		}
		return total;
	}
26740
public static int numPoints(Clustering<? extends MeanModel> clustering) {
    int n = 0;
    for(Cluster<? extends MeanModel> aCluster : clustering.getAllClusters()) {
      n += aCluster.size();
    }
    return n;
  }
1172543
public DataStore<? extends DBIDs> getNeighs() {
    final DBIDs ids = points.getDBIDs();
    // init lists
    WritableDataStore<ModifiableDBIDs> neighs = DataStoreUtil.makeStorage(ids, DataStoreFactory.HINT_HOT, ModifiableDBIDs.class);
    for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
      neighs.put(it, DBIDUtil.newHashSet());
    }

    FiniteProgress splitp = LOG.isVerbose() ? new FiniteProgress("Processing splits for neighborhoods", splitsets.size(), LOG) : null;
    // go through all sets
    Iterator<ArrayDBIDs> it1 = splitsets.iterator();
    DBIDVar v = DBIDUtil.newVar();
    while(it1.hasNext()) {
      ArrayDBIDs pinSet = it1.next();

      final int indoff = pinSet.size() >> 1; // middle point of projection
      pinSet.assignVar(indoff, v);
      // add all points as neighbors to middle point
      neighs.get(v).addDBIDs(pinSet);

      // and the the middle point to all other points in set
      for(DBIDIter it = pinSet.iter(); it.valid(); it.advance()) {
        neighs.get(it).add(v);
      }
      LOG.incrementProcessed(splitp);
    }
    LOG.ensureCompleted(splitp);
    return neighs;
  }
41919
public float[] getClusterMean(){
        float[] normedCurrentLocation = new float[mCurrentMeanLocation.length];
        for ( int i = 0; i < mCurrentMeanLocation.length; i++ ){
            normedCurrentLocation[i] = mCurrentMeanLocation[i]/((float)mClusterItems.size());
        }
        return normedCurrentLocation;
    }
101808
public int[][] getClusterLabel() {
        if (y == null) {
           throw new IllegalStateException("Neuron cluster labels are not available. Call partition() first.");
        }

        int[][] clusterLabels = new int[height][width];
        for (int i = 0, l = 0; i < height; i++) {
            for (int j = 0; j < width; j++) {
                clusterLabels[i][j] = y[i*width + j];
            }
        }
        return clusterLabels;
    }