1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Class template random_t</title> 5<link rel="stylesheet" href="../../../../boostbook.css" type="text/css"> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="../../../../index.html" title="Boost.Test"> 8<link rel="up" href="../../../../header/boost/test/data/monomorphic/generators/random_hpp.html" title="Header <boost/test/data/monomorphic/generators/random.hpp>"> 9<link rel="prev" href="../../../../header/boost/test/data/monomorphic/generators/random_hpp.html" title="Header <boost/test/data/monomorphic/generators/random.hpp>"> 10<link rel="next" href="../random.html" title="Function random"> 11</head> 12<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 13<table cellpadding="2" width="100%"><tr> 14<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td> 15<td align="center"><a href="../../../../../../../../index.html">Home</a></td> 16<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td> 17<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 18<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 19<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td> 20</tr></table> 21<hr> 22<div class="spirit-nav"> 23<a accesskey="p" href="../../../../header/boost/test/data/monomorphic/generators/random_hpp.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../header/boost/test/data/monomorphic/generators/random_hpp.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../random.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 24</div> 25<div class="refentry"> 26<a name="boost.unit_test.data.monomorphic.random_t"></a><div class="titlepage"></div> 27<div class="refnamediv"> 28<h2><span class="refentrytitle">Class template random_t</span></h2> 29<p>boost::unit_test::data::monomorphic::random_t — Generator for the random sequences. </p> 30</div> 31<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 32<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../../../header/boost/test/data/monomorphic/generators/random_hpp.html" title="Header <boost/test/data/monomorphic/generators/random.hpp>">boost/test/data/monomorphic/generators/random.hpp</a>> 33 34</span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> SampleType <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span> 35 <span class="keyword">typename</span> DistributionType <span class="special">=</span> <span class="keyword">typename</span> ds_detail::default_distribution<span class="special"><</span><span class="identifier">SampleType</span><span class="special">></span><span class="special">::</span><span class="identifier">type</span><span class="special">,</span> 36 <span class="keyword">typename</span> EngineType <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">default_random_engine</span><span class="special">></span> 37<span class="keyword">class</span> <a class="link" href="random_t.html" title="Class template random_t">random_t</a> <span class="special">{</span> 38<span class="keyword">public</span><span class="special">:</span> 39 <span class="comment">// types</span> 40 <span class="keyword">typedef</span> <span class="identifier">SampleType</span> <a name="boost.unit_test.data.monomorphic.random_t.sample"></a><span class="identifier">sample</span><span class="special">;</span> 41 <span class="keyword">typedef</span> <span class="identifier">DistributionType</span> <a name="boost.unit_test.data.monomorphic.random_t.distr_type"></a><span class="identifier">distr_type</span><span class="special">;</span> 42 <span class="keyword">typedef</span> <span class="identifier">EngineType</span> <a name="boost.unit_test.data.monomorphic.random_t.engine_type"></a><span class="identifier">engine_type</span><span class="special">;</span> 43 44 <span class="comment">// <a class="link" href="random_t.html#boost.unit_test.data.monomorphic.random_tconstruct-copy-destruct">construct/copy/destruct</a></span> 45 <a class="link" href="random_t.html#idm45267288214112-bb"><span class="identifier">random_t</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 46 <span class="keyword">explicit</span> <a class="link" href="random_t.html#idm45267288213824-bb"><span class="identifier">random_t</span></a><span class="special">(</span><span class="identifier">distr_type</span> <span class="special">&&</span><span class="special">)</span><span class="special">;</span> 47 <a class="link" href="random_t.html#idm45267288212576-bb"><span class="identifier">random_t</span></a><span class="special">(</span><span class="identifier">engine_type</span> <span class="special">&&</span><span class="special">,</span> <span class="identifier">distr_type</span> <span class="special">&&</span><span class="special">)</span><span class="special">;</span> 48 49 <span class="comment">// <a class="link" href="random_t.html#idm45267288220480-bb">public member functions</a></span> 50 <a class="link" href="../size_t.html" title="Class size_t">data::size_t</a> <a class="link" href="random_t.html#idm45267288219920-bb"><span class="identifier">capacity</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 51 <span class="identifier">SampleType</span> <a class="link" href="random_t.html#idm45267288218672-bb"><span class="identifier">next</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 52 <span class="keyword">void</span> <a class="link" href="random_t.html#idm45267288217824-bb"><span class="identifier">reset</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 53 <span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> SeedType<span class="special">></span> <span class="keyword">void</span> <a class="link" href="random_t.html#idm45267288216976-bb"><span class="identifier">seed</span></a><span class="special">(</span><span class="identifier">SeedType</span> <span class="special">&&</span><span class="special">)</span><span class="special">;</span> 54<span class="special">}</span><span class="special">;</span></pre></div> 55<div class="refsect1"> 56<a name="idm46175622789680"></a><h2>Description</h2> 57<p>This class implements the generator concept (see <a class="link" href="generated_by.html" title="Class template generated_by">boost::unit_test::data::monomorphic::generated_by</a>) for implementing a random number generator. </p> 58<div class="refsect2"> 59<a name="idm46175622787984"></a><h3> 60<a name="boost.unit_test.data.monomorphic.random_tconstruct-copy-destruct"></a><code class="computeroutput">random_t</code> 61 public 62 construct/copy/destruct</h3> 63<div class="orderedlist"><ol class="orderedlist" type="1"> 64<li class="listitem"><pre class="literallayout"><a name="idm45267288214112-bb"></a><span class="identifier">random_t</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 65<li class="listitem"><pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45267288213824-bb"></a><span class="identifier">random_t</span><span class="special">(</span><span class="identifier">distr_type</span> <span class="special">&&</span> d<span class="special">)</span><span class="special">;</span></pre></li> 66<li class="listitem"><pre class="literallayout"><a name="idm45267288212576-bb"></a><span class="identifier">random_t</span><span class="special">(</span><span class="identifier">engine_type</span> <span class="special">&&</span> e<span class="special">,</span> <span class="identifier">distr_type</span> <span class="special">&&</span> d<span class="special">)</span><span class="special">;</span></pre></li> 67</ol></div> 68</div> 69<div class="refsect2"> 70<a name="idm46175622769248"></a><h3> 71<a name="idm45267288220480-bb"></a><code class="computeroutput">random_t</code> public member functions</h3> 72<div class="orderedlist"><ol class="orderedlist" type="1"> 73<li class="listitem"><pre class="literallayout"><a class="link" href="../size_t.html" title="Class size_t">data::size_t</a> <a name="idm45267288219920-bb"></a><span class="identifier">capacity</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre></li> 74<li class="listitem"><pre class="literallayout"><span class="identifier">SampleType</span> <a name="idm45267288218672-bb"></a><span class="identifier">next</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 75<li class="listitem"><pre class="literallayout"><span class="keyword">void</span> <a name="idm45267288217824-bb"></a><span class="identifier">reset</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre></li> 76<li class="listitem"> 77<pre class="literallayout"><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> SeedType<span class="special">></span> <span class="keyword">void</span> <a name="idm45267288216976-bb"></a><span class="identifier">seed</span><span class="special">(</span><span class="identifier">SeedType</span> <span class="special">&&</span> seed<span class="special">)</span><span class="special">;</span></pre>Sets the seed of the pseudo-random number engine. </li> 78</ol></div> 79</div> 80</div> 81</div> 82<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 83<td align="left"></td> 84<td align="right"><div class="copyright-footer">Copyright © 2001-2020 Boost.Test contributors<p> 85 Distributed under the Boost Software License, Version 1.0. (See accompanying 86 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 87 </p> 88</div></td> 89</tr></table> 90<hr> 91<div class="spirit-nav"> 92<a accesskey="p" href="../../../../header/boost/test/data/monomorphic/generators/random_hpp.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../../header/boost/test/data/monomorphic/generators/random_hpp.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../random.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a> 93</div> 94</body> 95</html> 96