Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dev-dependencies for random number generation #51

Closed
vks opened this issue May 5, 2017 · 6 comments
Closed

Use dev-dependencies for random number generation #51

vks opened this issue May 5, 2017 · 6 comments
Assignees
Milestone

Comments

@vks
Copy link
Contributor

vks commented May 5, 2017

I just saw this in the code:

    #[ignore]
    #[test]
    fn test_mean_variance_stability() {
        // TODO: Implement tests. Depends on Mersenne Twister RNG implementation.
        // Currently hesistant to bring extra dependency just for test
    }

You can add dependencies to the Cargo.toml that are only used when running the tests, but not when using the library as a dependency: http://doc.crates.io/specifying-dependencies.html#development-dependencies

@boxtown
Copy link
Collaborator

boxtown commented May 8, 2017

@vks Thanks, I'll look to flesh out the test then in that case, hopefully in 0.7.0

@boxtown boxtown added this to the 0.7.0 milestone May 8, 2017
@boxtown boxtown self-assigned this May 8, 2017
@boxtown
Copy link
Collaborator

boxtown commented May 29, 2017

Punting to 0.8.0

@boxtown boxtown modified the milestones: 0.8.0, 0.7.0 May 29, 2017
@boxtown
Copy link
Collaborator

boxtown commented Jul 25, 2017

Punting to future release. I can't find a well supported stable implementation of the Mersenne Twister algo, it is likely that a home grown implementation will be needed. Reference: https://github.com/mathnet/mathnet-numerics/blob/master/src/Numerics/Random/MersenneTwister.cs

@vks
Copy link
Contributor Author

vks commented Jul 25, 2017

Why do you want to use the Mersenne Twister? It is a bit dated, there are faster algorithms with better statistics (PCG, xoroshiro128+).

@boxtown
Copy link
Collaborator

boxtown commented Jul 25, 2017

It's for a direct port of this test https://github.com/mathnet/mathnet-numerics/blob/master/src/UnitTests/StatisticsTests/StatisticsTests.cs#L817

I'm actually not sure if the Mersenne Twister is 100% necessary but I don't know enough about the stability issues this particular test is testing

@vks
Copy link
Contributor Author

vks commented Jul 26, 2017

I would expect they use the Mersenne Twister because the default .NET random number generator has low quality and/or period? You are probably fine with just using rand.

@boxtown boxtown closed this as completed Aug 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants