Browse Source
Update SystemRandomSource.cs
Fixed a seed value issue in the .NET Framework.
pull/886/head
hikari
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
8 additions and
0 deletions
-
src/Numerics/Random/SystemRandomSource.cs
|
|
|
@ -51,7 +51,11 @@ namespace MathNet.Numerics.Random |
|
|
|
/// </summary>
|
|
|
|
public SystemRandomSource() |
|
|
|
{ |
|
|
|
#if NETCOREAPP
|
|
|
|
_random = new System.Random(); |
|
|
|
#else
|
|
|
|
_random = new System.Random(RandomSeed.Robust()); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -60,7 +64,11 @@ namespace MathNet.Numerics.Random |
|
|
|
/// <param name="threadSafe">if set to <c>true</c> , the class is thread safe.</param>
|
|
|
|
public SystemRandomSource(bool threadSafe) : base(threadSafe) |
|
|
|
{ |
|
|
|
#if NETCOREAPP
|
|
|
|
_random = new System.Random(); |
|
|
|
#else
|
|
|
|
_random = new System.Random(RandomSeed.Robust()); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|