Collection<Point> locations = doLayout ? runLayout(lsi, x, y) : loadCached(lsi, x, y);
return new Configuration(locations).normalize();
}
private Collection<Point> runLayout(LatentSemanticIndex lsi, double[] x, double[] y) {
LayoutAlgorithm mds = LayoutAlgorithm.fromCorrelationMatrix(lsi, x, y);
mds.normalize();
Collection<Point> locations = new ArrayList<Point>();
int index = 0;
for (String each: lsi.documents()) {
locations.add(new Point(mds.x[index], mds.y[index], each));
index++;