Boost C++ Libraries: Ticket #3545: Improve random documentation https://svn.boost.org/trac10/ticket/3545 <p> Robert Ramey wrote: </p> <p> Since you asked. I think my problem is in the very first section under the title "Boost Random Number Library". </p> <p> I expected to find and example like: </p> <pre class="wiki">normal_distribution nd&lt;int&gt;(mean, standard_deviation) ... int random_number = nd(); ... </pre><p> Of course I realized pretty soon that I wasn't going to find that. So then I looked at the random_demo.cpp which was helpful and led me to look at library headers which wasn't all that helpful. </p> <p> Personally I would have found a small tutorial helpful. for example: </p> <p> The random number library is composed of: </p> <p> "generators" which generate random numbers and "distributors" which transform output from a "generator" into a particular distribution: </p> <p> A small complete example (from random_demo.cpp) </p> <pre class="wiki">// simulate rolling a die 10 times // construct a random simple random number generator boost::minstd_rand random_number_generator; // construct a uniform distribution for integers 1 through 6 boost::uniform&lt;int&gt; uniform_distribution(1,6); // hook the above together to create a die? // I'm not sure what to call this "variate_generator" didn't help me at all boost::variate_generator&lt;boost::minstd_rand &amp;, boost::uniform&lt;int&gt; &amp; &gt; die() // throw the die 10 times for(int i = 0; i &lt; 10; ++i) std::out &lt;&lt; die() &lt;&lt; '\n' </pre><p> Notice the lack of typedefs and other stuff to make things more abstract". I eliminated these to make the example less ... uh abstract. </p> <p> To summarize, a little bit more introduction would have helped me get going faster. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3545 Trac 1.4.3 Steven Watanabe Fri, 26 Mar 2010 23:02:20 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/3545#comment:1 https://svn.boost.org/trac10/ticket/3545#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> I've completely overhauled the docs now. The changes are scheduled to be released in 1.43. </p> Ticket