Saturday, August 3, 2013

Object Initialization problem / issue in Visual Studio 2012?

Thanks guys... I figured this out after some further testing... I actually found a few things that would save some code as well...


new Random(Guid.NewGuid().GetHashCode());


In addition to your input, initializing the random in this way will prevent the default time collision if less than 16ms between the call to NextDouble();


Secondly, I decided to use Enumerable.Range() instead of a for loop for initialization of the double array...


ws =


Enumerable .Range(0, size).Select(x => NextRandom()).ToArray();


Thanks for all your help and quick responses...


No comments:

Post a Comment