class GmmPartitionData implements AutoCloseable {

    static double updatePcxi(GmmPartitionData data, Vector clusterProbs,
        List<MultivariateGaussianDistribution> components) {

        GmmModel model = new GmmModel(clusterProbs, components);
        double maxProb = Double.NEGATIVE_INFINITY;

        for (int i = 0; i < data.size(); i++) {
            Vector x = data.getX(i);
            double xProb = model.prob(x);
            if (xProb > maxProb)
                maxProb = xProb;

            double normalizer = 0.0;
            for (int c = 0; c < clusterProbs.size(); c++)
                normalizer += components.get(c).prob(x) * clusterProbs.get(c);

            for (int c = 0; c < clusterProbs.size(); c++)
                data.pcxi[i][c] = (components.get(c).prob(x) * clusterProbs.get(c)) / normalizer;
        }

        return maxProb;
    }

      GmmPartitionData(List<LabeledVector<Double>> xs, double[][] pcxi);

}