COIN-OR::LEMON - Graph Library

Opened 2 years ago

Last modified 15 months ago

#602 new enhancement

Platform independent pseudo random sequences

Reported by: alpar Owned by: alpar
Priority: major Milestone: LEMON 1.4 release
Component: core Version: hg main
Keywords: Cc:
Revision id:

Description

LEMON's random generator is based on the Mersenne Twister algoritm and it is optimized to 32 and 64 bit architecture. This is fine, except when someone want to obtain reproducible results (for a given initial seed) on each platform. The attached patch provides the following solution to this.

The original Random class becomes a template and goes to the _random_bits namespace, then three typedefs are defined:

  • Random is exactly the same as the class Random was before,
  • Random32 is the 32 bit version (on all platform) and
  • Random64 is the 64 bit version (on all platform).

This solution is fully backward compatible and the only drawback I can see is the documentation - one has to visit the template version to see the detailed API.

What do you think, is the documentation is acceptable in this form? If not, what would be a better solution?

Attachments (1)

602-db1d342a1087.patch (39.1 KB) - added by alpar 2 years ago.

Download all attachments as: .zip

Change History (2)

Changed 2 years ago by alpar

comment:1 Changed 15 months ago by alpar

  • Type changed from defect to enhancement
Note: See TracTickets for help on using tickets.