Skip to content

Math-Random package is messy #105

Closed
Closed

Description

@SergeStinckwich

The Math-Random is really messy and need to be cleaned :

  • Some classes are subclasses of Random class
  • some other classes are PMNumberGenerator, some other from PMRandomGenerator.
  • What is the difference between PMNumberGenerator and PMRandomGenerator ?
  • why some classes end with Generator other with RandomGenerator, others by Kernel ?
  • PMMarsagliaKissRandomKernelis a subclass of Object and there is another class with almost the same name: PMMarsagliaKissRandom. Maybe is their relationship ?

PMLaplaceGenerator subclasses Object instead of PMRandomGenerator ...

Activity

  1. added a commit that references this issue on May 1, 2019
  2. hemalvarambhia commented on May 31, 2019

    @hemalvarambhia
    Contributor

    @SergeStinckwich With reference to point 3 (What is the difference between PMNumberGenerator and PMRandomGenerator ?) The PMNumberGenerator is dependent upon PMRandomGenerator. Every subclass has a defaultGeneratorClass class method who default is a subclass of PMRandomGenerator (Parker-Miller's algorithm). I think the class PMRandomGenerator should be called PMPseudoRandomNumberGenerators, maybe. I will try and read up a little on the subject before renaming, though.

  3. hemalvarambhia commented on May 31, 2019

    @hemalvarambhia
    Contributor

    On point 5, the class comment and Wikipedia say that PMMarsagliaKissRandom is a PRNG. On the relationship question, PMMarsagliaKissRandom depends on/uses the kernel.

  4. hemalvarambhia commented on Jun 19, 2019

    @hemalvarambhia
    Contributor

    So far, having reviewed the production code in Math-Random, the Mersenne Twister class's nextInteger message is quite long, a little difficult to understand. As a start we could try to extract some of the blocks to intention-revealing methods. I've found the original paper on the Mersenne Twister algorithm so this could be used for inspiration.

  5. hemalvarambhia commented on Jun 24, 2019

    @hemalvarambhia
    Contributor

    The scope of the issue is potentially very large. I propose we break this up into smaller ones. I'll review the code again and create issues accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions