Fix doc toc misses
[shapes.git] / doc / parts / namespace / Shapes-Numeric-Random.sxml
blobbfef2fb2043e214db64c1fdf0e8cf1bd0bbfcb03
1 <?xml version="1.0" encoding="UTF-8"?>
2 <?xml-stylesheet type="text/xsl" href="formats/html.xsl"?>
4 <!-- This file is part of Shapes. -->
5 <!-- -->
6 <!-- Shapes is free software: you can redistribute it and/or modify -->
7 <!-- it under the terms of the GNU General Public License as published by -->
8 <!-- the Free Software Foundation, either version 3 of the License, or -->
9 <!-- any later version. -->
10 <!-- -->
11 <!-- Shapes is distributed in the hope that it will be useful, -->
12 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
13 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
14 <!-- GNU General Public License for more details. -->
15 <!-- -->
16 <!-- You should have received a copy of the GNU General Public License -->
17 <!-- along with Shapes. If not, see <http://www.gnu.org/licenses/>. -->
18 <!-- -->
19 <!-- Copyright 2015 Henrik Tidefelt -->
22 <book>
23 <namespace>..Shapes..Numeric..Random</namespace>
24 <description>
25 <p>Random number generation.</p>
26 </description>
28 <title><self /></title>
29 <up-link><parent-namespace /></up-link>
30 <base href=<!--#expand-next-string-->"$(BASE)" />
31 <examples-home href=<!--#expand-next-string-->"$(EXAMPLES)" />
32 <shapes-version number=<!--#expand-next-string-->"$(SHAPES_VERSION)" />
33 <external>
34 <!--#include virtual="^/toc.xml" -->
35 </external>
37 <top>
38 <alphabetical-index/>
39 <p>Besides the most elementary things such as initializing the random state and then sampling uniformly from a huge range of integer values, <str-Shapes /> also comes with some more interesting distributions to sample from. Distributions are not represented explicitly, only implicitly as the non-pure functions that return an object of some kind while acting on a random state.</p>
40 </top>
42 <body>
44 <system-binding name="newRandom">
45 <summary>Create random number generator seed</summary>
46 <function>
47 <top>
48 <p>Create random number generator seed.</p>
49 </top>
50 <case>
51 <arguments>
52 <arg identifier="seed">
53 <type>
54 <union-type>
55 <named-type name="Integer" />
56 <named-type name="ChronologicalTime" />
57 </union-type>
58 </type>
59 </arg>
60 <arg identifier="size">
61 <type><named-type name="Integer" /></type>
62 <default><eq>32</eq></default>
63 </arg>
64 </arguments>
65 <result>
66 <type><named-type name="RandomSeed" /></type>
67 </result>
68 <dynamic-references></dynamic-references>
69 <description>
70 <p>Creates random number generator seed based on <arg name="seed" /> (agreed, <em>seed</em> being used with two slightly different meanings hre), with <arg name="size" /> number of bits.</p>
71 <p>A random number generator seed is simply the initial state of a random number generator, but note that it is not possible to draw samples using the seed, since the seed is a value and not a state. To draw samples, a <named-statetype name="Random" /> must be spawned from the seed. Note that all <named-statetype name="Random" /> spawned from the same seed will generate the same pseudo random number sequence.</p>
72 </description>
73 </case>
74 </function>
75 </system-binding>
77 <system-state name="randomdevice">
78 <type><named-statetype name="RandomDevice" /></type>
79 <description>
80 <p>Source of high quality random seeds.</p>
81 </description>
82 </system-state>
84 </body>
86 </book>