/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source SecondMoment to copy * @param dest SecondMoment to copy to * @throws NullArgumentException if either source or dest is null */ public static void copy(SecondMoment source, SecondMoment dest) { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); FirstMoment.copy(source, dest); dest.m2 = source.m2; }
public override UnivariateStatistic copy()//TODO: Supposed to be public override FirstMoment copy() { FirstMoment result = new FirstMoment(); // No try-catch or advertised exception because args are guaranteed non-null copy(this, result); return(result); }
/** * Copies source to dest. * <p>Neither source nor dest can be null.</p> * * @param source FirstMoment to copy * @param dest FirstMoment to copy to * @throws NullArgumentException if either source or dest is null */ public static void copy(FirstMoment source, FirstMoment dest) { MathUtils.checkNotNull(source); MathUtils.checkNotNull(dest); dest.setData(source.getDataRef()); dest.n = source.n; dest.m1 = source.m1; dest.dev = source.dev; dest.nDev = source.nDev; }
/** * Copy constructor, creates a new {@code FirstMoment} identical * to the {@code original} * * @param original the {@code FirstMoment} instance to copy * @throws NullArgumentException if original is null */ public FirstMoment(FirstMoment original) { copy(original, this); }
/** * Constructs a Mean with an External Moment. * * @param m1 the moment */ public Mean(FirstMoment m1) { moment = m1; incMoment = false; }
/** Constructs a Mean. */ public Mean() { incMoment = true; moment = new FirstMoment(); }