Java Code Examples for org.apache.commons.math3.stat.descriptive.moment.Variance#copy()

The following examples show how to use org.apache.commons.math3.stat.descriptive.moment.Variance#copy() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}
 
Example 2
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}
 
Example 3
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}
 
Example 4
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}
 
Example 5
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}
 
Example 6
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}
 
Example 7
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}
 
Example 8
Source File: SummaryStatistics.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Copies source to dest.
 * <p>Neither source nor dest can be null.</p>
 *
 * @param source SummaryStatistics to copy
 * @param dest SummaryStatistics to copy to
 * @throws NullArgumentException if either source or dest is null
 */
public static void copy(SummaryStatistics source, SummaryStatistics dest)
    throws NullArgumentException {
    MathUtils.checkNotNull(source);
    MathUtils.checkNotNull(dest);
    dest.maxImpl = source.maxImpl.copy();
    dest.minImpl = source.minImpl.copy();
    dest.sumImpl = source.sumImpl.copy();
    dest.sumLogImpl = source.sumLogImpl.copy();
    dest.sumsqImpl = source.sumsqImpl.copy();
    dest.secondMoment = source.secondMoment.copy();
    dest.n = source.n;

    // Keep commons-math supplied statistics with embedded moments in synch
    if (source.getVarianceImpl() instanceof Variance) {
        dest.varianceImpl = new Variance(dest.secondMoment);
    } else {
        dest.varianceImpl = source.varianceImpl.copy();
    }
    if (source.meanImpl instanceof Mean) {
        dest.meanImpl = new Mean(dest.secondMoment);
    } else {
        dest.meanImpl = source.meanImpl.copy();
    }
    if (source.getGeoMeanImpl() instanceof GeometricMean) {
        dest.geoMeanImpl = new GeometricMean((SumOfLogs) dest.sumLogImpl);
    } else {
        dest.geoMeanImpl = source.geoMeanImpl.copy();
    }

    // Make sure that if stat == statImpl in source, same
    // holds in dest; otherwise copy stat
    if (source.geoMean == source.geoMeanImpl) {
        dest.geoMean = (GeometricMean) dest.geoMeanImpl;
    } else {
        GeometricMean.copy(source.geoMean, dest.geoMean);
    }
    if (source.max == source.maxImpl) {
        dest.max = (Max) dest.maxImpl;
    } else {
        Max.copy(source.max, dest.max);
    }
    if (source.mean == source.meanImpl) {
        dest.mean = (Mean) dest.meanImpl;
    } else {
        Mean.copy(source.mean, dest.mean);
    }
    if (source.min == source.minImpl) {
        dest.min = (Min) dest.minImpl;
    } else {
        Min.copy(source.min, dest.min);
    }
    if (source.sum == source.sumImpl) {
        dest.sum = (Sum) dest.sumImpl;
    } else {
        Sum.copy(source.sum, dest.sum);
    }
    if (source.variance == source.varianceImpl) {
        dest.variance = (Variance) dest.varianceImpl;
    } else {
        Variance.copy(source.variance, dest.variance);
    }
    if (source.sumLog == source.sumLogImpl) {
        dest.sumLog = (SumOfLogs) dest.sumLogImpl;
    } else {
        SumOfLogs.copy(source.sumLog, dest.sumLog);
    }
    if (source.sumsq == source.sumsqImpl) {
        dest.sumsq = (SumOfSquares) dest.sumsqImpl;
    } else {
        SumOfSquares.copy(source.sumsq, dest.sumsq);
    }
}