/** * * @param c the underlying {@link IndexClusters} * @param valvects the eigen values and vectors */ public SpectralIndexedClusters(IndexClusters c, IndependentPair<double[], double[][]>valvects) { this.clusters = c.clusters(); this.nEntries = c.numEntries(); this.valvects = valvects; }
@Override public String toString() { final int[][] clusters = this.clusters(); int i = 0; final StringWriter sw = new StringWriter(); final PrintWriter out = new PrintWriter(sw); out.println("N-Clusters: " + this.numClusters()); out.println("Entities: " + this.numEntries()); String str = sw.toString(); for (final int[] member : clusters) { str += String.format("%d %s\n", i++, Arrays.toString(member)); } return str; } }