Skip to content

Commit

Permalink
Improvements to the random library
Browse files Browse the repository at this point in the history
* Add predicate `randomize/1` to the `random` library.
* Add faster version of the `random` library object, `frandom`.
  • Loading branch information
pmoura committed Feb 25, 2017
1 parent a408308 commit 480ff8f
Show file tree
Hide file tree
Showing 16 changed files with 2,369 additions and 2,006 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Expand Up @@ -65,6 +65,10 @@ and integration scripts to allow running the current Logtalk version.
Library
-------

* ADDED: Predicate `randomize/1` to the `random` library.

* ADDED: Faster version of the `random` library object, `frandom`.

* ADDED: Implementation of the `os::time_stamp/1` predicate for CxProlog.

* FIXED: Declaration of the return type for the `os::time_stamp/1` predicate.
Expand Down
4 changes: 2 additions & 2 deletions docs/core_inheritance_diagram.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions docs/directory_index.html
Expand Up @@ -169,6 +169,11 @@ <h1 class="code">
<a href="float_0.html">float</a>
</code>
</dd>
<dd class="code">
<code>
<a href="frandom_0.html">frandom</a>
</code>
</dd>
<dd class="code">
<code>
<a href="gensym_0.html">gensym</a>
Expand Down
5 changes: 5 additions & 0 deletions docs/entity_index.html
Expand Up @@ -273,6 +273,11 @@ <h1 class="code">
<a href="float_0.html">float</a>
</code>
</dd>
<dd class="code">
<code>
<a href="frandom_0.html">frandom</a>
</code>
</dd>
<dd class="code">
<code>
<a href="gensym_0.html">gensym</a>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Expand Up @@ -16,6 +16,6 @@ <h1>Documentation index</h1>
<li><a href="entity_index.html">Entity index</a></li>
<li><a href="predicate_index.html">Predicate index</a></li>
</ul>
<p>Generated on Tue Feb 21 00:30:48 GMT 2017</p>
<p>Generated on Sat Feb 25 11:46:28 GMT 2017</p>
</body>
</html>
5 changes: 5 additions & 0 deletions docs/library_index.html
Expand Up @@ -449,6 +449,11 @@ <h1 class="code">
<a href="float_0.html">float</a>
</code>
</dd>
<dd class="code">
<code>
<a href="frandom_0.html">frandom</a>
</code>
</dd>
<dd class="code">
<code>
<a href="gensym_0.html">gensym</a>
Expand Down
3,947 changes: 1,991 additions & 1,956 deletions docs/library_inheritance_diagram.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/predicate_index.html
Expand Up @@ -3975,6 +3975,16 @@ <h1 class="code">
</code>
</dd>
</dl>
<dl>
<dt id="randomize/1">
<code>randomize/1</code>
</dt>
<dd class="code">
<code>
<a href="randomp_0.html#randomize/1">randomp</a>
</code>
</dd>
</dl>
<dl>
<dt id="randseq/4">
<code>randseq/4</code>
Expand Down
11 changes: 7 additions & 4 deletions docs/random_0.html
Expand Up @@ -11,7 +11,7 @@
<p class="type">object</p>
<h1 class="code">random</h1>
<blockquote>
<p class="comment">Portable random number generator predicates.</p>
<p class="comment">Portable random number generator predicates. Core predicates originally written by Richard O'Keefe.</p>
</blockquote>
</div>
<div class="entity">
Expand All @@ -23,11 +23,11 @@ <h1 class="code">random</h1>
</dd>
<dt class="key">version:</dt>
<dd class="value">
<code>2.0</code>
<code>2.1</code>
</dd>
<dt class="key">date:</dt>
<dd class="value">
<code>2016/8/23</code>
<code>2017/2/25</code>
</dd>
</dl>
<dl class="properties">
Expand Down Expand Up @@ -90,7 +90,10 @@ <h3 class="comment">(none)</h3>
<div class="remarks">
<h2>Remarks</h2>
<div class="section">
<h3 class="comment">(none)</h3>
<dl class="remarks">
<dt class="comment">Multiple random number generators</dt>
<dd class="text">To define multiple random number generators, simply extend this object. The derived objects must send to self the reset_seed/0 message.</dd>
</dl>
</div>
</div>
<div class="see_also">
Expand Down
28 changes: 24 additions & 4 deletions docs/randomp_0.html
Expand Up @@ -23,11 +23,11 @@ <h1 class="code">randomp</h1>
</dd>
<dt class="key">version:</dt>
<dd class="value">
<code>2.0</code>
<code>2.1</code>
</dd>
<dt class="key">date:</dt>
<dd class="value">
<code>2016/8/19</code>
<code>2017/2/25</code>
</dd>
</dl>
<dl class="properties">
Expand Down Expand Up @@ -254,7 +254,7 @@ <h3 id="randset/4" class="code">randset/4</h3>
<div class="section">
<h3 id="reset_seed/0" class="code">reset_seed/0</h3>
<blockquote>
<p class="comment">Resets the random generator seed to its default value. Deprecated. Use get_seed/1 and set_seed/1 instead if you need reproducibility.</p>
<p class="comment">Resets the random generator seed to its default value. Use get_seed/1 and set_seed/1 instead if you need reproducibility.</p>
</blockquote>
<dl class="properties">
<dt class="key">compilation flags:</dt>
Expand All @@ -270,7 +270,7 @@ <h3 id="reset_seed/0" class="code">reset_seed/0</h3>
<div class="section">
<h3 id="get_seed/1" class="code">get_seed/1</h3>
<blockquote>
<p class="comment">Gets the current random generator seed. Seed should be regarded as an opaque ground term</p>
<p class="comment">Gets the current random generator seed. Seed should be regarded as an opaque ground term.</p>
</blockquote>
<dl class="properties">
<dt class="key">compilation flags:</dt>
Expand Down Expand Up @@ -307,6 +307,26 @@ <h3 id="set_seed/1" class="code">set_seed/1</h3>
</dd>
</dl>
</div>
<div class="section">
<h3 id="randomize/1" class="code">randomize/1</h3>
<blockquote>
<p class="comment">Randomizes the random generator using a positive integer to compute a new seed.</p>
</blockquote>
<dl class="properties">
<dt class="key">compilation flags:</dt>
<dd class="value">
<code>static</code>
</dd>
<dt class="key">template:</dt>
<dd class="value">
<code>randomize(Seed)</code>
</dd>
<dt class="key">mode &ndash; number of proofs:</dt>
<dd class="value">
<code>randomize(+positive_integer) &ndash; one</code>
</dd>
</dl>
</div>
</div>
<div class="protected">
<h2>Protected interface</h2>
Expand Down
36 changes: 18 additions & 18 deletions docs/tools_inheritance_diagram.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 480ff8f

Please sign in to comment.