PcgRandom | NET port of the PCG Random Number Generator library | Generator Utils library

 by   bgrainger C# Version: 1.1.0 License: Apache-2.0

kandi X-RAY | PcgRandom Summary

kandi X-RAY | PcgRandom Summary

PcgRandom is a C# library typically used in Generator, Generator Utils, Bitcoin applications. PcgRandom has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

PcgRandom is a .NET implementation of the PCG family of random number generators.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              PcgRandom has a low active ecosystem.
              It has 26 star(s) with 6 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              PcgRandom has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of PcgRandom is 1.1.0

            kandi-Quality Quality

              PcgRandom has 0 bugs and 0 code smells.

            kandi-Security Security

              PcgRandom has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              PcgRandom code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              PcgRandom is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              PcgRandom releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of PcgRandom
            Get all kandi verified functions for this library.

            PcgRandom Key Features

            No Key Features are available at this moment for PcgRandom.

            PcgRandom Examples and Code Snippets

            No Code Snippets are available at this moment for PcgRandom.

            Community Discussions

            QUESTION

            Generating random integer and real numbers in a given range
            Asked 2020-Feb-03 at 20:15

            According the man page of getNext in the PCGRandom module, we can generate random numbers in a given range, for example:

            ...

            ANSWER

            Answered 2020-Feb-03 at 20:15

            The notes in the manual page are indicating a difference from the other PCG random number methods that have been studied (by the author of the PCG algorithm at the very least).

            The issue with floating-point numbers is indeed related to floating-point number density. See http://www.pcg-random.org/using-pcg-c-basic.html#generating-doubles from the PCG author. It is a potential problem even when generating random numbers in [0.0, 1.0]. This paragraph from the documentation describes the issue:

            When generating a real, imaginary, or complex number, this implementation uses the strategy of generating a 64-bit unsigned integer and then multiplying it by 2.0**-64 in order to convert it to a floating point number. While this does construct a uniform distribution on rounded floating point values, it leaves out many possible real values (for example, 2**-128). We believe that this strategy has reasonable statistical properties. One side effect of this strategy is that the real number 1.0 can be generated because of rounding. The real number 0.0 can be generated because PCG can produce the value 0 as a random integer.

            Note that a 64-bit real can store numbers as small as 2.0**-1024 but it is quite impossible to get such a number by dividing a positive integer by 2**64. (Here and in the above I am using ** as the exponentiation operator, as that is what it does in Chapel syntax). I recommend reading up on IEEE floating point formats (e.g. https://en.wikipedia.org/wiki/IEEE_754 or https://en.wikipedia.org/wiki/Double-precision_floating-point_format ) for background information in this area. You might care about this if you were using an RNG to generate test inputs to an algorithm operating on real(64) values. In that event you might wish for even the very small values to be generated. Note though that constructing an RNG that can generate all real(64) values in a non-uniform manner is not so hard (e.g. just by copying the bits from a uint into a real).

            Regarding the other part of your question:

            I did some basic statistical testing with the generation of random integers in a particular range with TestU01 and I'd be confident in its use with Monte Carlo calculations. However I am not an expert in this area and as a result I put that warning in the documentation. The below information from the documentation describes the testing that I did:

            We have tested this implementation with TestU01 (available at http://simul.iro.umontreal.ca/testu01/tu01.html ). We measured our implementation with TestU01 1.2.3 and the Crush suite, which consists of 144 statistical tests. The results were:

            • no failures for generating uniform reals
            • 1 failure for generating 32-bit values (which is also true for the reference version of PCG with the same configuration)
            • 0 failures for generating 64-bit values (which we provided to TestU01 as 2 different 32-bit values since it only accepts 32 bits at a time)
            • 0 failures for generating bounded integers (which we provided to TestU01 by requesting values in [0..,2**31+2**30+1) until we had two values < 2**31, removing the top 0 bit, and then combining the top 16 bits into the value provided to TestU01).

            Source https://stackoverflow.com/questions/60045891

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install PcgRandom

            Ubuntu 16.04, macOS 10.13, Windows 2016.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/bgrainger/PcgRandom.git

          • CLI

            gh repo clone bgrainger/PcgRandom

          • sshUrl

            git@github.com:bgrainger/PcgRandom.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link