3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Headers and Namespaces</title>
5 <link rel="stylesheet" href="../../../math.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../index.html" title="Math Toolkit 2.11.0">
8 <link rel="up" href="../overview.html" title="Overview of Statistical Distributions">
9 <link rel="prev" href="../overview.html" title="Overview of Statistical Distributions">
10 <link rel="next" href="objects.html" title="Distributions are Objects">
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>
22 <div class="spirit-nav">
23 <a accesskey="p" href="../overview.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.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="objects.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
26 <div class="titlepage"><div><div><h4 class="title">
27 <a name="math_toolkit.stat_tut.overview.headers"></a><a class="link" href="headers.html" title="Headers and Namespaces">Headers and
29 </h4></div></div></div>
31 All the code in this library is inside <code class="computeroutput"><span class="keyword">namespace</span>
32 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span></code>.
35 In order to use a distribution <span class="emphasis"><em>my_distribution</em></span> you
36 will need to include either the header(s) <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">my_distribution</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
37 (quicker compiles), or the "include all the distributions" header:
38 <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>.
41 For example, to use the Students-t distribution include either <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">students_t</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> or <code class="computeroutput"><span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">distributions</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>
44 You also need to bring distribution names into scope, perhaps with a <code class="computeroutput"><span class="keyword">using</span> <span class="keyword">namespace</span>
45 <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">;</span></code>
49 or specific <code class="computeroutput"><span class="keyword">using</span></code> declarations
50 like <code class="computeroutput"><span class="keyword">using</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">normal</span><span class="special">;</span></code> (<span class="bold"><strong>recommended</strong></span>).
52 <div class="caution"><table border="0" summary="Caution">
54 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../../doc/src/images/caution.png"></td>
55 <th align="left">Caution</th>
57 <tr><td align="left" valign="top"><p>
58 Some math function names are also used in <code class="computeroutput"><span class="keyword">namespace</span>
59 <span class="identifier">std</span></code> so including <code class="computeroutput"><span class="special"><</span><span class="identifier">random</span><span class="special">></span></code> could cause ambiguity!
63 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
64 <td align="left"></td>
65 <td align="right"><div class="copyright-footer">Copyright © 2006-2019 Nikhar
66 Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
67 Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
68 Råde, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
69 Daryle Walker and Xiaogang Zhang<p>
70 Distributed under the Boost Software License, Version 1.0. (See accompanying
71 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>)
76 <div class="spirit-nav">
77 <a accesskey="p" href="../overview.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.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="objects.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>