This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 746 - Built-in random number generator for unit tests
Summary: Built-in random number generator for unit tests
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Tests (show other bugs)
Version: unspecified
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-19 11:48 UTC by Gael Guennebaud
Modified: 2019-12-04 13:01 UTC (History)
3 users (show)



Attachments

Description Gael Guennebaud 2014-02-19 11:48:15 UTC
In order to ease the reproduction of unit test failures across different systems, we could have a built-in random number generator for the unit tests only. For instance, this implementation seems rather lightweight:

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/CODES/mt19937ar.c
Comment 1 Christoph Hertzberg 2014-02-19 12:46:19 UTC
That's a good idea. I guess for our purposes even a simple LCG would be sufficient
https://en.wikipedia.org/wiki/Linear_congruential_generator

That is what glibc uses at the moment for rand(), so on many systems nothing will change (if we use the same coefficients). But MT19937 is also simple enough and I don't think the initialization cost really matters, either.
Comment 2 Gael Guennebaud 2014-02-19 14:18:44 UTC
Much simpler indeed: http://www.mscs.dal.ca/~selinger/random/
Comment 3 Nobody 2019-12-04 13:01:15 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/746.

Note You need to log in before you can comment on or make changes to this bug.