Clone() public method

Creates a new object that is a copy of the current instance.
public Clone ( ) : object
return object
Exemplo n.º 1
0
        /// <summary>
        ///   Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        ///   A new object that is a copy of this instance.
        /// </returns>
        ///
        public override object Clone()
        {
            var clone = new WilcoxonDistribution(n);

            clone.exact         = exact;
            clone.table         = table;
            clone.n             = n;
            clone.approximation = (NormalDistribution)approximation.Clone();
            return(clone);
        }
Exemplo n.º 2
0
        /// <summary>
        ///   Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>
        ///   A new object that is a copy of this instance.
        /// </returns>
        ///
        public override object Clone()
        {
            var clone = new MannWhitneyDistribution(NumberOfSamples1, NumberOfSamples2);

            clone.exact         = exact;
            clone.table         = table;
            clone.n1            = n1;
            clone.n2            = n2;
            clone.Correction    = Correction;
            clone.approximation = (NormalDistribution)approximation.Clone();
            return(clone);
        }
Exemplo n.º 3
0
        public void CloneTest()
        {
            NormalDistribution target = new NormalDistribution(0.5, 4.2);

            NormalDistribution clone = (NormalDistribution)target.Clone();

            Assert.AreNotSame(target, clone);
            Assert.AreEqual(target.Entropy, clone.Entropy);
            Assert.AreEqual(target.Mean, clone.Mean);
            Assert.AreEqual(target.StandardDeviation, clone.StandardDeviation);
            Assert.AreEqual(target.Variance, clone.Variance);
        }