Skip to content

boxer41a/jj_randoms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jj_randoms

Eiffel implementation of the Merseene Twister and MELG Random Number Generators

This code is based on C-code described in Matsumoto and Nishimura's Mersenne Twister and the Harase and Kimoto MELG repository. The MELG-based classes, like the original C-code versions, provide various period lengths from 2607-1 to 244497-1.

This repository includes Eiffel classes for:

The MELG-type classes as well as the 64-bit Twister are based on MELG which contains all the functionality for the generators of various period lengths:

To conform to Eiffel's command-query separation principle, these classes depart from the paradigm used in the C versions.

  1. Getting a random number does not advance the state (i.e. calling item multiple times returns the same random number).
  2. State advancement (i.e. moving to the next random number) is in feature forth which calls the non-exported feature twist.
  3. "Tempering" is handled in feature forth.

The demo program RANDOMS_DEMO uses TWISTER_32_TESTS, TWISTER_64_TESTS, and MELG_TESTS to display feature calls and the results of the calls. It also verifies the output against files produced by the original C files. When the demo system is open in EiffelStudio, you can also execute some features in AutoTest.

About

Eiffel implementation of the Merseene Twister and MELG Random Number Generators

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages