Log cluster sizes in verbose mode.

@param m Log message
@param dimensionality Dimensionality
@param clustersMap Cluster map
178294
private void logClusterSizes(String m, int dimensionality, Object2ObjectOpenCustomHashMap<long[], List<ArrayModifiableDBIDs>> clustersMap) {
    if(LOG.isVerbose()) {
      final StringBuilder msg = new StringBuilder(1000).append(m).append('\n');
      for(ObjectIterator<Object2ObjectMap.Entry<long[], List<ArrayModifiableDBIDs>>> iter = clustersMap.object2ObjectEntrySet().fastIterator(); iter.hasNext();) {
        Object2ObjectMap.Entry<long[], List<ArrayModifiableDBIDs>> entry = iter.next();
        msg.append(BitsUtil.toStringLow(entry.getKey(), dimensionality)).append(" sizes:");
        for(ArrayModifiableDBIDs c : entry.getValue()) {
          msg.append(' ').append(c.size());
        }
        msg.append('\n');
      }
      LOG.verbose(msg.toString());
    }
  }
1021738
public static void elementLog(DMatrixD1 A , DMatrixD1 C ) {

        if( A.numCols != C.numCols || A.numRows != C.numRows ) {
            throw new MatrixDimensionException("All matrices must be the same shape");
        }

        int size = A.getNumElements();
        for( int i = 0; i < size; i++ ) {
            C.data[i] = Math.log(A.data[i]);
        }
    }
742682
public static void main(final String[] args) {
                int[] example = (new ClusteredDataGenerator())
                        .generateClustered(20, 1000);
                for (int k = 0; k < example.length; ++k)
                        System.out.println(example[k]);
        }
462652
public void setClusterNodes(java.util.Collection<ClusterNode> clusterNodes) {
        if (clusterNodes == null) {
            this.clusterNodes = null;
            return;
        }

        this.clusterNodes = new com.amazonaws.internal.SdkInternalList<ClusterNode>(clusterNodes);
    }
1282509
void getClusterXY(int cluster, Point2D ptOut) {
		int vindex = getClusterVertexIndex(cluster);
		m_shape.getXYWithIndex(vindex, ptOut);
	}
538728
void add(final double m, final Object pt) {
		if (count == 0) {
			set(m, pt);
		} else {
			count += 1;
			
			if (m != 0.0) {
				m0 += m;
				clusters.space.addScaled(m1, m, pt);
				clusters.space.addScaledSqr(m2, m, pt);
				update();
			}
		}
	}
581380
public void listClusters() {
    System.out.println("\nListing Clusters");
    // [START bigtable_get_clusters]
    try {
      List<Cluster> clusters = adminClient.listClusters(instanceId);
      for (Cluster cluster : clusters) {
        System.out.println(cluster.getId());
      }
    } catch (NotFoundException e) {
      System.err.println("Failed to list clusters from a non-existent instance: " + e.getMessage());
    }
    // [END bigtable_get_clusters]
  }
469211
def _vmf_log(X, kappa, mu):
    
    n_examples, n_features = X.shape
    return np.log(_vmf_normalize(kappa, n_features) * np.exp(kappa * X.dot(mu).T))
433919
private Map<Integer, Integer> getNodeIdToPrimaryCount(Cluster cluster) {
        Map<Integer, Integer> nodeIdToPrimaryCount = Maps.newHashMap();
        for(Node node: cluster.getNodes()) {
            nodeIdToPrimaryCount.put(node.getId(), node.getPartitionIds().size());
        }

        return nodeIdToPrimaryCount;
    }
761828
void set(GvmCluster<S,K> cluster) {
		if (cluster == this) throw new IllegalArgumentException("cannot set cluster to itself");
		
		m0 = cluster.m0;
		clusters.space.setTo(m1, cluster.m1);
		clusters.space.setTo(m2, cluster.m2);
		var = cluster.var;
	}
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;
        }
    }
962865
public void add(double m, Object pt, K key) {
		if (m == 0.0) return; //nothing to do
		if (count < capacity) { //shortcut
			//TODO should prefer add if var comes to zero
			GvmCluster<S,K> cluster = new GvmCluster<S,K>(this);
			clusters[additions] = cluster;
			cluster.set(m, pt);
			addPairs();
			cluster.key = keyer.addKey(cluster, key);
			count++;
			bound = count;
		} else {
			//identify cheapest merge
			GvmClusterPair<S,K> mergePair = pairs.peek();
			double mergeT = mergePair == null ? Double.MAX_VALUE : mergePair.value;
			//find cheapest addition
			GvmCluster<S,K> additionC = null;
			double additionT = Double.MAX_VALUE;
			for (int i = 0; i < clusters.length; i++) {
				GvmCluster<S,K> cluster = clusters[i];
				double t = cluster.test(m, pt);
				if (t < additionT) {
					additionC = cluster;
					additionT = t;
				}
			}
			if (additionT <= mergeT) {
				//chose addition
				additionC.add(m, pt);
				updatePairs(additionC);
				additionC.key = keyer.addKey(additionC, key);
			} else {
				//choose merge
				GvmCluster<S,K> c1 = mergePair.c1;
				GvmCluster<S,K> c2 = mergePair.c2;
				if (c1.m0 < c2.m0) {
					c1 = c2;
					c2 = mergePair.c1;
				}
				c1.key = keyer.mergeKeys(c1, c2);
				c1.add(c2);
				updatePairs(c1);
				c2.set(m, pt);
				updatePairs(c2);
				//TODO should this pass through a method on keyer?
				c2.key = null;
				c2.key = keyer.addKey(c2, key);
			}
		}
		additions++;
	}
1154494
public static void incrLogMetrics(Map<String, Long> incrMetrics) {
    if (incrMetrics == null || incrMetrics.size() == 0) {
      return;
    }
    MetricsRegistry registry = RaidNodeMetrics.getInstance(
        RaidNodeMetrics.DEFAULT_NAMESPACE_ID).getMetricsRegistry();
    Map<String, MetricsTimeVaryingLong> logMetrics = RaidNodeMetrics.getInstance(
        RaidNodeMetrics.DEFAULT_NAMESPACE_ID).logMetrics;
    synchronized(logMetrics) {
      for (String key : incrMetrics.keySet()) {
        if (!logMetrics.containsKey(key)) {
          logMetrics.put(key, new MetricsTimeVaryingLong(key, registry));
        }
        ((MetricsTimeVaryingLong)logMetrics.get(key)).inc(incrMetrics.get(key));
      }
    }
  }
1279285
public <E extends WeightedEdge> MultiMap<Integer,Integer> cluster(
              final WeightedGraph<E> graph, int numClusters, Properties props) {
        if (props.getProperty(KEEP_WEIGHT_VECTORS_PROPERTY) != null)
            keepWeightVectors = Boolean.parseBoolean(
                props.getProperty(KEEP_WEIGHT_VECTORS_PROPERTY));
        vertexToWeightVector.clear();
        return super.cluster(graph, numClusters, props);
    }
70418
@Override
  public void writeToText(TextWriterStream out, String label) {
    String name = getNameAutomatic();
    if(name != null) {
      out.commentPrintLn("Cluster name: " + name);
    }
    out.commentPrintLn("Cluster noise flag: " + isNoise());
    out.commentPrintLn("Cluster size: " + ids.size());
    // also print model, if any and printable
    if(getModel() != null && (getModel() instanceof TextWriteable)) {
      ((TextWriteable) getModel()).writeToText(out, label);
    }
  }
517749
public void setSize(org.kie.dmn.model.api.dmndi.Dimension value) {
        this.size = value;
    }
463781
public Assignments cluster(Matrix m,
                               int maxClusters,
                               Properties props) {
        int startSize = Integer.parseInt(props.getProperty(
                NUM_CLUSTERS_START, DEFAULT_NUM_CLUSTERS_START));
        int numGaps = Integer.parseInt(props.getProperty(
                NUM_REFERENCE_DATA_SETS, DEFAULT_NUM_REFERENCE_DATA_SETS));
        int numIterations = maxClusters - startSize;
        String criterion = props.getProperty(METHOD_PROPERTY, DEFAULT_METHOD);

        verbose("Transforming the original data set");
        Transform tfidf = new TfIdfDocStripedTransform();
        Transform rowMag = new RowMagnitudeTransform();
        m = rowMag.transform(tfidf.transform(m));

        verbose("Generating the reference data set");
        // Generate the reference data sets.
        ReferenceDataGenerator generator = new ReferenceDataGenerator(m);
        Matrix[] gapMatrices = new Matrix[numGaps];
        for (int i = 0; i < numGaps; ++i)
            gapMatrices[i] = rowMag.transform(tfidf.transform(
                    generator.generateTestData()));

        double[] gapResults = new double[numIterations];
        double[] gapStds = new double[numIterations];
        Assignments[] gapAssignments = new Assignments[numIterations];

        Assignments bestAssignments = null;
        double bestGap = Double.NEGATIVE_INFINITY;
        int bestK = 0;
        // Compute the gap statistic for each iteration.
        for (int i = 0; i < numIterations; ++i) {
            clusterIteration(i, startSize, criterion, m, gapMatrices,
                             gapResults, gapStds, gapAssignments);
            if (bestGap >= (gapResults[i] - gapStds[i])) {
                break;
            }

            // Otherwise, continue clustering with higher values of k.
            bestGap = gapResults[i];
            bestAssignments = gapAssignments[i];
            bestK = i + startSize;
        }

        return bestAssignments;
    }