.. index:: fast_random
.. _fast_random/0:

**object**

``fast_random``
===============

Fast portable random number generator predicates. Core predicates originally written by Richard O'Keefe. Based on algorithm AS 183 from Applied Statistics.

| **Author:** Paulo Moura
| **Version:** 2.5
| **Date:** 2018/8/14

| **Compilation flags:**
|    ``static, context_switching_calls``


| **Implements:**
|    ``public`` :ref:`randomp <randomp/0>`

Public interface
----------------

.. raw:: html

   <div id="reset_seed/0"> </div>

.. index:: reset_seed/0
.. _fast_random/0::reset_seed/0:

``reset_seed/0``
^^^^^^^^^^^^^^^^

Resets the random generator seed to its default value. Use get_seed/1 and set_seed/1 instead if you need reproducibility.

| **Compilation flags:**
|    ``static, synchronized``

| **Mode and number of proofs:**
|    ``reset_seed`` - ``one``


.. raw:: html

   <div id="randomize/1"> </div>

.. index:: randomize/1
.. _fast_random/0::randomize/1:

``randomize/1``
^^^^^^^^^^^^^^^

Randomizes the random generator using a positive integer to compute a new seed.

| **Compilation flags:**
|    ``static, synchronized``

| **Template:**
|    ``randomize(Seed)``
| **Mode and number of proofs:**
|    ``randomize(+positive_integer)`` - ``one``


Protected interface
-------------------

(see related entities)

Private predicates
------------------

.. raw:: html

   <div id="seed_/3"> </div>

.. index:: seed_/3
.. _fast_random/0::seed_/3:

``seed_/3``
^^^^^^^^^^^

Stores the current random generator seed values.

| **Compilation flags:**
|    ``dynamic``

| **Template:**
|    ``seed_(S0,S1,S2)``
| **Mode and number of proofs:**
|    ``seed_(-integer,-integer,-integer)`` - ``one``


Operators
---------

(none)

Remarks
-------

* **Single random number generator**: This object provides a faster version of the "random" library object but does not support being extended to define multiple random number generators.

.. seealso::

   :ref:`random <random/0>`, :ref:`backend_random <backend_random/0>`

