/// <summary> /// Determines whether the specified <see cref="ChannelStatistics"/> is equal to the current <see cref="ChannelStatistics"/>. /// </summary> /// <param name="other">The channel statistics to compare this <see cref="ChannelStatistics"/> with.</param> /// <returns>True when the specified <see cref="ChannelStatistics"/> is equal to the current <see cref="ChannelStatistics"/>.</returns> public bool Equals(ChannelStatistics other) { if (ReferenceEquals(other, null)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (Depth.Equals(other.Depth) && Entropy.Equals(other.Entropy) && Kurtosis.Equals(other.Kurtosis) && Maximum.Equals(other.Maximum) && Mean.Equals(other.Mean) && Minimum.Equals(other.Minimum) && Skewness.Equals(other.Skewness) && StandardDeviation.Equals(other.StandardDeviation) && Sum.Equals(other.Sum) && SumCubed.Equals(other.SumCubed) && SumFourthPower.Equals(other.SumFourthPower) && SumSquared.Equals(other.SumSquared) && Variance.Equals(other.Variance)); }
public void Merge(Kurtosis Group) { // Put your code here this.n += Group.N; this.mean += Group.Mean; this.m2 += Group.M2; this.m3 += Group.M3; this.m4 += Group.M4; }
/// <summary> /// Serves as a hash of this type. /// </summary> /// <returns>A hash code for the current instance.</returns> public override int GetHashCode() { return (Depth.GetHashCode() ^ Entropy.GetHashCode() ^ Kurtosis.GetHashCode() ^ Maximum.GetHashCode() ^ Mean.GetHashCode() ^ Minimum.GetHashCode() ^ Skewness.GetHashCode() ^ StandardDeviation.GetHashCode() ^ Sum.GetHashCode() ^ SumCubed.GetHashCode() ^ SumFourthPower.GetHashCode() ^ SumSquared.GetHashCode() ^ Variance.GetHashCode()); }
public void WriteXml(XmlWriter writer) { writer.WriteAttributeString("nominal", Nominal.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("mean", Mean.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("standardDeviation", StandardDeviation.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("lowerSpecLimit", LowerSpecLimit.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("upperSpecLimit", UpperSpecLimit.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("cp", Cp.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("cpk", Cpk.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("distribution", Distribution); writer.WriteAttributeString("skewness", Skewness.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("kurtosis", Kurtosis.ToString(CultureInfo.InvariantCulture)); writer.WriteAttributeString("sampleSize", SampleSize.ToString(CultureInfo.InvariantCulture)); writer.WriteStartElement("Sample"); Sample.WriteXml(writer); writer.WriteEndElement(); writer.WriteStartElement("Estimate"); Estimate.WriteXml(writer); writer.WriteEndElement(); }