3232using System . Collections ;
3333using System . Collections . Generic ;
3434using System . Collections . Specialized ;
35+ using System . Globalization ;
3536using System . Linq ;
3637using System . Xml . Linq ;
3738using 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
0 commit comments