예제 #1
0
 /**
  * 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;
 }
예제 #2
0
        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);
        }
예제 #3
0
 /**
  * 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;
 }
예제 #4
0
 /**
  * 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);
 }
예제 #5
0
 /**
  * Constructs a Mean with an External Moment.
  *
  * @param m1 the moment
  */
 public Mean(FirstMoment m1)
 {
     moment    = m1;
     incMoment = false;
 }
예제 #6
0
 /** Constructs a Mean. */
 public Mean()
 {
     incMoment = true;
     moment    = new FirstMoment();
 }