diff --git a/src/Numerics/Complex32.cs b/src/Numerics/Complex32.cs index 2d08b7c6..a134cc38 100644 --- a/src/Numerics/Complex32.cs +++ b/src/Numerics/Complex32.cs @@ -28,17 +28,17 @@ // OTHER DEALINGS IN THE SOFTWARE. // +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Runtime.InteropServices; +using System.Runtime.Serialization; + namespace MathNet.Numerics { - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Runtime.InteropServices; - #if !PORTABLE using System.Runtime; #endif - #if !NOSYSNUMERICS using Complex = System.Numerics.Complex; using BigInteger = System.Numerics.BigInteger; @@ -72,16 +72,19 @@ namespace MathNet.Numerics /// [Serializable] [StructLayout(LayoutKind.Sequential)] + [DataContract(Namespace = "urn:MathNet/Numerics")] public struct Complex32 : IFormattable, IEquatable { /// /// The real component of the complex number. /// + [DataMember(Order = 1)] private readonly float _real; /// /// The imaginary component of the complex number. /// + [DataMember(Order = 2)] private readonly float _imag; /// diff --git a/src/Numerics/Complex64.cs b/src/Numerics/Complex64.cs index d6ac877c..a29107cb 100644 --- a/src/Numerics/Complex64.cs +++ b/src/Numerics/Complex64.cs @@ -29,14 +29,15 @@ // #if NOSYSNUMERICS + +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Runtime.Serialization; +using System.Text; + namespace MathNet.Numerics { - using System; - using System.Collections.Generic; - using System.Runtime.InteropServices; - using System.Text; - using Properties; - /// /// 64-bit double precision complex numbers class. /// @@ -64,17 +65,20 @@ namespace MathNet.Numerics /// /// [Serializable] + [DataContract(Namespace = "urn:MathNet/Numerics")] [StructLayout(LayoutKind.Sequential)] public struct Complex : IFormattable, IEquatable, IPrecisionSupport { /// /// The real component of the complex number. /// + [DataMember(Order = 1)] private readonly double _real; /// /// The imaginary component of the complex number. /// + [DataMember(Order = 2)] private readonly double _imag; ///