Uploaded image for project: 'Commons Math'
  1. Commons Math
  2. MATH-927

GammaDistribution cloning broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.1.1
    • None
    • None

    Description

      Serializing a GammaDistribution and deserializing it, does not result in a cloned distribution that produces the same samples.

      Cause: GammaDistribution inherits from AbstractRealDistribution, which implements Serializable. AbstractRealDistribution has random, in which we have a Well19937c instance, which inherits from AbstractWell. AbstractWell implements Serializable. AbstractWell inherits from BitsStreamGenerator, which is not Serializable, but does have a private field 'nextGaussian'.

      Solution: Make BitStreamGenerator implement Serializable as well.

      This probably affects other distributions as well.

      Attachments

        1. bits-stream-generator-serializable.patch
          0.9 kB
          Dennis Hendriks
        2. DistributionCloneTests.java
          2 kB
          Dennis Hendriks

        Activity

          People

            Unassigned Unassigned
            dhendriks Dennis Hendriks
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: