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

RNG: New API to old API adaptor

    XMLWordPrintableJSON

Details

    Description

      An "adaptor" class will be provided for users who'd like to test the new RNG implementations (MATH-1335) before upgrading their codes to the new API.

      This class will implement the old RandomGenerator interface (but will delegate all the calls to the new classes); hence the only step required in order to use the new RNGs in existing code will be the replacement of the instantiations of the old RNG classes with instantiations of the adaptor.
      For example,

      RandomGenerator rng = new Well19937c(9876);
      

      could be replaced with

      RandomGenerator rng = new RngAdaptor(RandomSource.WELL_19937_C, 9876);
      

      and subsequent usage of rng would be functionally identical.

      Attachments

        Activity

          People

            erans Gilles Sadowski
            erans Gilles Sadowski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: