From 9a8f73170867749cef1b6fd22e348ea0a058d54e Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sat, 21 Nov 2015 17:46:57 +0100 Subject: [PATCH] Statistics: DescriptiveStatistics DataContract for ephemeral serialization #350 --- src/Numerics/Statistics/DescriptiveStatistics.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Numerics/Statistics/DescriptiveStatistics.cs b/src/Numerics/Statistics/DescriptiveStatistics.cs index cf098eb8..3c0d7029 100644 --- a/src/Numerics/Statistics/DescriptiveStatistics.cs +++ b/src/Numerics/Statistics/DescriptiveStatistics.cs @@ -4,7 +4,7 @@ // http://github.com/mathnet/mathnet-numerics // http://mathnetnumerics.codeplex.com // -// Copyright (c) 2009-2013 Math.NET +// Copyright (c) 2009-2015 Math.NET // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation @@ -30,6 +30,7 @@ using System; using System.Collections.Generic; +using System.Runtime.Serialization; namespace MathNet.Numerics.Statistics { @@ -40,6 +41,7 @@ namespace MathNet.Numerics.Statistics /// in increased accuracy mode. /// /// Consider to use RunningStatistics instead. + [DataContract(Namespace = "urn:MathNet/Numerics")] public class DescriptiveStatistics { /// @@ -104,24 +106,28 @@ namespace MathNet.Numerics.Statistics /// Gets the size of the sample. /// /// The size of the sample. + [DataMember(Order = 1)] public long Count { get; private set; } /// /// Gets the sample mean. /// /// The sample mean. + [DataMember(Order = 2)] public double Mean { get; private set; } /// /// Gets the unbiased population variance estimator (on a dataset of size N will use an N-1 normalizer). /// /// The sample variance. + [DataMember(Order = 3)] public double Variance { get; private set; } /// /// Gets the unbiased population standard deviation (on a dataset of size N will use an N-1 normalizer). /// /// The sample standard deviation. + [DataMember(Order = 4)] public double StandardDeviation { get; private set; } /// @@ -129,6 +135,7 @@ namespace MathNet.Numerics.Statistics /// /// The sample skewness. /// Returns zero if is less than three. + [DataMember(Order = 5)] public double Skewness { get; private set; } /// @@ -136,18 +143,21 @@ namespace MathNet.Numerics.Statistics /// /// The sample kurtosis. /// Returns zero if is less than four. + [DataMember(Order = 6)] public double Kurtosis { get; private set; } /// /// Gets the maximum sample value. /// /// The maximum sample value. + [DataMember(Order = 7)] public double Maximum { get; private set; } /// /// Gets the minimum sample value. /// /// The minimum sample value. + [DataMember(Order = 8)] public double Minimum { get; private set; } ///