class MeanWithClusterProbAggregator implements Serializable {

    void add(Vector x, double pcxi) {
        A.ensure(pcxi >= 0 && pcxi <= 1., "pcxi >= 0 && pcxi <= 1.");

        Vector weightedVector = x.times(pcxi);
        if (weightedXsSum == null)
            weightedXsSum = weightedVector;
        else
            weightedXsSum = weightedXsSum.plus(weightedVector);

        pcxiSum += pcxi;
        rowCount += 1;
    }

      MeanWithClusterProbAggregator();
      MeanWithClusterProbAggregator(Vector weightedXsSum, double pcxiSum, int rowCount);

}