Skip to content

Commit f4dea13

Browse files
Merging changes.
2 parents a17b797 + 8311b55 commit f4dea13

149 files changed

Lines changed: 347 additions & 265 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4.8.1/Numerics/Data/Interpolation/Bilinear.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ namespace Numerics.Data
5656
/// <see href="https://en.wikipedia.org/wiki/Bilinear_interpolation"/>
5757
/// </para>
5858
/// </remarks>
59+
[Serializable]
5960
public class Bilinear
6061
{
6162

4.8.1/Numerics/Data/Interpolation/CubicSpline.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
using System;
3132
using System.Collections.Generic;
3233

3334
namespace Numerics.Data
@@ -59,6 +60,7 @@ namespace Numerics.Data
5960
/// </description></item>
6061
/// </list>
6162
/// </remarks>
63+
[Serializable]
6264
public class CubicSpline : Interpolater
6365
{
6466

4.8.1/Numerics/Data/Interpolation/Linear.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ namespace Numerics.Data
5353
/// <b> References: </b>
5454
/// <see href="https://en.wikipedia.org/wiki/Linear_interpolation"/>
5555
/// </remarks>
56+
[Serializable]
5657
public class Linear : Interpolater
5758
{
5859
/// <summary>

4.8.1/Numerics/Data/Interpolation/Polynomial.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ namespace Numerics.Data
6060
/// </description></item>
6161
/// </list>
6262
/// </remarks>
63+
[Serializable]
6364
public class Polynomial : Interpolater
6465
{
6566
/// <summary>

4.8.1/Numerics/Data/Interpolation/Support/Interpolater.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ namespace Numerics.Data
4848
/// <b> References: </b>
4949
/// <see href="https://en.wikipedia.org/wiki/Interpolation"/>
5050
/// </remarks>
51+
[Serializable]
5152
public abstract class Interpolater
5253
{
5354

4.8.1/Numerics/Data/Interpolation/Support/Search.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ namespace Numerics.Data
7373
/// </description></item>
7474
/// </list>
7575
/// </remarks>
76+
[Serializable]
7677
public class Search
7778
{
7879
/// <summary>

4.8.1/Numerics/Data/Interpolation/Support/SortOrder.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
using System;
32+
3133
namespace Numerics.Data
3234
{
3335
/// <summary>
@@ -39,6 +41,7 @@ namespace Numerics.Data
3941
/// Haden Smith, USACE Risk Management Center, cole.h.smith@usace.army.mil
4042
/// </para>
4143
/// </remarks>
44+
[Serializable]
4245
public enum SortOrder
4346
{
4447
/// <summary>

4.8.1/Numerics/Data/Interpolation/Support/Transform.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
using System;
3132
using System.ComponentModel.DataAnnotations;
3233

3334
namespace Numerics.Data
@@ -41,6 +42,7 @@ namespace Numerics.Data
4142
/// Haden Smith, USACE Risk Management Center, cole.h.smith@usace.army.mil
4243
/// </para>
4344
/// </remarks>
45+
[Serializable]
4446
public enum Transform
4547
{
4648
/// <summary>

4.8.1/Numerics/Data/Paired Data/UncertainOrderedPairedData.cs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
using System.Collections;
3333
using System.Collections.Generic;
3434
using System.Collections.Specialized;
35+
using System.Globalization;
3536
using System.Linq;
3637
using System.Xml.Linq;
3738
using Numerics.Distributions;
@@ -46,6 +47,7 @@ namespace Numerics.Data
4647
/// <b> Authors:</b>
4748
/// Woodrow Fields, USACE Risk Management Center, woodrow.l.fields@usace.army.mil
4849
/// </remarks>
50+
[Serializable]
4951
public class UncertainOrderedPairedData : IList<UncertainOrdinate>, INotifyCollectionChanged
5052
{
5153
#region Members
@@ -175,26 +177,6 @@ public SortOrder OrderY
175177

176178
#region Construction
177179

178-
/*public UncertainOrderedPairedData(bool strictOnX, SortOrder xOrder, bool strictOnY, SortOrder yOrder, UnivariateDistributionType distributionType)
179-
{
180-
Distribution = distributionType;
181-
_uncertainOrdinates = new List<UncertainOrdinate>();
182-
_strictX = strictOnX;
183-
_strictY = strictOnY;
184-
_orderX = xOrder;
185-
_orderY = yOrder;
186-
}
187-
188-
public UncertainOrderedPairedData(int capacity, bool strictOnX, SortOrder xOrder, bool strictOnY, SortOrder yOrder, UnivariateDistributionType distributionType)
189-
{
190-
Distribution = distributionType;
191-
_uncertainOrdinates = new List<UncertainOrdinate>(capacity);
192-
_strictX = strictOnX;
193-
_strictY = strictOnY;
194-
_orderX = xOrder;
195-
_orderY = yOrder;
196-
}*/
197-
198180
/// <summary>
199181
/// Create empty instance of the uncertain ordered paired data class.
200182
/// </summary>
@@ -333,14 +315,14 @@ public UncertainOrderedPairedData(XElement el)
333315
{
334316
foreach (XElement o in curveEl.Elements("Ordinate"))
335317
{
336-
double.TryParse(o.Attribute("X").Value, out var xout);
318+
double.TryParse(o.Attribute("X").Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var xout);
337319
xData.Add(xout);
338320
var dist = UnivariateDistributionFactory.CreateDistribution(Distribution);
339321
var props = dist.GetParameterPropertyNames;
340322
var paramVals = new double[(props.Count())];
341323
for (int i = 0; i < props.Count(); i++)
342324
{
343-
double.TryParse(o.Attribute(props[i]).Value, out var result);
325+
double.TryParse(o.Attribute(props[i]).Value, NumberStyles.Any, CultureInfo.InvariantCulture, out var result);
344326
paramVals[i] = result;
345327
}
346328

4.8.1/Numerics/Data/Paired Data/UncertainOrdinate.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31+
using System;
3132
using System.Collections.Generic;
3233
using System.Globalization;
3334
using System.Linq;
@@ -52,6 +53,7 @@ namespace Numerics.Data
5253
/// </list>
5354
/// </para>
5455
/// </remarks>
56+
[Serializable]
5557
public struct UncertainOrdinate
5658
{
5759

@@ -97,15 +99,15 @@ public UncertainOrdinate(XElement xElement)
9799
public UncertainOrdinate(XElement xElement, UnivariateDistributionType distributionType)
98100
{
99101
double x = 0;
100-
if (xElement.Attribute(nameof(X)) != null) double.TryParse(xElement.Attribute(nameof(X)).Value, out x);
102+
if (xElement.Attribute(nameof(X)) != null) double.TryParse(xElement.Attribute(nameof(X)).Value, NumberStyles.Any, CultureInfo.InvariantCulture, out x);
101103
// backwards compatibility
102104
var dist = UnivariateDistributionFactory.CreateDistribution(distributionType);
103105
var props = dist.GetParameterPropertyNames;
104106
var paramVals = new double[(props.Count())];
105107
for (int i = 0; i < props.Count(); i++)
106108
{
107109
double p = 0;
108-
if (xElement.Attribute(props[i]) != null) double.TryParse(xElement.Attribute(props[i]).Value, out p);
110+
if (xElement.Attribute(props[i]) != null) double.TryParse(xElement.Attribute(props[i]).Value, NumberStyles.Any, CultureInfo.InvariantCulture, out p);
109111
paramVals[i] = p;
110112
}
111113
dist.SetParameters(paramVals);

0 commit comments

Comments
 (0)