List of usage examples for org.apache.commons.math3.stat.clustering Cluster getPoints
public List<T> getPoints()
From source file:org.moeaframework.core.operator.real.AdaptiveMetropolisTest.java
/** * Returns the covariance matrix for the specified cluster. * /*from w w w.ja va2 s. co m*/ * @param cluster the cluster * @return the covariance matrix for the specified cluster */ private RealMatrix getCovariance(Cluster<ClusterablePoint> cluster) { List<ClusterablePoint> points = cluster.getPoints(); RealMatrix rm = MatrixUtils.createRealMatrix(points.size(), 2); for (int i = 0; i < points.size(); i++) { rm.setRow(i, points.get(i).getPoint()); } return new Covariance(rm).getCovarianceMatrix(); }