Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / math / doc / html / math_toolkit / namespaces.html
1 <html>
2 <head>
3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>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="Chapter&#160;1.&#160;Overview">
9 <link rel="prev" href="directories.html" title="Directory and File Structure">
10 <link rel="next" href="result_type.html" title="Calculation of the Type of the Result">
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="directories.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="result_type.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
24 </div>
25 <div class="section">
26 <div class="titlepage"><div><div><h2 class="title" style="clear: both">
27 <a name="math_toolkit.namespaces"></a><a class="link" href="namespaces.html" title="Namespaces">Namespaces</a>
28 </h2></div></div></div>
29 <p>
30       All math functions and distributions are in <code class="computeroutput"><span class="keyword">namespace</span>
31       <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span></code>.
32     </p>
33 <p>
34       So, for example, the Students-t distribution template in <code class="computeroutput"><span class="keyword">namespace</span>
35       <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span></code> is
36     </p>
37 <pre class="programlisting"><span class="keyword">template</span> <span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">&gt;</span> <span class="keyword">class</span> <span class="identifier">students_t_distribution</span>
38 </pre>
39 <p>
40       and can be instantiated with the help of the reserved name <code class="computeroutput"><span class="identifier">students_t</span></code>(for
41       <code class="computeroutput"><span class="identifier">RealType</span> <span class="keyword">double</span></code>)
42     </p>
43 <pre class="programlisting"><span class="keyword">typedef</span> <span class="identifier">students_t_distribution</span><span class="special">&lt;</span><span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">students_t</span><span class="special">;</span>
44
45 <span class="identifier">student_t</span> <span class="identifier">mydist</span><span class="special">(</span><span class="number">10</span><span class="special">);</span>
46 </pre>
47 <div class="warning"><table border="0" summary="Warning">
48 <tr>
49 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Warning]" src="../../../../../doc/src/images/warning.png"></td>
50 <th align="left">Warning</th>
51 </tr>
52 <tr><td align="left" valign="top"><p>
53         Some distribution names are also used in std random library, so to avoid
54         the risk of ambiguity it is better to make explicit using declarations, for
55         example: <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">students_t_distribution</span></code>
56       </p></td></tr>
57 </table></div>
58 <p>
59       Functions not intended for use by applications are in <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">detail</span></code>.
60     </p>
61 <p>
62       Functions that may have more general use, like <code class="computeroutput"><span class="identifier">digits</span></code>
63       (significand), <code class="computeroutput"><span class="identifier">max_value</span></code>,
64       <code class="computeroutput"><span class="identifier">min_value</span></code> and <code class="computeroutput"><span class="identifier">epsilon</span></code> are in <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">tools</span></code>.
65     </p>
66 <p>
67       <a class="link" href="../policy.html" title="Chapter&#160;20.&#160;Policies: Controlling Precision, Error Handling etc">Policy</a> and configuration information is in <code class="computeroutput"><span class="keyword">namespace</span></code> <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">policies</span></code>.
68     </p>
69 <div class="tip"><table border="0" summary="Tip">
70 <tr>
71 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
72 <th align="left">Tip</th>
73 </tr>
74 <tr><td align="left" valign="top"><p>
75         Many code snippets assume implicit namespace(s), for example, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span></code> or
76         <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span></code>.
77       </p></td></tr>
78 </table></div>
79 <div class="tip"><table border="0" summary="Tip">
80 <tr>
81 <td rowspan="2" align="center" valign="top" width="25"><img alt="[Tip]" src="../../../../../doc/src/images/tip.png"></td>
82 <th align="left">Tip</th>
83 </tr>
84 <tr><td align="left" valign="top"><p>
85         Start your work from a copy of the example source code; links usually provided.
86       </p></td></tr>
87 </table></div>
88 </div>
89 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
90 <td align="left"></td>
91 <td align="right"><div class="copyright-footer">Copyright &#169; 2006-2019 Nikhar
92       Agrawal, Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos,
93       Hubert Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Matthew Pulver, Johan
94       R&#229;de, Gautam Sewani, Benjamin Sobotta, Nicholas Thompson, Thijs van den Berg,
95       Daryle Walker and Xiaogang Zhang<p>
96         Distributed under the Boost Software License, Version 1.0. (See accompanying
97         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>)
98       </p>
99 </div></td>
100 </tr></table>
101 <hr>
102 <div class="spirit-nav">
103 <a accesskey="p" href="directories.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="result_type.html"><img src="../../../../../doc/src/images/next.png" alt="Next"></a>
104 </div>
105 </body>
106 </html>