class CovarianceMatricesAggregator implements Serializable {

    static List<CovarianceMatricesAggregator> map(GmmPartitionData data, Vector[] means) {
        int countOfComponents = means.length;

        List<CovarianceMatricesAggregator> aggregators = new ArrayList<>();
        for (int i = 0; i < countOfComponents; i++)
            aggregators.add(new CovarianceMatricesAggregator(means[i]));

        for (int i = 0; i < data.size(); i++) {
            for (int c = 0; c < countOfComponents; c++)
                aggregators.get(c).add(data.getX(i), data.pcxi(c, i));
        }

        return aggregators;
    }

      CovarianceMatricesAggregator(Vector mean);
      CovarianceMatricesAggregator(Vector mean, Matrix weightedSum, int rowCount);

}