Revision: 325 Author: alai04 Date: Wed Sep 9 20:09:56 2009 Log: 转换至1.40.0,第8批,完成以下库: math math/common_factor math/complex number algorithms math/octonion math/quaternion math/special_functions math/statistical distributions http://code.google.com/p/boost-doc-zh/source/detail?r=325 Added: /trunk/libs/math/doc/distexplorer /trunk/libs/math/doc/distexplorer/html /trunk/libs/math/doc/distexplorer/html/index.html /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric1.png /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric2.png /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric3.png /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric4.png /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric5.png /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric6.png /trunk/libs/math/doc/sf_and_dist/equations/laplace_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/hypergeometric_pdf_1.png /trunk/libs/math/doc/sf_and_dist/graphs/hypergeometric_pdf_2.png /trunk/libs/math/doc/sf_and_dist/graphs/laplace_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/laplace_pdf_mu.png /trunk/libs/math/doc/sf_and_dist/graphs/laplace_pdf_sigma.png /trunk/libs/math/doc/sf_and_dist/graphs/logistic_pdf.png/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/hypergeometric_dist.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/laplace_dist.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/logistic_dist.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/complements.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/generic.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/headers.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/objects.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/parameters.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/summary.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/c_sharp.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/extern_c /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/extern_c.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/building.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/using_udt/use_mpfr.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fpclass.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/next_float /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/next_float.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/rounding /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/rounding.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/sign_functions.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils.html /trunk/libs/math/dot_net_example /trunk/libs/math/dot_net_example/distribution_explorer /trunk/libs/math/dot_net_example/distribution_explorer/boost.png Deleted: /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/extern_c /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/extern_c.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/fpclass.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/next_float /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/next_float.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/rounding /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/rounding.html Modified: /trunk/libs/math/doc/sf_and_dist/graphs/acosh.png /trunk/libs/math/doc/sf_and_dist/graphs/asinh.png /trunk/libs/math/doc/sf_and_dist/graphs/atanh.png /trunk/libs/math/doc/sf_and_dist/graphs/beta.png /trunk/libs/math/doc/sf_and_dist/graphs/beta_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/cauchy_pdf1.png /trunk/libs/math/doc/sf_and_dist/graphs/cauchy_pdf2.png /trunk/libs/math/doc/sf_and_dist/graphs/cbrt.png /trunk/libs/math/doc/sf_and_dist/graphs/chi_squared_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/cyl_bessel_i.png /trunk/libs/math/doc/sf_and_dist/graphs/cyl_bessel_j.png /trunk/libs/math/doc/sf_and_dist/graphs/cyl_bessel_k.png /trunk/libs/math/doc/sf_and_dist/graphs/cyl_neumann.png /trunk/libs/math/doc/sf_and_dist/graphs/digamma.png /trunk/libs/math/doc/sf_and_dist/graphs/ellint_1.png /trunk/libs/math/doc/sf_and_dist/graphs/ellint_2.png /trunk/libs/math/doc/sf_and_dist/graphs/ellint_3.png /trunk/libs/math/doc/sf_and_dist/graphs/ellint_carlson.png /trunk/libs/math/doc/sf_and_dist/graphs/erf.png /trunk/libs/math/doc/sf_and_dist/graphs/erf_inv.png /trunk/libs/math/doc/sf_and_dist/graphs/erfc.png /trunk/libs/math/doc/sf_and_dist/graphs/erfc_inv.png /trunk/libs/math/doc/sf_and_dist/graphs/expint2.png /trunk/libs/math/doc/sf_and_dist/graphs/expint_i.png /trunk/libs/math/doc/sf_and_dist/graphs/expm1.png /trunk/libs/math/doc/sf_and_dist/graphs/exponential_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf1.png /trunk/libs/math/doc/sf_and_dist/graphs/extreme_value_pdf2.png /trunk/libs/math/doc/sf_and_dist/graphs/fisher_f_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/gamma1_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/gamma2_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/gamma_p.png /trunk/libs/math/doc/sf_and_dist/graphs/gamma_q.png /trunk/libs/math/doc/sf_and_dist/graphs/hermite.png /trunk/libs/math/doc/sf_and_dist/graphs/ibeta.png /trunk/libs/math/doc/sf_and_dist/graphs/lgamma.png /trunk/libs/math/doc/sf_and_dist/graphs/log1p.png /trunk/libs/math/doc/sf_and_dist/graphs/lognormal_pdf1.png /trunk/libs/math/doc/sf_and_dist/graphs/lognormal_pdf2.png /trunk/libs/math/doc/sf_and_dist/graphs/nc_beta_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/nc_f_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/nc_t_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/nccs_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/normal_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/pareto_pdf1.png /trunk/libs/math/doc/sf_and_dist/graphs/pareto_pdf2.png /trunk/libs/math/doc/sf_and_dist/graphs/powm1.png /trunk/libs/math/doc/sf_and_dist/graphs/rayleigh_cdf.png /trunk/libs/math/doc/sf_and_dist/graphs/rayleigh_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/sinc_pi.png /trunk/libs/math/doc/sf_and_dist/graphs/sinhc_pi.png /trunk/libs/math/doc/sf_and_dist/graphs/sph_bessel.png /trunk/libs/math/doc/sf_and_dist/graphs/sph_neumann.png /trunk/libs/math/doc/sf_and_dist/graphs/sqrt1pm1.png /trunk/libs/math/doc/sf_and_dist/graphs/students_t_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/tgamma.png /trunk/libs/math/doc/sf_and_dist/graphs/tgamma_delta_ratio.png /trunk/libs/math/doc/sf_and_dist/graphs/triangular_cdf.png /trunk/libs/math/doc/sf_and_dist/graphs/triangular_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/uniform_cdf.png /trunk/libs/math/doc/sf_and_dist/graphs/uniform_pdf.png /trunk/libs/math/doc/sf_and_dist/graphs/weibull_pdf1.png /trunk/libs/math/doc/sf_and_dist/graphs/weibull_pdf2.png /trunk/libs/math/doc/sf_and_dist/graphs/zeta1.png /trunk/libs/math/doc/sf_and_dist/graphs/zeta2.png /trunk/libs/math/doc/sf_and_dist/html/index.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/backgrounders/implementation.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/backgrounders/lanczos.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/backgrounders/refs.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/backgrounders/relative_error.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/backgrounders/remez.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/backgrounders.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dist_algorithms.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/gamma_dist.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/lognormal_dist.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/pareto.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/nmp.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/variates.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/binom_eg/binomial_quiz_example.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_location_eg.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_mean_and_sd_eg.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/find_eg/find_scale_eg.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/nag_library.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/neg_binom_eg/negative_binomial_example1.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/st_eg/tut_mean_size.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/extern_c/c99.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/extern_c/tr1.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/error_handling.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/history1.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/perf_over.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/tr1.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/perf/comparisons.html/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/policy/pol_ref/error_handling_policies.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/ellint/ellint_3.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/inv_hyper/atanh.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/sf_beta/ibeta_function.html
/trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/status/credits.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/status/history1.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/status/issues.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/toolkit.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/using_udt/concepts.html /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/using_udt/use_ntl.html ======================================= --- /dev/null+++ /trunk/libs/math/doc/distexplorer/html/index.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,216 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Statistical Distribution Explorer</title>+<link rel="stylesheet" href="../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0">+<link rel="home" href="index.html" title="Statistical Distribution Explorer">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav"></div> +<div class="article" lang="en"> +<div class="titlepage"> +<div> +<div><h2 class="title">+<a name="statistical_distribution_explorer"></a>Statistical Distribution Explorer</h2></div>
+<div><div class="authorgroup"> +<div class="author"><h3 class="author"> +<span class="firstname">Paul A.</span> <span class="surname">Bristow</span> +</h3></div> +<div class="author"><h3 class="author"> +<span class="firstname">John</span> <span class="surname">Maddock</span> +</h3></div> +</div></div>+<div><p class="copyright">Copyright © 2008 Paul A. Bristow, John Maddock</p></div>
+<div><div class="legalnotice"> +<a name="id770834"></a><p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></div> +</div> +<hr> +</div> +<p>+ A Windows utility to show the properties of statistical distributions using parameters
+ provided interactively by the user. + </p> +<p> + The distributions provided are: + </p> +<div class="itemizedlist"><ul type="disc"> +<li> + bernoulli + </li> +<li> + beta_distribution + </li> +<li> + binomial_distribution + </li> +<li> + cauchy + </li> +<li> + chi_squared + </li> +<li> + exponential + </li> +<li> + extreme_value + </li> +<li> + fisher_f + </li> +<li> + gamma_distribution + </li> +<li> + lognormal_distribution + </li> +<li> + negative_binomial_distribution + </li> +<li> + normal_distribution + </li> +<li> + pareto + </li> +<li> + poisson + </li> +<li> + rayleigh + </li> +<li> + students_t + </li> +<li> + triangular + </li> +<li> + uniform + </li> +<li> + weibull + </li> +</ul></div> +<p> + Properties of distributions computed are: + </p> +<div class="itemizedlist"><ul type="disc"> +<li> + mean + </li> +<li> + mode + </li> +<li> + median + </li> +<li> + variance + </li> +<li> + standard deviation + </li> +<li> + coefficient of variation, + </li> +<li> + skewness + </li> +<li> + kurtosis + </li> +<li> + excess + </li> +<li> + range supported + </li> +</ul></div> +<p> + Calculated, from values provided, are: + </p> +<div class="itemizedlist"><ul type="disc"> +<li> + probability density (or mass) function (PDF) + </li> +<li> + cumulative distribution function (CDF), and complement + </li> +<li>+ Quantiles (percentiles) are calculated for typical risk (alpha) probabilities + (0.001, 0.01, 0.5, 0.1, 0.333) and for additional probabilities provided by
+ the user. + </li> +</ul></div> +<p>+ Results can be saved to text files using Save or SaveAs. All the values on the + four tabs are output to the file chosen, and are tab separated to assist input
+ to other programs, for example, spreadsheets or text editors. + </p> +<p>+ Note: Excel (for example), only shows 10 decimal digits, by default: to display + the maximum possible precision (abotu 15 decimal digits), it is necessary to + format all cells to display this precision. Although unusually accurate, not + all values computed by Distexplorer will be as accurate as this. Values shown + as NaN cannot be calculated from the value(s) given, most commonly because the
+ value input is outside the range for the distribution. + </p> +<p> + For more information, including downloads, see + </p> +<p>+ <a href="http://distexplorer.sourceforge.net/"; target="_top">Distexplorer at Sourceforge</a>
+ </p> +<p>+ This Microsoft Windows 32 package distribution.exe was generated from a C# program + and uses a boost_math.dll generated using the Boost.Math C++ source code from + the Boost.Math Toolkit, compiled in CLI mode, containing the underlying statistical
+ distribution classes and functions. + </p> +<p>+ All source code is freely available for view and use under the <a href="http://www.boost.org/LICENSE_1_0.txt"; target="_top">Boost
+ Open Source License</a>. + </p> +<p>+ <a href="https://svn.boost.org/svn/boost/sandbox%5Cmath_toolkit%5Clibs%5Cmath%5Cdot_net_example"; target="_top">Math + Toolkit C++ source code</a> to produce boost_math.dll is in the most recent + <a href="http://www.boost.org"; target="_top">Boost</a> release, initially 1.35.0.
+ </p> +<p>+ It is distributed as a single Windows Installer package Setupdistex.msi. Unzip + the distexplorer.zip to a temporary location of your choice and run setup.exe.
+ </p> +<p>+ (Note that .NET framework 2.0 and VCredist are requirements for this program. + Most recent and updated Windows environments will already have these, but they + are quickly, easily and safely installed from the Microsoft site if required.)
+ </p> +<p>+ (The package cannot be run on other platforms at present but it should be possible + to build an equivalent utility on any C/C++ platform if anyone would like to
+ undertake this task.) + </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr> +<td align="left"><p><small>Last revised: February 26, 2009 at 17:08:18 GMT</small></p></td>
+<td align="right"><div class="copyright-footer"></div></td> +</tr></table> +<hr> +<div class="spirit-nav"></div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric1.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric2.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric3.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric4.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric5.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/equations/hypergeometric6.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/equations/laplace_pdf.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/graphs/hypergeometric_pdf_1.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/graphs/hypergeometric_pdf_2.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/graphs/laplace_pdf.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/graphs/laplace_pdf_mu.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/graphs/laplace_pdf_sigma.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/graphs/logistic_pdf.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/hypergeometric_dist.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,344 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Hypergeometric Distribution</title>+<link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../dists.html" title="Distributions">+<link rel="prev" href="gamma_dist.html" title="Gamma (and Erlang) Distribution">
+<link rel="next" href="laplace_dist.html" title="Laplace Distribution"> +</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="gamma_dist.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="laplace_dist.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title">+<a name="math_toolkit.dist.dist_ref.dists.hypergeometric_dist"></a><a class="link" href="hypergeometric_dist.html" title="Hypergeometric Distribution">
+ Hypergeometric Distribution</a> +</h5></div></div></div> +<p> + +</p>+<pre class="programlisting"><span class="preprocessor">#include</span> <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">hypergeometric</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
+<p> + </p>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span> + <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Policies">Policy</a> <span class="special">=</span> <a class="link" href="../../../policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">policies::policy<></a> <span class="special">></span> +<span class="keyword">class</span> <span class="identifier">hypergeometric_distribution</span><span class="special">;</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Policy</span><span class="special">></span> +<span class="keyword">class</span> <span class="identifier">hypergeometric_distribution</span>
+<span class="special">{</span> +<span class="keyword">public</span><span class="special">:</span>+ <span class="keyword">typedef</span> <span class="identifier">RealType</span> <span class="identifier">value_type</span><span class="special">;</span> + <span class="keyword">typedef</span> <span class="identifier">Policy</span> <span class="identifier">policy_type</span><span class="special">;</span>
+ <span class="comment">// Construct:+</span> <span class="identifier">hypergeometric_distribution</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">r</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">n</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">N</span><span class="special">);</span>
+ <span class="comment">// Accessors:+</span> <span class="keyword">unsigned</span> <span class="identifier">total</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span> + <span class="keyword">unsigned</span> <span class="identifier">defective</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span> + <span class="keyword">unsigned</span> <span class="identifier">sample_count</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span> ++<span class="keyword">typedef</span> <span class="identifier">hypergeometric_distribution</span><span class="special"><></span> <span class="identifier">hypergeometric</span><span class="special">;</span>
+ +<span class="special">}}</span> <span class="comment">// namespaces +</span></pre> +<p>+ The hypergeometric distribution describes the number of "events" + <span class="emphasis"><em>k</em></span> from a sample <span class="emphasis"><em>n</em></span> drawn from + a total population <span class="emphasis"><em>N</em></span> <span class="emphasis"><em>without replacement</em></span>.
+ </p> +<p>+ Imagine we have a sample of <span class="emphasis"><em>N</em></span> objects of which + <span class="emphasis"><em>r</em></span> are "defective" and N-r are "not
+ defective" (the terms "success/failure" or "red/blue"+ are also used). If we sample <span class="emphasis"><em>n</em></span> items <span class="emphasis"><em>without + replacement</em></span> then what is the probability that exactly <span class="emphasis"><em>k</em></span> + items in the sample are defective? The answer is given by the pdf of + the hypergeometric distribution <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">k</span><span class="special">;</span> <span class="identifier">r</span><span class="special">,</span> <span class="identifier">n</span><span class="special">,</span> <span class="identifier">N</span><span class="special">)</span></code>, whilst the probability of <span class="emphasis"><em>k</em></span> + defectives or fewer is given by F(k; r, n, N), where F(k) is the CDF
+ of the hypergeometric distribution. + </p> +<div class="note"><table border="0" summary="Note"> +<tr>+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th> +</tr> +<tr><td align="left" valign="top"><p>+ Unlike almost all of the other distributions in this library, the hypergeometric + distribution is strictly discrete: it can not be extended to real valued
+ arguments of its parameters or random variable. + </p></td></tr> +</table></div> +<p>+ The following graph shows how the distribution changes as the proportion
+ of "defective" items changes, while keeping the population + and sample sizes constant: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../graphs/hypergeometric_pdf_1.png" align="middle"></span>
+ </p> +<p>+ Note that since the distribution is symmetrical in parameters <span class="emphasis"><em>n</em></span> + and <span class="emphasis"><em>r</em></span>, if we change the sample size and keep the
+ population and proportion "defective" the same then we obtain + basically the same graphs: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../graphs/hypergeometric_pdf_2.png" align="middle"></span>
+ </p>+<a name="math_toolkit.dist.dist_ref.dists.hypergeometric_dist.member_functions"></a><h5>
+<a name="id776835"></a>+ <a class="link" href="hypergeometric_dist.html#math_toolkit.dist.dist_ref.dists.hypergeometric_dist.member_functions">Member
+ Functions</a> + </h5>+<pre class="programlisting"><span class="identifier">hypergeometric_distribution</span><span class="special">(</span><span class="keyword">unsigned</span> <span class="identifier">r</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">n</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="identifier">N</span><span class="special">);</span>
+</pre> +<p>+ Constructs a hypergeometric distribution with with a population of <span class="emphasis"><em>N</em></span> + objects, of which <span class="emphasis"><em>r</em></span> are defective, and from which
+ <span class="emphasis"><em>n</em></span> are sampled. + </p>+<pre class="programlisting"><span class="keyword">unsigned</span> <span class="identifier">total</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre> +<p>+ Returns the total number of objects <span class="emphasis"><em>N</em></span>.
+ </p>+<pre class="programlisting"><span class="keyword">unsigned</span> <span class="identifier">defective</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre> +<p>+ Returns the number of objects <span class="emphasis"><em>r</em></span> in population <span class="emphasis"><em>N</em></span>
+ which are defective. + </p>+<pre class="programlisting"><span class="keyword">unsigned</span> <span class="identifier">sample_count</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre> +<p>+ Returns the number of objects <span class="emphasis"><em>n</em></span> which are sampled
+ from the population <span class="emphasis"><em>N</em></span>. + </p>+<a name="math_toolkit.dist.dist_ref.dists.hypergeometric_dist.non_member_accessors"></a><h5>
+<a name="id777014"></a>+ <a class="link" href="hypergeometric_dist.html#math_toolkit.dist.dist_ref.dists.hypergeometric_dist.non_member_accessors">Non-member
+ Accessors</a> + </h5> +<p>+ All the <a class="link" href="../nmp.html" title="Non-Member Properties">usual non-member + accessor functions</a> that are generic to all distributions are supported: + <a class="link" href="../nmp.html#math.dist.cdf">Cumulative Distribution Function</a>, + <a class="link" href="../nmp.html#math.dist.pdf">Probability Density Function</a>, <a class="link" href="../nmp.html#math.dist.quantile">Quantile</a>, <a class="link" href="../nmp.html#math.dist.hazard">Hazard + Function</a>, <a class="link" href="../nmp.html#math.dist.chf">Cumulative Hazard Function</a>, + <a class="link" href="../nmp.html#math.dist.mean">mean</a>, <a class="link" href="../nmp.html#math.dist.median">median</a>, + <a class="link" href="../nmp.html#math.dist.mode">mode</a>, <a class="link" href="../nmp.html#math.dist.variance">variance</a>, + <a class="link" href="../nmp.html#math.dist.sd">standard deviation</a>, <a class="link" href="../nmp.html#math.dist.skewness">skewness</a>, + <a class="link" href="../nmp.html#math.dist.kurtosis">kurtosis</a>, <a class="link" href="../nmp.html#math.dist.kurtosis_excess">kurtosis_excess</a>, + <a class="link" href="../nmp.html#math.dist.range">range</a> and <a class="link" href="../nmp.html#math.dist.support">support</a>.
+ </p> +<p>+ The domain of the random variable is the unsigned integers in the range + [max(0, n + r - N), min(n, r)]. A <a class="link" href="../../../main_overview/error_handling.html#domain_error">domain_error</a> + is raised if the random variable is outside this range, or is not an
+ integral value. + </p> +<div class="caution"><table border="0" summary="Caution"> +<tr>+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Caution]" src="../../../../../../../../../doc/html/images/caution.png"></td>
+<th align="left">Caution</th> +</tr> +<tr><td align="left" valign="top"> +<p>+ The quantile function will by default return an integer result that + has been <span class="emphasis"><em>rounded outwards</em></span>. That is to say lower + quantiles (where the probability is less than 0.5) are rounded downward, + and upper quantiles (where the probability is greater than 0.5) are + rounded upwards. This behaviour ensures that if an X% quantile is requested, + then <span class="emphasis"><em>at least</em></span> the requested coverage will be present + in the central region, and <span class="emphasis"><em>no more than</em></span> the requested
+ coverage will be present in the tails. + </p> +<p>+ This behaviour can be changed so that the quantile functions are rounded + differently using <a class="link" href="../../../policy/pol_overview.html" title="Policy Overview">Policies</a>. + It is strongly recommended that you read the tutorial <a class="link" href="../../../policy/pol_tutorial/understand_dis_quant.html" title="Understanding Quantiles of Discrete Distributions">Understanding + Quantiles of Discrete Distributions</a> before using the quantile + function on the Hypergeometric distribution. The <a class="link" href="../../../policy/pol_ref/discrete_quant_ref.html" title="Discrete Quantile Policies">reference + docs</a> describe how to change the rounding policy for these distributions.
+ </p> +<p>+ However, note that the implementation method of the quantile function + always returns an integral value, therefore attempting to use a <a class="link" href="../../../policy.html" title="Policies">Policy</a> that requires (or produces)
+ a real valued result will result in a compile time error. + </p> +</td></tr> +</table></div>+<a name="math_toolkit.dist.dist_ref.dists.hypergeometric_dist.accuracy"></a><h5>
+<a name="id777164"></a>+ <a class="link" href="hypergeometric_dist.html#math_toolkit.dist.dist_ref.dists.hypergeometric_dist.accuracy">Accuracy</a>
+ </h5> +<p>+ For small N such that <code class="computeroutput"><span class="identifier">N</span> <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">max_factorial</span><span class="special"><</span><span class="identifier">RealType</span><span class="special">>::</span><span class="identifier">value</span></code> + then table based lookup of the results gives an accuracy to a few epsilon. + <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">max_factorial</span><span class="special"><</span><span class="identifier">RealType</span><span class="special">>::</span><span class="identifier">value</span></code> is 170 at double or long double
+ precision. + </p> +<p>+ For larger N such that <code class="computeroutput"><span class="identifier">N</span> <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">prime</span><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">max_prime</span><span class="special">)</span></code> then only basic arithmetic is required + for the calculation and the accuracy is typically < 20 epsilon. This
+ takes care of N up to 104729. + </p> +<p>+ For <code class="computeroutput"><span class="identifier">N</span> <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">prime</span><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">max_prime</span><span class="special">)</span></code> + then accuracy quickly degrades, with 5 or 6 decimal digits being lost
+ for N = 110000. + </p> +<p>+ In general for very large N, the user should expect to loose log<sub>10</sub>N decimal + digits of precision during the calculation, with the results becoming
+ meaningless for N >= 10<sup>15</sup>. + </p>+<a name="math_toolkit.dist.dist_ref.dists.hypergeometric_dist.testing"></a><h5>
+<a name="id780004"></a>+ <a class="link" href="hypergeometric_dist.html#math_toolkit.dist.dist_ref.dists.hypergeometric_dist.testing">Testing</a>
+ </h5> +<p>+ There are three sets of tests: our implementation is tested against a + table of values produced by Mathematica's implementation of this distribution. + We also sanity check our implementation against some spot values computed + using the online calculator here <a href="http://stattrek.com/Tables/Hypergeometric.aspx"; target="_top">http://stattrek.com/Tables/Hypergeometric.aspx</a>. + Finally we test accuracy against some high precision test data using
+ this implementation and NTL::RR. + </p>+<a name="math_toolkit.dist.dist_ref.dists.hypergeometric_dist.implementation"></a><h5>
+<a name="id780028"></a>+ <a class="link" href="hypergeometric_dist.html#math_toolkit.dist.dist_ref.dists.hypergeometric_dist.implementation">Implementation</a>
+ </h5> +<p> + The PDF can be calculated directly using the formula: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../equations/hypergeometric1.png"></span>
+ </p> +<p>+ However, this can only be used directly when the largest of the factorials + is guaranteed not to overflow the floating point representation used. + This formula is used directly when <code class="computeroutput"><span class="identifier">N</span> + <span class="special"><</span> <span class="identifier">max_factorial</span><span class="special"><</span><span class="identifier">RealType</span><span class="special">>::</span><span class="identifier">value</span></code> + in which case table lookup of the factorials gives a rapid and accurate
+ implementation method. + </p> +<p>+ For larger <span class="emphasis"><em>N</em></span> the method described in "An Accurate
+ Computation of the Hypergeometric Distribution Function", Trong+ Wu, ACM Transactions on Mathematical Software, Vol. 19, No. 1, March + 1993, Pages 33-43 is used. The method relies on the fact that there is + an easy method for factorising a factorial into the product of prime
+ numbers: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../equations/hypergeometric2.png"></span>
+ </p> +<p>+ Where p<sub>i</sub> is the i'th prime number, and e<sub>i</sub> is a small positive integer or
+ zero, which can be calculated via: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../equations/hypergeometric3.png"></span>
+ </p> +<p>+ Further we can combine the factorials in the expression for the PDF to
+ yield the PDF directly as the product of prime numbers: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../equations/hypergeometric4.png"></span>
+ </p> +<p>+ With this time the exponents e<sub>i</sub> being either positive, negative or zero. + Indeed such a degree of cancellation occurs in the calculation of the + e<sub>i</sub> that many are zero, and typically most have a magnitude or no more
+ than 1 or 2. + </p> +<p>+ Calculation of the product of the primes requires some care to prevent + numerical overflow, we use a novel recursive method which splits the + calculation into a series of sub-products, with a new sub-product started + each time the next multiplication would cause either overflow or underflow. + The sub-products are stored in a linked list on the program stack, and + combined in an order that will guarantee no overflow or unnecessary-underflow
+ once the last sub-product has been calculated. + </p> +<p>+ This method can be used as long as N is smaller than the largest prime + number we have stored in our table of primes (currently 104729). The + method is relatively slow (calculating the exponents requires the most + time), but requires only a small number of arithmetic operations to calculate + the result (indeed there is no shorter method involving only basic arithmetic + once the exponents have been found), the method is therefore much more
+ accurate than the alternatives. + </p> +<p>+ For much larger N, we can calculate the PDF from the factorials using + either lgamma, or by directly combining lanczos approximations to avoid + calculating via logarithms. We use the latter method, as it is usually + 1 or 2 decimal digits more accurate than computing via logarithms with + lgamma. However, in this area where N > 104729, the user should expect + to loose around log<sub>10</sub>N decimal digits during the calculation in the worst
+ case. + </p> +<p>+ The CDF and its complement is calculated by directly summing the PDF's. + We start by deciding whether the CDF, or its complement, is likely to + be the smaller of the two and then calculate the PDF at <span class="emphasis"><em>k</em></span> + (or <span class="emphasis"><em>k+1</em></span> if we're calculating the complement) and
+ calculate successive PDF values via the recurrence relations: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../equations/hypergeometric5.png"></span>
+ </p> +<p>+ Until we either reach the end of the distributions domain, or the next
+ PDF value to be summed would be too small to affect the result. + </p> +<p>+ The quantile is calculated in a similar manner to the CDF: we first guess + which end of the distribution we're nearer to, and then sum PDFs starting + from the end of the distribution this time, until we have some value + <span class="emphasis"><em>k</em></span> that gives the required CDF.
+ </p> +<p>+ The median is simply the quantile at 0.5, and the remaining properties
+ are calculated via: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../equations/hypergeometric6.png"></span>
+ </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="gamma_dist.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="laplace_dist.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/laplace_dist.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,370 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Laplace Distribution</title>+<link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../dists.html" title="Distributions">+<link rel="prev" href="hypergeometric_dist.html" title="Hypergeometric Distribution">
+<link rel="next" href="logistic_dist.html" title="Logistic Distribution"> +</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="hypergeometric_dist.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="logistic_dist.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title">+<a name="math_toolkit.dist.dist_ref.dists.laplace_dist"></a><a class="link" href="laplace_dist.html" title="Laplace Distribution"> Laplace
+ Distribution</a> +</h5></div></div></div> +<p> + +</p>+<pre class="programlisting"><span class="preprocessor">#include</span> <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">laplace</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
+<p> + </p>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span> + <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Policies">Policy</a> <span class="special">=</span> <a class="link" href="../../../policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">policies::policy<></a> <span class="special">></span> +<span class="keyword">class</span> <span class="identifier">laplace_distribution</span><span class="special">;</span>
++<span class="keyword">typedef</span> <span class="identifier">laplace_distribution</span><span class="special"><></span> <span class="identifier">laplace</span><span class="special">;</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Policies">Policy</a><span class="special">></span> +<span class="keyword">class</span> <span class="identifier">laplace_distribution</span>
+<span class="special">{</span> +<span class="keyword">public</span><span class="special">:</span>+ <span class="keyword">typedef</span> <span class="identifier">RealType</span> <span class="identifier">value_type</span><span class="special">;</span> + <span class="keyword">typedef</span> <span class="identifier">Policy</span> <span class="identifier">policy_type</span><span class="special">;</span>
+ <span class="comment">// Construct:+</span> <span class="identifier">laplace_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">location</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">scale</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
+ <span class="comment">// Accessors:+</span> <span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span> + <span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+<span class="special">};</span> + +<span class="special">}}</span> <span class="comment">// namespaces +</span></pre> +<p>+ Laplace distribution is the distribution of differences between two independent + variates with identical exponential distributions (Abramowitz and Stegun + 1972, p. 930). It is also called the double exponential distribution.
+ </p> +<p>+ For location parameter μ and scale parameter σ it is defined by the probability
+ density function: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../equations/laplace_pdf.png"></span>
+ </p> +<p>+ The location and scale parameters are equivalent to the mean and standard
+ deviation of the normal or Gaussian distribution. + </p> +<p>+ The following graph illustrates the effect of the location parameter + μ on the PDF. Note that the range of the random variable remains [-∞,+∞]
+ irrespective of the value of the location parameter: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../graphs/laplace_pdf_mu.png" align="middle"></span>
+ </p> +<p>+ The next graph illustrates the effect of the scale parameter σ on the PDF:
+ </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../graphs/laplace_pdf_sigma.png" align="middle"></span>
+ </p>+<a name="math_toolkit.dist.dist_ref.dists.laplace_dist.member_functions"></a><h5>
+<a name="id780786"></a>+ <a class="link" href="laplace_dist.html#math_toolkit.dist.dist_ref.dists.laplace_dist.member_functions">Member
+ Functions</a> + </h5>+<pre class="programlisting"><span class="identifier">laplace_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">location</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">scale</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
+</pre> +<p>+ Constructs a laplace distribution with location <span class="emphasis"><em>location</em></span>
+ and scale <span class="emphasis"><em>scale</em></span>. + </p> +<p>+ The location parameter is the same as the mean of the random variate.
+ </p> +<p>+ The scale parameter is proportional to the standard deviation of the
+ random variate. + </p> +<p>+ Requires that the scale parameter is greater than zero, otherwise calls + <a class="link" href="../../../main_overview/error_handling.html#domain_error">domain_error</a>.
+ </p>+<pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre> +<p>+ Returns the <span class="emphasis"><em>location</em></span> parameter of this distribution.
+ </p>+<pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre> +<p>+ Returns the <span class="emphasis"><em>scale</em></span> parameter of this distribution.
+ </p>+<a name="math_toolkit.dist.dist_ref.dists.laplace_dist.non_member_accessors"></a><h5>
+<a name="id780948"></a>+ <a class="link" href="laplace_dist.html#math_toolkit.dist.dist_ref.dists.laplace_dist.non_member_accessors">Non-member
+ Accessors</a> + </h5> +<p>+ All the <a class="link" href="../nmp.html" title="Non-Member Properties">usual non-member + accessor functions</a> that are generic to all distributions are supported: + <a class="link" href="../nmp.html#math.dist.cdf">Cumulative Distribution Function</a>, + <a class="link" href="../nmp.html#math.dist.pdf">Probability Density Function</a>, <a class="link" href="../nmp.html#math.dist.quantile">Quantile</a>, <a class="link" href="../nmp.html#math.dist.hazard">Hazard + Function</a>, <a class="link" href="../nmp.html#math.dist.chf">Cumulative Hazard Function</a>, + <a class="link" href="../nmp.html#math.dist.mean">mean</a>, <a class="link" href="../nmp.html#math.dist.median">median</a>, + <a class="link" href="../nmp.html#math.dist.mode">mode</a>, <a class="link" href="../nmp.html#math.dist.variance">variance</a>, + <a class="link" href="../nmp.html#math.dist.sd">standard deviation</a>, <a class="link" href="../nmp.html#math.dist.skewness">skewness</a>, + <a class="link" href="../nmp.html#math.dist.kurtosis">kurtosis</a>, <a class="link" href="../nmp.html#math.dist.kurtosis_excess">kurtosis_excess</a>, + <a class="link" href="../nmp.html#math.dist.range">range</a> and <a class="link" href="../nmp.html#math.dist.support">support</a>.
+ </p> +<p> + The domain of the random variable is [-∞,+∞]. + </p> +<a name="math_toolkit.dist.dist_ref.dists.laplace_dist.accuracy"></a><h5> +<a name="id781045"></a>+ <a class="link" href="laplace_dist.html#math_toolkit.dist.dist_ref.dists.laplace_dist.accuracy">Accuracy</a>
+ </h5> +<p>+ The laplace distribution is implemented in terms of the standard library + log and exp functions and as such should have very small errors.
+ </p>+<a name="math_toolkit.dist.dist_ref.dists.laplace_dist.implementation"></a><h5>
+<a name="id781064"></a>+ <a class="link" href="laplace_dist.html#math_toolkit.dist.dist_ref.dists.laplace_dist.implementation">Implementation</a>
+ </h5> +<p>+ In the following table μ is the location parameter of the distribution, + σ is its scale parameter, <span class="emphasis"><em>x</em></span> is the random variate, + <span class="emphasis"><em>p</em></span> is the probability and its complement <span class="emphasis"><em>q
+ = 1-p</em></span>. + </p> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + Function + </p> + </th> +<th> + <p> + Implementation Notes + </p> + </th> +</tr></thead> +<tbody> +<tr> +<td> + <p> + pdf + </p> + </td> +<td> + <p>+ Using the relation: pdf = e<sup>-abs(x-μ) / σ</sup> / (2 * σ)
+ </p> + </td> +</tr> +<tr> +<td> + <p> + cdf + </p> + </td> +<td> + <p> + Using the relations: + </p> + <p>+ x < μ : p = e<sup>(x-μ)/σ </sup> / σ
+ </p> + <p>+ x >= μ : p = 1 - e<sup>(μ-x)/σ </sup> / σ
+ + </p> + </td> +</tr> +<tr> +<td> + <p> + cdf complement + </p> + </td> +<td> + <p> + Using the relation: + </p> + <p>+ -x < μ : q = e<sup>(-x-μ)/σ </sup> / σ
+ </p> + <p>+ -x >= μ : q = 1 - e<sup>(μ+x)/σ </sup> / σ
+ + </p> + </td> +</tr> +<tr> +<td> + <p> + quantile + </p> + </td> +<td> + <p> + Using the relations: + </p> + <p> + p < 0.5 : x = μ + σ * log(2*p) + </p> + <p> + p >= 0.5 : x = μ - σ * log(2-2*p) + </p> + </td> +</tr> +<tr> +<td> + <p> + quantile from the complement + </p> + </td> +<td> + <p> + Using the relation: + </p> + <p> + q > 0.5: x = μ + σ*log(2-2*q) + </p> + <p> + q <=0.5: x = μ - σ*log( 2*q ) + </p> + </td> +</tr> +<tr> +<td> + <p> + mean + </p> + </td> +<td> + <p> + μ + </p> + </td> +</tr> +<tr> +<td> + <p> + variance + </p> + </td> +<td> + <p> + 2 * σ<sup>2</sup> + </p> + </td> +</tr> +<tr> +<td> + <p> + mode + </p> + </td> +<td> + <p> + μ + </p> + </td> +</tr> +<tr> +<td> + <p> + skewness + </p> + </td> +<td> + <p> + 0 + </p> + </td> +</tr> +<tr> +<td> + <p> + kurtosis + </p> + </td> +<td> + <p> + 6 + </p> + </td> +</tr> +<tr> +<td> + <p> + kurtosis excess + </p> + </td> +<td> + <p> + 3 + </p> + </td> +</tr> +</tbody> +</table></div> +<a name="math_toolkit.dist.dist_ref.dists.laplace_dist.references"></a><h5> +<a name="id781372"></a>+ <a class="link" href="laplace_dist.html#math_toolkit.dist.dist_ref.dists.laplace_dist.references">References</a>
+ </h5> +<div class="itemizedlist"><ul type="disc"> +<li>+<a href="http://mathworld.wolfram.com/LaplaceDistribution.html"; target="_top">Weisstein,
+ Eric W. "Laplace Distribution."</a> From MathWorld--A + Wolfram Web Resource. + </li>+<li><a href="http://en.wikipedia.org/wiki/Laplace_distribution"; target="_top">Laplace
+ Distribution</a></li> +<li>+ M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions,
+ 1972, p. 930. + </li> +</ul></div> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="hypergeometric_dist.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="logistic_dist.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/dist_ref/dists/logistic_dist.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,302 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Logistic Distribution</title>+<link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../dists.html" title="Distributions"> +<link rel="prev" href="laplace_dist.html" title="Laplace Distribution">+<link rel="next" href="lognormal_dist.html" title="Log Normal Distribution">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="laplace_dist.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="lognormal_dist.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title">+<a name="math_toolkit.dist.dist_ref.dists.logistic_dist"></a><a class="link" href="logistic_dist.html" title="Logistic Distribution">
+ Logistic Distribution</a> +</h5></div></div></div> +<p> + +</p>+<pre class="programlisting"><span class="preprocessor">#include</span> <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">logistic</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></pre>
+<p> + </p>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span> <span class="special">=</span> <span class="keyword">double</span><span class="special">,</span> + <span class="keyword">class</span> <a class="link" href="../../../policy.html" title="Policies">Policy</a> <span class="special">=</span> <a class="link" href="../../../policy/pol_ref/pol_ref_ref.html" title="Policy Class Reference">policies::policy<></a> <span class="special">></span> +<span class="keyword">class</span> <span class="identifier">logistic_distribution</span><span class="special">;</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">RealType</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Policy</span><span class="special">></span> +<span class="keyword">class</span> <span class="identifier">logistic_distribution</span>
+<span class="special">{</span> +<span class="keyword">public</span><span class="special">:</span>+ <span class="keyword">typedef</span> <span class="identifier">RealType</span> <span class="identifier">value_type</span><span class="special">;</span> + <span class="keyword">typedef</span> <span class="identifier">Policy</span> <span class="identifier">policy_type</span><span class="special">;</span>
+ <span class="comment">// Construct:+</span> <span class="identifier">logistic_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">location</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">scale</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
+ <span class="comment">// Accessors:+</span> <span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span> <span class="comment">// location. +</span> <span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span> <span class="comment">// scale.
+</span> +<span class="special">};</span> ++<span class="keyword">typedef</span> <span class="identifier">logistic_distribution</span><span class="special"><></span> <span class="identifier">logistic</span><span class="special">;</span>
+ +<span class="special">}}</span> <span class="comment">// namespaces +</span></pre> +<p>+ The logistic distribution is a continous probability distribution. It + has two parameters - location and scale. The cumulative distribution + function of the logistic distribution appears in logistic regression + and feedforward neural networks. Among other applications, United State
+ Chess Federation and FIDE use it to calculate chess ratings. + </p> +<p>+ The following graph shows how the distribution changes as the parameters
+ change: + </p> +<p>+ <span class="inlinemediaobject"><img src="../../../../../graphs/logistic_pdf.png" align="middle"></span>
+ </p>+<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.member_functions"></a><h5>
+<a name="id781851"></a>+ <a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.member_functions">Member
+ Functions</a> + </h5>+<pre class="programlisting"><span class="identifier">logistic_distribution</span><span class="special">(</span><span class="identifier">RealType</span> <span class="identifier">u</span> <span class="special">=</span> <span class="number">0</span><span class="special">,</span> <span class="identifier">RealType</span> <span class="identifier">s</span> <span class="special">=</span> <span class="number">1</span><span class="special">);</span>
+</pre> +<p>+ Constructs a logistic distribution with location <span class="emphasis"><em>u</em></span>
+ and scale <span class="emphasis"><em>s</em></span>. + </p> +<p>+ Requires <code class="computeroutput"><span class="identifier">scale</span> <span class="special">></span> + <span class="number">0</span></code>, otherwise a <a class="link" href="../../../main_overview/error_handling.html#domain_error">domain_error</a>
+ is raised. + </p>+<pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">location</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre> +<p> + Returns the location of this distribution. + </p>+<pre class="programlisting"><span class="identifier">RealType</span> <span class="identifier">scale</span><span class="special">()</span><span class="keyword">const</span><span class="special">;</span>
+</pre> +<p> + Returns the scale of this distribution. + </p>+<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.non_member_accessors"></a><h5>
+<a name="id782017"></a>+ <a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.non_member_accessors">Non-member
+ Accessors</a> + </h5> +<p>+ All the <a class="link" href="../nmp.html" title="Non-Member Properties">usual non-member + accessor functions</a> that are generic to all distributions are supported: + <a class="link" href="../nmp.html#math.dist.cdf">Cumulative Distribution Function</a>, + <a class="link" href="../nmp.html#math.dist.pdf">Probability Density Function</a>, <a class="link" href="../nmp.html#math.dist.quantile">Quantile</a>, <a class="link" href="../nmp.html#math.dist.hazard">Hazard + Function</a>, <a class="link" href="../nmp.html#math.dist.chf">Cumulative Hazard Function</a>, + <a class="link" href="../nmp.html#math.dist.mean">mean</a>, <a class="link" href="../nmp.html#math.dist.median">median</a>, + <a class="link" href="../nmp.html#math.dist.mode">mode</a>, <a class="link" href="../nmp.html#math.dist.variance">variance</a>, + <a class="link" href="../nmp.html#math.dist.sd">standard deviation</a>, <a class="link" href="../nmp.html#math.dist.skewness">skewness</a>, + <a class="link" href="../nmp.html#math.dist.kurtosis">kurtosis</a>, <a class="link" href="../nmp.html#math.dist.kurtosis_excess">kurtosis_excess</a>, + <a class="link" href="../nmp.html#math.dist.range">range</a> and <a class="link" href="../nmp.html#math.dist.support">support</a>.
+ </p> +<p>+ The domain of the random variable is [-[max_value], +[min_value]]. However,
+ the pdf and cdf support inputs of +∞ and -∞ +as special cases if RealType + permits. + </p> +<p>+ At <code class="computeroutput"><span class="identifier">p</span><span class="special">=</span><span class="number">1</span></code> and <code class="computeroutput"><span class="identifier">p</span><span class="special">=</span><span class="number">0</span></code>, the + quantile function returns the result of +<a class="link" href="../../../main_overview/error_handling.html#overflow_error">overflow_error</a> + and -<a class="link" href="../../../main_overview/error_handling.html#overflow_error">overflow_error</a>, while the + complement quantile function returns the result of -<a class="link" href="../../../main_overview/error_handling.html#overflow_error">overflow_error</a> + and +<a class="link" href="../../../main_overview/error_handling.html#overflow_error">overflow_error</a> respectively.
+ </p> +<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.accuracy"></a><h5> +<a name="id782184"></a>+ <a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.accuracy">Accuracy</a>
+ </h5> +<p>+ The logistic distribution is implemented in terms of the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">exp</span></code> and the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">log</span></code> + functions, so its accuracy is related to the accurate implementations + of those functions on a given platform. When calculating the quantile + with a non-zero <span class="emphasis"><em>position</em></span> parameter catastrophic + cancellation errors can occur: in such cases, only a low <span class="emphasis"><em>absolute
+ error</em></span> can be guarenteed. + </p>+<a name="math_toolkit.dist.dist_ref.dists.logistic_dist.implementation"></a><h5>
+<a name="id782239"></a>+ <a class="link" href="logistic_dist.html#math_toolkit.dist.dist_ref.dists.logistic_dist.implementation">Implementation</a>
+ </h5> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + Function + </p> + </th> +<th> + <p> + Implementation Notes + </p> + </th> +</tr></thead> +<tbody> +<tr> +<td> + <p> + pdf + </p> + </td> +<td> + <p>+ Using the relation: pdf = e<sup>-(x-u)/s</sup> / (s*(1+e<sup>-(x-u)/s</sup>)<sup>2</sup>)
+ </p> + </td> +</tr> +<tr> +<td> + <p> + cdf + </p> + </td> +<td> + <p> + Using the relation: p = 1/(1+e<sup>-(x-u)/s</sup>) + </p> + </td> +</tr> +<tr> +<td> + <p> + cdf complement + </p> + </td> +<td> + <p> + Using the relation: q = 1/(1+e<sup>(x-u)/s</sup>) + </p> + </td> +</tr> +<tr> +<td> + <p> + quantile + </p> + </td> +<td> + <p> + Using the relation: x = u - s*log(1/p-1) + </p> + </td> +</tr> +<tr> +<td> + <p> + quantile from the complement + </p> + </td> +<td> + <p> + Using the relation: x = u + s*log(p/1-p) + </p> + </td> +</tr> +<tr> +<td> + <p> + mean + </p> + </td> +<td> + <p> + u + </p> + </td> +</tr> +<tr> +<td> + <p> + mode + </p> + </td> +<td> + <p> + The same as the mean. + </p> + </td> +</tr> +<tr> +<td> + <p> + skewness + </p> + </td> +<td> + <p> + 0 + </p> + </td> +</tr> +<tr> +<td> + <p> + kurtosis excess + </p> + </td> +<td> + <p> + 6/5 + </p> + </td> +</tr> +<tr> +<td> + <p> + variance + </p> + </td> +<td> + <p> + (π*s)<sup>2</sup> / 3 + </p> + </td> +</tr> +</tbody> +</table></div> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="laplace_dist.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../dists.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="lognormal_dist.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/complements.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,136 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head>+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Complements are supported too - and when to use them</title>
++<link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../overview.html" title="Overview of Distributions">+<link rel="prev" href="generic.html" title="Generic operations common to all distributions are non-member functions"> +<link rel="next" href="parameters.html" title="Parameters can be calculated">
+</head>+<body style="color: black; background-color: white;" alink="#0000ff" link="#0000ff" vlink="#840084">
+<table cellpadding="2" width="100%"> +<tbody> +<tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../../../../../boost.png" height="86" width="277"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr> +</tbody> +</table> +<hr>+<div class="spirit-nav"><a accesskey="p" href="generic.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="parameters.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"> +<div> +<div>+<h5 class="title"><a name="math_toolkit.dist.stat_tut.overview.complements"></a><a class="link" href="complements.html" title="Complements are supported too - and when to use them">
+补集也得到支持 - 何时使用它们</a> +</h5> +</div> +</div> +</div>+<p>你经常不想得到CDF的值,而是它的补集的值,也就是说你想得到<code class="computeroutput"><span class="number">1</span><span class="special">-</span><span class="identifier">p</span></code> 而不是 <code class="computeroutput"><span class="identifier">p</span></code>。 +你可以计算CDF 然后用<code class="computeroutput"><span class="number">1</span></code>减去这个结果,但是如果<code class="computeroutput"><span class="identifier">p</span></code>
+非常接近于<code class="computeroutput"><span class="number">1</span></code>+,那么消去错误(cancellation error)将会使用你丢失有效数字。在极端的情况下, <code class="computeroutput"><span class="identifier">p</span></code> +可能实际上等于 <code class="computeroutput"><span class="number">1</span></code>, 即使补集的真值( true
+value)是非零的。. </p>+<p><a href="complements.html#why_complements">参见<span class="emphasis"><em>"为什么有补集( complements)?"</em></span></a>
+</p>+<p>在这个库中,无论何时你想要得到一个补集(complement),把所有的函数参数包装 在对函数<code class="computeroutput"><span class="identifier">complement</span><span class="special">(...)</span></code>的调用之中 ,例如: </p> +<pre class="programlisting"><span class="identifier">students_t</span> <span class="identifier">dist</span><span class="special">(</span><span class="number">5</span><span class="special">);</span><br><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"CDF at t = 1 is "</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">dist</span><span class="special">,</span> <span class="number">1.0</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span><br><span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Complement of CDF at t = 1 is "</span> <span class="special"><<</span> <span class="identifier">cdf</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">dist</span><span class="special">,</span> <span class="number">1.0</span><span class="special">))</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span>
+</pre>+<p>但请等一下,现在我们有一个补集(complement),我们必须也能够使用它。任何的 接受一个概率作为参数的函数同样也可以接受将 +所有的参数包装在对函数 <code class="computeroutput"><span class="identifier">complement</span><span class="special">(...)</span></code>中产生的补集,例如:</p> +<pre class="programlisting"><span class="identifier">students_t</span> <span class="identifier">dist</span><span class="special">(</span><span class="number">5</span><span class="special">);</span><br><br><span class="keyword">for</span><span class="special">(</span><span class="keyword">double</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">10</span><span class="special">;</span> <span class="identifier">i</span> <span class="special"><</span> <span class="number">1e10</span><span class="special">;</span> <span class="identifier">i</span> <span class="special">*=</span> <span class="number">10</span><span class="special">)</span><br><span class="special">{</span><br> <span class="comment">// 计算1 in i chance中的分位点:<br></span> <span class="keyword">double</span> <span class="identifier">t</span> <span class="special">=</span> <span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">dist</span><span class="special">,</span> <span class="number">1</span><span class="special">/</span><span class="identifier">i</span><span class="special">));</span><br> <span class="comment">// 打印出 来 :<br></span> <span class="identifier">cout</span> <span class="special"><<</span> <span class="string">"Quantile of students-t with 5 degrees of freedom\n"</span><br> <span class="string">"for a 1 in "</span> <span class="special"><<</span> <span class="identifier">i</span> <span class="special"><<</span> <span class="string">" chance is "</span> <span class="special"><<</span> <span class="identifier">t</span> <span class="special"><<</span> <span class="identifier">endl</span><span class="special">;</span><br><span class="special">}</span>
+</pre> +<div class="tip"> +<table summary="Tip" border="0"> +<tbody> +<tr>+<td rowspan="2" align="middle" valign="top" width="25"><img alt="[Tip]" src="../../../../../../../../../doc/html/images/tip.png"></td>
+<th align="left">提示</th> +</tr> +<tr> +<td align="left" valign="top"> +<p></p> +<p><span class="bold"><strong>临界值 +(Critical values)就是分位点(quantiles)</strong></span> </p>+<p>一些资料谈及quantiles,另一些资料谈及临界值( critical values),基本原则 是:</p>
+<p><span class="emphasis"><em>下临界值(Lower +critical values)</em></span> 与分位点(quantile)是相同的。</p> +<p><span class="emphasis"><em>上临界值(Upper +critical values)</em></span> 与概率补集的分位点(quantile)是相同的。</p> +<p>例如,我们有一个伯努利过程(Bernoulli process),产生一个成功比(success+ratio)为0.1且总共100次试验的伯努利分布(binomial distribution)。概率为0.05的 <span class="emphasis"><em>下临界值(lower critical value</em></span>)
+由下面给定:</p>+<p><code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">binomial</span><span class="special">(</span><span class="number">100</span><span class="special">,</span> <span class="number">0.1</span><span class="special">),</span> <span class="number">0.05</span><span class="special">)</span></code> </p>
+<p><span class="emphasis"><em>上临界值(upper +critical value</em></span>) 由下面给定:</p>+<p><code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">binomial</span><span class="special">(</span><span class="number">100</span><span class="special">,</span> <span class="number">0.1</span><span class="special">),</span> <span class="number">0.05</span><span class="special">))</span></code> </p>
+<p>分别返回4.82 和14.63。</p> +</td> +</tr> +</tbody> +</table> +</div> +<a name="why_complements"></a> +<p></p> +<div class="tip"> +<table summary="Tip" border="0"> +<tbody> +<tr>+<td rowspan="2" align="middle" valign="top" width="25"><img alt="[Tip]" src="../../../../../../../../../doc/html/images/tip.png"></td>
+<th align="left">提示</th> +</tr> +<tr> +<td align="left" valign="top"> +<p></p> +<p><span class="bold"><strong>为什么要担心 +(bother)补集(complements)?</strong></span> </p>+<p>省掉补集(complements)是非常诱人的,并且在需要的时候只是简单地用1减去概 率。然而,考虑当概率非常常于1 +时会发生什么:假设概率以浮点数表示为 <code class="computeroutput"><span class="number">0.999999940f</span></code>,那么<code class="computeroutput"><span class="number">1</span> +<span class="special">-</span> <span class="number">0.999999940f</span> <span class="special">=</span> <span class="number">5.96046448e
+-008,</span></code>但是结果实际上只精确到<span class="emphasis"><em>一 +个bit</em></span>: 没有消去(cancel out)的唯一一个bit! </p>+<p>或者以另一种方式来看待这个问题:假定我们想要在一个样本大小为10,000的学生 t分布(student's t +distribution)中错误拒绝(reject)虚假设(null-hypothesis)的风险(risk)为十亿分 之一。这给出的概率为 1 +- 10<sup>-9</sup>,当以float精度计算时刚好为1。在这种情况下,使用补集来计算 分位点 +(quantile)巧妙地解决了这个问题,例如:<code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">complement</span><span class="special">(</span><span class="identifier">students_t</span><span class="special">(</span><span class="number">10000</span><span class="special">),</span> <span class="number">1e-9</span><span class="special">))</span></code> </p> +<p>返回期望的 t-statistic <code class="computeroutput"><span class="number">6.00336</span></code>,因为:</p> +<p><code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">students_t</span><span class="special">(</span><span class="number">10000</span><span class="special">),</span> <span class="number">1</span><span class="special">-</span><span class="number">1e-9f</span><span class="special">)</span></code> </p>
+<p>产生一个溢出错误,因为它与 下面等价:</p>+<p><code class="computeroutput"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">students_t</span><span class="special">(</span><span class="number">10000</span><span class="special">),</span> <span class="number">1</span><span class="special">)</span></code> </p>
+<p>这就没有有限值的结果。</p> +</td> +</tr> +</tbody> +</table> +</div> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%">
+<tbody> +<tr> +<td align="left"></td> +<td align="right"> +<div class="copyright-footer">Copyright © 2006 , +2007, 2008, 2009 John Maddock, Paul A. Bristow, Hubert Holin, Xiaogang +Zhang, Bruno Lalande, Johan Råde, Gautam Sewani and Thijs van den Berg +<p> Distributed under the Boost Software License, Version+1.0. (See accompanying 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>)
+</p> +</div> +</td> +</tr> +</tbody> +</table> +<hr>+<div class="spirit-nav"><a accesskey="p" href="generic.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="parameters.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/generic.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,178 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head>+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Generic operations common to all distributions are
+non-member functions</title> ++<link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../overview.html" title="Overview of Distributions"> +<link rel="prev" href="objects.html" title="Distributions are Objects">+<link rel="next" href="complements.html" title="Complements are supported too - and when to use them">
+</head>+<body style="color: black; background-color: white;" alink="#0000ff" link="#0000ff" vlink="#840084">
+<table cellpadding="2" width="100%"> +<tbody> +<tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../../../../../boost.png" height="86" width="277"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr> +</tbody> +</table> +<hr>+<div class="spirit-nav"><a accesskey="p" href="objects.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="complements.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"> +<div> +<div>+<h5 class="title"><a name="math_toolkit.dist.stat_tut.overview.generic"></a><a class="link" href="generic.html" title="Generic operations common to all distributions are non-member functions">
+对所有分布都通用的操作是非成员函数</a> +</h5> +</div> +</div> +</div> +<p>想要计算一个分布的PDF (概率密度函数)吗? 没问题,使用:</p>+<pre class="programlisting"><span class="identifier">pdf</span><span class="special">(</span><span class="identifier">my_dist</span><span class="special">,</span> <span class="identifier">x</span><span class="special">);</span> <span class="comment">// 返回分布my_dist在点x处的 PDF(密度).<br></span></pre>
+<p>或者计算CDF (累积分布函数):</p>+<pre class="programlisting"><span class="identifier">cdf</span><span class="special">(</span><span class="identifier">my_dist</span><span class="special">,</span> <span class="identifier">x</span><span class="special">);</span> <span class="comment">// 返回分布my_dist的CDF (积 分形式 -从无穷到点x处)<br></span> </pre>
+<p>分位点(quantiles)也是一样的:</p>+<pre class="programlisting"><span class="identifier">quantile</span><span class="special">(</span><span class="identifier">my_dist</span><span class="special">,</span> <span class="identifier">p</span><span class="special">);</span> <span class="comment">// 返回返回变量x的值 <br></span> <span class="comment">// 满足 cdf(my_dist, x) == p.<br></span></pre> +<p>如果你在考虑为什么这些函数不是成员函数,原因是使得这个库更容易扩展:如果 你想要添加通用的操作-比方说第n个矩 <span class="emphasis"><em>n'th moment</em></span>- +那么所有你需要做的仅仅是添加合适的非成员函数,针对每个实现的分布类型进行重 载。</p>
+<div class="tip"> +<table summary="Tip" border="0"> +<tbody> +<tr>+<td rowspan="2" align="middle" valign="top" width="25"><img alt="[Tip]" src="../../../../../../../../../doc/html/images/tip.png"></td>
+<th align="left">提示</th> +</tr> +<tr> +<td align="left" valign="top"> +<p></p> +<p><span class="bold"><strong>近似于分布的分位点(<strong>Quantile</strong>) +的随机数(Random numbers)</strong></span></p>+<p>如果你想获得以一种特定方式分布的随机数,例如,以均匀,正态或三角形方式分 布,参考<a href="http://www.boost.org/libs/random/"; target="_top">Boost.Random</a>.
+</p> +<p>然而,在原理上没有什么能阻止你使用分位点函数(quantile+function)来将均匀分布的随机数转换成另外一种分布。实际上,存在更高效的随机数 生成算法。</p>
+</td> +</tr> +</tbody> +</table> +</div>+<p>例如,二项分布(binomial distribution)有两个参数: n (试验次数) 和 p (单 次试验的成功概率)。</p> +<p><code class="computeroutput"><span class="identifier">binomial_distribution</span></code>
+构造函数有两个参数:</p>+<p><code class="computeroutput"><span class="identifier">binomial_distribution</span><span class="special">(</span><span class="identifier">RealType</span> +<span class="identifier">n</span><span class="special">,</span> <span class="identifier">RealType</span> +<span class="identifier">p</span><span class="special">);</span></code> </p> +<p>对于这个分布,随机变量是 k:观测到的成功试验数。 概率 密度/质量 函数 (pdf) 写作:<span class="emphasis"><em>f(k; n, p)</em></span>.
+</p> +<div class="note"> +<table summary="Note" border="0"> +<tbody> +<tr>+<td rowspan="2" align="middle" valign="top" width="25"><img alt="[Note]" src="../../../../../../../../../doc/html/images/note.png"></td>
+<th align="left">注意</th> +</tr> +<tr> +<td align="left" valign="top"> +<p></p> +<p><span class="bold"><strong>随机变量和分布参数</strong></span> +</p>+<p><a href="http://en.wikipedia.org/wiki/Random_variate"; target="_top">随机 变量</a> 和 <a href="http://en.wikipedia.org/wiki/Parameter"; target="_top">分 +布参数</a> 按照惯例进行区分 (例如在 Wikipedia 和 Wolfram MathWorld通过在随 机变量后面放置一个 +semi-colon (或者有时是vertical bar),来区分随机变量与定义这个分布形状的形状 参数(shape parameter)。</p>
+</td> +</tr> +</tbody> +</table> +</div>+<p>就像上面提到的那样,非成员函数<code class="computeroutput"><span class="identifier">pdf</span></code>有一个分布类型的参数,以及 +另一个随机变量类型的参数。以二项分布为例( binomial distribution),我们可以 写出如下代码:</p> +<p><code class="computeroutput"><span class="identifier">pdf</span><span class="special">(</span><span class="identifier">binomial_distribution</span><span class="special"><</span><span class="identifier">RealType</span><span class="special">>(</span><span class="identifier">n</span><span class="special">,</span> +<span class="identifier">p</span><span class="special">),</span> <span class="identifier">k</span><span class="special">);</span></code> </p> +<p>允许和支持的随机变量值的范围可以通过<code class="computeroutput"><span class="identifier">range</span></code> 和<code class="computeroutput"><span class="identifier">support</span></code>这
+两个函数来测试。</p>+<p>在一个范围上分布 (实际上是随机变量)是得到 "支持的" 就是说<a href="http://en.wikipedia.org/wiki/Probability_distribution"; target="_top">"补集的概率为0的最小的封闭集合"</a>. MathWorld +对这个范围使用词语 '定义(defined)' 。非数学家( Non-mathematicians)可能会说 它的含义是 : 随机变量 x +的'interesting'最小范围,使得函数cdf的值从零到单位元素(unity)。在这个范围之 外是"uninteresting
+zones",函数pdf 的值为0,且函数cdf的为0或单位元素(unity)。</p>+<p>对于大多数的分布,具有概率分布函数的分布可以描述为“ 运行良好的 (well-behaved) ”, <span class="bold"><strong>如果端点是不连续 的,</strong></span>我 +们认为对支持的范围排除类似于刚好为0的值是很有帮助的。例如,随着随机变量x朝 0递减,韦泊尔分布(Weibull +Distribution)(尺度参数为1,形状参数为1)顺利地(smoothly)向单位元素(unity)推 进。但在x = +zero处,依照定义,函数pdf的值突然变为0。如果你在为pdf函数绘图(plot),或计算 pdf函数,对于支持的下限,0并不是最有用的值,就像 +我们发现的那样。因此对于这个分布,以及类似的分布,我们决定将最接近0的值 min_value作为支持的范围的下限在数值上是很有用的。(范围仍然是从 +0开始,因此你仍会得到<code class="computeroutput"><span class="identifier">pdf</span><span class="special">(</span><span class="identifier">weibull</span><span class="special">,</span> <span class="number">0</span><span class="special">)</span> <span class="special">==</span>
+<span class="number">0</span></code>)。(指数分布和γ分布 +也有类似的不连续函数)。</p>+<p>在数学上,对于(+ 或 -)无穷值这些函数是有意义的,但是除了一些特殊情况(在 柯西分布和正态分布中),这个库的实现将对于<code class="computeroutput"><span class="identifier">RealType</span></code>类 +型的随机变量的值限定为从<code class="computeroutput"><span class="identifier">max</span></code> 到 <code class="computeroutput"><span class="identifier">min +的</span></code>有限值。 (参考<a href="../../../backgrounders/implementation.html#math_toolkit.backgrounders.implementation.handling_of_floating_point_infinity">处
+理浮点类型无限值</a> 了解原理)。</p> +<div class="note"> +<table summary="Note" border="0"> +<tbody> +<tr>+<td rowspan="2" align="middle" valign="top" width="25"><img style="width: 24px; height: 24px;" alt="[Note]" src="../../../../../../../../../doc/html/images/note.png"></td>
+<th align="left">注意</th> +</tr> +<tr> +<td align="left" valign="top"> +<p></p> +<p><span class="bold"><strong>离散概率分布</strong></span> +</p>+<p>注意<a href="http://en.wikipedia.org/wiki/Discrete_probability_distribution"; target="_top">离散概率分布(discrete distributions)</a>,包括二项分布
+(binomial distribution), 负二项分布(negative binomial distribution), +泊松分布(Poisson distribution ) & 伯努利分布(Bernoulli+distribution),都在数学上定义为离散函数( discrete functions):也就是说函数 <code class="computeroutput"><span class="identifier">cdf</span></code>
+和 <code class="computeroutput"><span class="identifier">pdf</span></code> +只针对于整数的随机变量进行定义。</p>+<p>然而,因为计算方法经常使用连续函数,所以把它们当作“好像是”连续函数来对待 会带来方便,并且允许它们的参数为非整数
+值。</p>+<p>用户想要确保一个严格的数学模型,可以在调用这个分布函数之前使用函数<code class="computeroutput"><span class="identifier">floor</span></code>
+或 <code class="computeroutput"><span class="identifier">ceil</span></code> +。</p> +<p>这些分布的分位点函数(quantile+functions)在某种程度上很难一直满足所有人的需要而得到具体指定。缺省的行为是 返回一个将结果向外舍入(<span class="emphasis"><em>outwards</em></span>)整 +数值:这就是说,下分位点(lower quantiles)-概率小于0.5是向下舍入,而对于上 分位点(upper +quantile)-概率大于0.5是向上舍入。这种行为确保如果返回一个X%分位点值,那么 至少标的覆盖范围将会在中心区域显示,不是要求的覆盖范围将
+会在尾部(tails)显示。</p>+<p>这种行为可以改变,使得分位点函数可以进行不同的舍入,或者甚至使用<a title="Policy Overview" href="../../../policy/pol_overview.html">策 +略</a>来返回一个实值(real-valued)。在你使用二项分布的分位点函数之前,强烈推 荐你阅读<a title="Understanding Quantiles of Discrete Distributions" href="../../../policy/pol_tutorial/understand_dis_quant.html">理 +解分布的分位点</a> 。<a title="Discrete Quantile Policies" href="../../../policy/pol_ref/discrete_quant_ref.html">参考文档</a>
+描述了如何为这些分布改变舍入策略。</p> +<p>出于类似的原因,对于参数类似于“自由度(degree of+freedom)”为整数的连续分布,参数被当作实数看待(如果需要的话,会从整数提升为 浮点数)。然而在这种情况下,有少数的情况,非整数自由度
+(degree of freedom)的确有一个真实的含义( genuine meaning)。</p> +</td> +</tr> +</tbody> +</table> +</div> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%">
+<tbody> +<tr> +<td align="left"></td> +<td align="right"> +<div class="copyright-footer">Copyright © 2006 , +2007, 2008, 2009 John Maddock, Paul A. Bristow, Hubert Holin, Xiaogang +Zhang, Bruno Lalande, Johan Råde, Gautam Sewani and Thijs van den Berg +<p> Distributed under the Boost Software License, Version+1.0. (See accompanying 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>)
+</p> +</div> +</td> +</tr> +</tbody> +</table> +<hr>+<div class="spirit-nav"><a accesskey="p" href="objects.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="complements.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/headers.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,49 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ++<title>Headers and Namespaces</title><link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../overview.html" title="Overview of Distributions"> +<link rel="prev" href="../overview.html" title="Overview of Distributions">+<link rel="next" href="objects.html" title="Distributions are Objects"></head> +<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../../../../../boost.png" height="86" width="277"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="../overview.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="objects.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title">+<a name="math_toolkit.dist.stat_tut.overview.headers"></a><a class="link" href="headers.html" title="Headers and Namespaces"> 头文件和名字空间</a>
+</h5></div></div></div> +<p>这个库的所有代码都在boost::math名字空间中。</p> +<p>为了使用一个分布<span class="emphasis"><em>my_distribution</em></span>+,你需要包含头文件<boost/math/distributions/my_distribution.hpp> 或"包含所有(include
+everything)"头文件:<boost/math/distributions.hpp>。</p> +<p>例如,为了使用学生t分布(Students-t +distribution),包含头文件<boost/math/distributions/students_t.hpp> 或 +<boost/math/distributions.hpp></p></div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="../overview.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="objects.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/objects.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,71 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ++<title>Distributions are Objects</title><link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../overview.html" title="Overview of Distributions"> +<link rel="prev" href="headers.html" title="Headers and Namespaces">+<link rel="next" href="generic.html" title="Generic operations common to all distributions are non-member functions"></head> +<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../../../../../boost.png" height="86" width="277"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="headers.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="generic.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title">+<a name="math_toolkit.dist.stat_tut.overview.objects"></a><a class="link" href="objects.html" title="Distributions are Objects"> 分布都是对象</a>
+</h5></div></div></div> +<p>每一种分布在这个库中都是一个类类型(class type)。</p>+<p><a title="Policies" href="../../../policy.html">策略</a>提供了对这些类的 行为的更好粒度(fine-grained)的控制,允许用户定制这些类的行为:例如,如何处理 错误,
+离散分布的分位点(quantiles)如何工作(behave)。</p> +<div class="tip"> +<table summary="Tip" border="0"> +<tbody> +<tr>+<td rowspan="2" align="middle" valign="top" width="25"><img style="width: 25px; height: 24px;" alt="[Tip]" src="../../../../../../../../../doc/html/images/tip.png"></td>
+<th align="left">提示</th></tr> +<tr> +<td align="left" valign="top">+<p>如果你很熟悉使用函数而不是对象的统计类库,而且 '统计作为对象 (Distributions as Objects)' 看起来很陌生,参考<a title="Comparison with C, R, FORTRAN-style Free Functions" href="../weg/nag_library.html">与其它统计类 库的比较</a> 。</p></td></tr></tbody></table></div>
+<p>将统计作为类类型(class type)完成了两件事情:</p> +<div class="itemizedlist">+<ul type="disc"><li>它将统计类型封装在C++类型系统中;因此,例如,学生t分布( Students-t distributions)与χ方形分布(Chi-Squared
+distributions)永远都是不同的类型。+</li><li>分布对象存储了与这个分布相关的任何参数:例如,学生t分布 (Students-t distributions)有一个自由度参数(degree of +freedom)用于控制分布的形状。当构造学生t分布对象时必须提供自由度参数(<span class="emphasis"><em>degrees of
+freedom</em></span> parameter) 。 </li></ul></div>+<p>虽然在这个库中的所有分布类都是模板, 但提供了关于类型<span class="emphasis"><em>double</em></span> +的使用分布的常见名字的typedef (除了与一个具有相同名字的函数发生冲突:beta 和 gamma,在这种情况下,使用缺省的模板参数- <code class="computeroutput"><span class="identifier">RealType</span> <span class="special">=</span> <span class="keyword">double - +</span></code>也差不多方便)。可能有95%的使用情况由这些typedefs覆盖。 </p><pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">;</span><br><br><span class="comment">// 使用自由度(degree of freedom)为4来构造一个学生t分布(students_t distribution):<br></span><span class="identifier">students_t</span> <span class="identifier">d1</span><span class="special">(</span><span class="number">4</span><span class="special">);</span><br><br><span class="comment">// 构造一个double精度的β分布(beta distribution) <br></span><span class="comment">// 参数为 a = 10, b = 20<br></span><span class="identifier">beta_distribution</span><span class="special"><></span> <span class="identifier">d2</span><span class="special">(</span><span class="number">10</span><span class="special">,</span> <span class="number">20</span><span class="special">);</span> <span class="comment">// 注意: _distribution<> 下标(suffix) !<br></span></pre> +<p>如果你想要使用一个不是double类型的分布对象,那么你可以直接实例化这个模 板:模板的名字与double typedef是相同的,但是附加了一个 +<code class="computeroutput"><span class="identifier">_distribution</span></code> +后缀,例如:<a title="Students t Distribution" href="../../dist_ref/dists/students_t_dist.html">Students t Distribution</a> 或 <a title="Binomial Distribution" href="../../dist_ref/dists/binomial_dist.html">Binomial Distribution</a>:</p><pre class="programlisting"><span class="comment">// 构造一个float类型的学生t分布(student t distribution),<br>//自由度数(degree of freedom)为4<br></span><span class="identifier">students_t_distribution</span><span class="special"><</span><span class="keyword">float</span><span class="special">></span> <span class="identifier">d3</span><span class="special">(</span><span class="number">4</span><span class="special">);</span><br><br><span class="comment">// 构造一个long double类型的二项分布(binomial distribution), <br></span><span class="comment">// 概率分数(probability of success)为 0.3<br></span><span class="comment">// 总共20次试验:<br></span><span class="identifier">binomial_distribution</span><span class="special"><</span><span class="keyword">long</span> <span class="keyword">double</span><span class="special">></span> <span class="identifier">d4</span><span class="special">(</span><span class="number">20</span><span class="special">,</span> <span class="number">0.3</span><span class="special">);</span>
+</pre>+<p>传递给这些分布的参数可以通过成员获取函数(getter member functions)来访 问:</p><pre class="programlisting"><span class="identifier">d1</span><span class="special">.</span><span class="identifier">degrees_of_freedom</span><span class="special">();</span> <span class="comment">// 返回 4.0 <br></span></pre> +<p>这是很好的,但是到目前为止还不是很有用。我们经常想要做的是对这些分布计算 <span class="emphasis"><em>累积分布函数(cumulative distribution functions</em></span> +)和分位点(<span class="emphasis"><em>quantiles</em></span> )等等。 </p></div> +<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="headers.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="generic.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/parameters.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,51 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ++<title>Parameters can be calculated</title><link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../overview.html" title="Overview of Distributions">+<link rel="prev" href="complements.html" title="Complements are supported too - and when to use them">
+<link rel="next" href="summary.html" title="Summary"></head>+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../../../../../boost.png" height="86" width="277"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="complements.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="summary.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title">+<a name="math_toolkit.dist.stat_tut.overview.parameters"></a><a class="link" href="parameters.html" title="Parameters can be calculated">
+ 参数可以被计算</a> +</h5></div></div></div>+<p>有时你需要查找定义这个分布的参数。假设,例如,你已经针对相等均值并且结果 是边界(borderline)构造了一个学生t分布
+(Student's t+Distribution)。或许你的两个样本彼此不同,或许它们不是彼此不同;基于计算的结 果你并不能确定。一个合理的问题是“在我获得一个样本的区别 +是真实的概率为X%时我需要进行多少次的测量?”参数查找可以回答这个问题,并且对 于每个分布的回答都不同。它们作为分布的静态成员函数来实现。例如:</p><pre class="programlisting"><span class="identifier">students_t</span><span class="special">::</span><span class="identifier">find_degrees_of_freedom</span><span class="special">(</span><br> <span class="number">1.3</span><span class="special">,</span> <span class="comment">// 要检测的与真实均值 的差值(difference from true mean to detect)<br></span> <span class="number">0.05</span><span class="special">,</span> <span class="comment">// 错误否决虚假设的最大风险值(maximum risk of falsely rejecting the null-hypothesis).<br></span> <span class="number">0.1</span><span class="special">,</span> <span class="comment">// 错误否决虚假设的最大风险值(maximum risk of falsely failing to reject the null-hypothesis).<br></span> <span class="number">0.13</span><span class="special">);</span> <span class="comment">// 样本标准差(sample standard deviation)<br></span></pre> +<p>获得在均值中观测到的差值没有下降到偶然的独立事件(chance alone)的概率为 95%时所需要的自由度(degree of
+freedom)。在这种情况下,边界( borderline )学生t分布测试(Students-t+test)结果已经在前面获得,这可以用来估算在观测的差值被认为是有效的之前 ,样 本的大小应当变为多大 。这需要假设,当然,
+样本均值与标准差对于样本大小是不变的。</p></div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="complements.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="summary.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/overview/summary.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,50 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html><head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> ++<title>Summary</title><link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../overview.html" title="Overview of Distributions">+<link rel="prev" href="parameters.html" title="Parameters can be calculated">
+<link rel="next" href="../weg.html" title="Worked Examples"></head>+<body alink="#0000ff" bgcolor="white" link="#0000ff" text="black" vlink="#840084">
+<table cellpadding="2" width="100%"><tbody><tr>+<td valign="top"><img alt="Boost C++ Libraries" src="../../../../../../../../../boost.png" height="86" width="277"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="parameters.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../weg.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title"> +<a name="math_toolkit.dist.stat_tut.overview.summary"></a> 总结+</h5></div></div></div><div class="itemizedlist"><ul type="disc"><li>分布都 是对象,使用分布所需要的参数来构造。
+</li><li>成员函数允许你获得分布的参数。+</li><li>通用的非成员函数提供对所有的分布都通用的属性的访问(PDF, CDF, quantile 等等). +</li><li>通过将函数的参数包装在对函数<code class="computeroutput"><span class="identifier">complement</span><span class="special">(...)</span></code>的调用中来计算概率的补集。 +</li><li>接受概率作为参数的函数也可以接受概率的补集作为参数,通过将函数的参 数包装在对函数<code class="computeroutput"><span class="identifier">complement</span><span class="special">(...)</span></code>的调用之中 。
+ +</li><li>静态成员函数允许使用其它信息来查找分布的参数。 </li></ul></div> +<p>现在你了解了所有的基本信息,下一部分查看一些可运行的例子。</p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tbody><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></tbody></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="parameters.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../overview.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../weg.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body></html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/dist/stat_tut/weg/c_sharp.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,58 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Using the Distributions from Within C#</title>+<link rel="stylesheet" href="../../../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../../../index.html" title="Math Toolkit"> +<link rel="up" href="../weg.html" title="Worked Examples">+<link rel="prev" href="nag_library.html" title="Comparison with C, R, FORTRAN-style Free Functions"> +<link rel="next" href="../variates.html" title="Random Variates and Distribution Parameters">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../../boost.png"></td> +<td align="center"><a href="../../../../../../../../../index.html">Home</a></td> +<td align="center"><a href="../../../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="nag_library.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../weg.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../variates.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h5 class="title">+<a name="math_toolkit.dist.stat_tut.weg.c_sharp"></a><a class="link" href="c_sharp.html" title="Using the Distributions from Within C#"> Using the
+ Distributions from Within C#</a> +</h5></div></div></div> +<p>+ The distributions in this library can be used from the C# programming + language when they are built using Microsofts Common Language Runtime
+ option. + </p> +<p>+ An example of this kind of usage is given in the <a href="../../../../../../distexplorer/html/index.html" target="_top">distribution_explorer</a> + example: see <code class="literal">boost-root/libs/math/dot_net_example</code> + for the source code: the application consists of a C++ dll that contains + the actual distributions, and a C# GUI that allows you to explore their
+ properties. + </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="nag_library.html"><img src="../../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../weg.html"><img src="../../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="../variates.html"><img src="../../../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/extern_c.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,51 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>TR1 and C99 external "C" Functions</title>+<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<link rel="start" href="../../index.html" title="Math Toolkit"> +<link rel="up" href="../special.html" title="Special Functions">+<link rel="prev" href="next_float/float_advance.html" title="Advancing a Floating Point Value by a Specific Representation Distance (ULP) float_advance"> +<link rel="next" href="extern_c/tr1.html" title="C99 and TR1 C Functions Overview">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="next_float/float_advance.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="extern_c/tr1.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div> + <h3 class="title">+<a name="math_toolkit.special.extern_c"></a><a href="extern_c.html" title='TR1 and C99 external "C" Functions'> TR1 和 C99 中的 外部"C" 函数</a>
+</h3> +</div></div></div> +<div class="toc"><dl>+<dt><span class="section"><a href="extern_c/tr1.html"> C99中TR1中的C函数概 览</a></span></dt> +<dt><span class="section"><a href="extern_c/c99.html"> C99中的C函数 </a></span></dt> +<dt><span class="section"><a href="extern_c/tr1_ref.html"> TR1中的C函数快速 参考</a></span></dt>
+</dl></div> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
+ Holin, Xiaogang Zhang and Bruno Lalande<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="next_float/float_advance.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="extern_c/tr1.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/main_overview/building.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,156 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>If and How to Build the Library and its Examples and Tests</title>+<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../index.html" title="Math Toolkit"> +<link rel="up" href="../main_overview.html" title="Overview"> +<link rel="prev" href="perf_over.html" title="Performance"> +<link rel="next" href="history1.html" title="History and What's New"> +</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="perf_over.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../main_overview.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="history1.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h3 class="title">+<a name="math_toolkit.main_overview.building"></a><a class="link" href="building.html" title="If and How to Build the Library and its Examples and Tests"> If and How to Build
+ the Library and its Examples and Tests</a> +</h3></div></div></div> +<a name="math_toolkit.main_overview.building.building_the_library"></a><h5> +<a name="id662842"></a>+ <a class="link" href="building.html#math_toolkit.main_overview.building.building_the_library">Building
+ the Library</a> + </h5> +<p>+ The first thing you need to ask yourself is "Do I need to build anything + at all?" as the bulk of this library is header only: meaning you can + use it just by #including the necessary header(s). Refer to <a class="link" href="../extern_c.html" title='TR1 and C99 external "C" Functions'>C99 + and C++ TR1 C-style Functions</a> for pros and cons of using the TR1 components
+ as opposed to the header only ones. + </p> +<p>+ The <span class="emphasis"><em>only</em></span> time you <span class="emphasis"><em>need</em></span> to build + the library is if you want to use the <code class="computeroutput"><span class="keyword">extern</span>
+ <span class="string">"C"</span></code> functions declared in+ <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">tr1</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code>. To build this using Boost.Build, from
+ a commandline boost-root directory issue a command like: + </p>+<pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">gcc</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">math</span> <span class="identifier">install</span>
+</pre> +<p> + will do the job on Linux, while: + </p>+<pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">msvc</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">math</span> <span class="special">--</span><span class="identifier">build</span><span class="special">-</span><span class="identifier">type</span><span class="special">=</span><span class="identifier">complete</span> <span class="identifier">stage</span>
+</pre> +<p>+ will work better on Windows (leaving libraries built in sub-folder <code class="computeroutput"><span class="special">/</span><span class="identifier">stage</span></code> + below your Boost root directory). Either way you should consult the <a href="http://www.boost.org/doc/libs/release/more/getting_started/index.html"; target="_top">getting
+ started guide</a> for more information. + </p> +<p>+ You can also build the libraries from your favourite IDE or command line + tool: each <code class="computeroutput"><span class="keyword">extern</span> <span class="string">"C"</span></code> + function declared in <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">tr1</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> has its own source file with the same + name in <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">src</span><span class="special">/</span><span class="identifier">tr1</span></code>. Just + select the sources corresponding to the functions you are using and build + them into a library, or else add them directly to your project. Note that + the directory <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">src</span><span class="special">/</span><span class="identifier">tr1</span></code> will + need to be in your compiler's #include path as well as the boost-root directory + (MSVC Tools, Options, Projects and Solutions, VC++ Directories, Include files).
+ </p> +<div class="note"><table border="0" summary="Note"> +<tr>+<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../../../../doc/html/images/note.png"></td>
+<th align="left">Note</th> +</tr> +<tr><td align="left" valign="top"><p>+ If you are using a Windows compiler that supports auto-linking and you + have built the sources yourself (or added them directly to your project) + then you will need to prevent <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">tr1</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> + from trying to auto-link to the binaries that Boost.Build generates. You + can do this by defining either BOOST_MATH_NO_LIB or BOOST_ALL_NO_LIB at + project level (so the defines get passed to each compiler invocation).
+ </p></td></tr> +</table></div> +<p>+ Optionally the sources in <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">src</span><span class="special">/</span><span class="identifier">tr1</span></code> + have support for using <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">src</span><span class="special">/</span><span class="identifier">tr1</span><span class="special">/</span><span class="identifier">pch</span><span class="special">.</span><span class="identifier">hpp</span></code> as a precompiled header <span class="emphasis"><em>if + your compiler supports precompiled headers.</em></span> Note that normally + this header is a do-nothing include: to activate the header so that it #includes + everything required by all the sources you will need to define BOOST_BUILD_PCH_ENABLED + on the command line, both when building the pre-compiled header and when + building the sources. Boost.Build will do this automatically when appropriate.
+ </p>+<a name="math_toolkit.main_overview.building.building_the_examples"></a><h5>
+<a name="id663287"></a>+ <a class="link" href="building.html#math_toolkit.main_overview.building.building_the_examples">Building
+ the Examples</a> + </h5> +<p>+ The examples are all located in <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">example</span></code>, they can all be built without + reference to any external libraries, either with Boost.Build using the supplied + Jamfile, or from your compiler's command line. The only requirement is that
+ the Boost headers are in your compilers #include search path. + </p> +<a name="math_toolkit.main_overview.building.building_the_tests"></a><h5> +<a name="id663328"></a>+ <a class="link" href="building.html#math_toolkit.main_overview.building.building_the_tests">Building
+ the Tests</a> + </h5> +<p>+ The tests are located in <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">test</span></code> and are best built using Boost.Build + and the supplied Jamfile. If you plan to build them separately from your + favourite IDE then you will need to add <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">test</span></code> to the list of your compiler's search
+ paths. + </p> +<p>+ You will also need to build and link to the Boost.Regex library for many + of the tests: this can built from the command line by following the <a href="http://www.boost.org/doc/libs/release/more/getting_started/index.html"; target="_top">getting
+ started guide</a>, using a command such as: + </p>+<pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">gcc</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">regex</span> <span class="identifier">install</span>
+</pre> +<p> + or + </p>+<pre class="programlisting"><span class="identifier">bjam</span> <span class="identifier">toolset</span><span class="special">=</span><span class="identifier">msvc</span> <span class="special">--</span><span class="identifier">with</span><span class="special">-</span><span class="identifier">regex</span> <span class="special">--</span><span class="identifier">build</span><span class="special">-</span><span class="identifier">type</span><span class="special">=</span><span class="identifier">complete</span> <span class="identifier">stage</span>
+</pre> +<p> + depending on whether you are on Linux or Windows. + </p> +<p>+ Many of the tests have optional precompiled header support using the header + <code class="computeroutput"><span class="identifier">libs</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">test</span><span class="special">/</span><span class="identifier">pch</span><span class="special">.</span><span class="identifier">hpp</span></code>. Note that normally this header is + a do-nothing include: to activate the header so that it #includes everything + required by all the sources you will need to define BOOST_BUILD_PCH_ENABLED + on the command line, both when building the pre-compiled header and when + building the sources. Boost.Build will do this automatically when appropriate.
+ </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="perf_over.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../main_overview.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="history1.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/using_udt/use_mpfr.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,90 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">+<title>Using With MPFR / GMP - a High-Precision Floating-Point Library</title> +<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../index.html" title="Math Toolkit">+<link rel="up" href="../using_udt.html" title="Use with User-Defined Floating-Point Types"> +<link rel="prev" href="use_ntl.html" title="Using With NTL - a High-Precision Floating-Point Library"> +<link rel="next" href="concepts.html" title="Conceptual Requirements for Real Number Types">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="use_ntl.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../using_udt.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h3 class="title">+<a name="math_toolkit.using_udt.use_mpfr"></a><a class="link" href="use_mpfr.html" title="Using With MPFR / GMP - a High-Precision Floating-Point Library"> Using With MPFR / GMP
+ - a High-Precision Floating-Point Library</a> +</h3></div></div></div> +<p>+ The special functions and tools in this library can be used with <a href="http://www.mpfr.org"; target="_top">MPFR + (an arbitrary precision number type based on the GMP library)</a>, via + the bindings in <a href="../../../../../../../boost/math/bindings/mpfr.hpp" target="_top">boost/math/bindings/mpfr.hpp</a>.
+ </p> +<p>+ In order to use these binings you will need to have installed <a href="http://www.mpfr.org"; target="_top">MPFR</a> + plus it's dependency the <a href="http://gmplib.org"; target="_top">GMP library</a> + and the C++ wrapper for MPFR known as <a href="http://math.berkeley.edu/~wilken/code/gmpfrxx/"; target="_top">gmpfrxx
+ (or mpfr_class)</a>. + </p> +<p>+ Unfortunately <code class="computeroutput"><span class="identifier">mpfr_class</span></code> + doesn't quite satisfy our conceptual requirements, so there is a very thin + set of additional interfaces and some helper traits defined in <a href="../../../../../../../boost/math/bindings/mpfr.hpp" target="_top">boost/math/bindings/mpfr.hpp</a> + that you should use in place of including 'gmpfrxx.h' directly. The existing + mpfr_class is then usable unchanged once this header is included, so it's + performance-enhancing expression templates are preserved and fully supported
+ by this library: + </p>+<pre class="programlisting"><span class="preprocessor">#include</span> <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">bindings</span><span class="special">/</span><span class="identifier">mpfr</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span> +<span class="preprocessor">#include</span> <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">special_functions</span><span class="special">/</span><span class="identifier">gamma</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
++<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
+<span class="special">{</span>+ <span class="identifier">mpfr_class</span><span class="special">::</span><span class="identifier">set_dprec</span><span class="special">(</span><span class="number">500</span><span class="special">);</span> <span class="comment">// 500 bit precision
+</span> <span class="comment">//+</span> <span class="comment">// Note that the argument to tgamma is an expression template,
+</span> <span class="comment">// that's just fine here: +</span> <span class="comment">//+</span> <span class="identifier">mpfr_class</span> <span class="identifier">v</span> <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">tgamma</span><span class="special">(</span><span class="identifier">sqrt</span><span class="special">(</span><span class="identifier">mpfr_class</span><span class="special">(</span><span class="number">2</span><span class="special">)));</span> + <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">setprecision</span><span class="special">(</span><span class="number">50</span><span class="special">)</span> <span class="special"><<</span> <span class="identifier">v</span> <span class="special"><<</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="special">}</span> +</pre> +<p>+ For those functions that are based upon the <a class="link" href="../backgrounders/lanczos.html" title="The Lanczos Approximation">Lanczos + approximation</a>, the bindings defines a series of approximations with + up to 61 terms and accuracy up to approximately 3e-113. This therefore sets + the upper limit for accuracy to the majority of functions defined this library + when used with <code class="computeroutput"><span class="identifier">mpfr_class</span></code>.
+ </p> +<p>+ There is a concept checking test program for mpfr support <a href="../../../../../../../libs/math/test/mpfr_concept_check.cpp" target="_top">here</a>.
+ </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="use_ntl.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../using_udt.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="concepts.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/fpclass.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,221 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>Floating-Point Classification: Infinities and NaN's</title>+<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<link rel="start" href="../../index.html" title="Math Toolkit"> +<link rel="up" href="../special.html" title="Special Functions">+<link rel="prev" href="rounding/modf.html" title="Integer and Fractional Part Splitting (modf)"> +<link rel="next" href="next_float.html" title="Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="rounding/modf.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div> + <h3 class="title">+<a name="math_toolkit.special.fpclass"></a><a href="fpclass.html" title="Floating-Point Classification: Infinities and NaN's"> 浮点数分类:
+ 无限数和非数字(Infinities and NaN's)</a> +</h3> +</div></div></div> +<a name="math_toolkit.special.fpclass.synopsis"></a> +<h5> +<a name="id740192"></a>+ <a href="fpclass.html#math_toolkit.special.fpclass.synopsis">概要 </a></h5> +<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">FP_ZERO</span> <span class="comment">/* 依据 实现特定的值 */</span> +<span class="preprocessor">#define</span> <span class="identifier">FP_NORMAL</span> <span class="comment">/* 依据实现特 定的值 */</span> +<span class="preprocessor">#define</span> <span class="identifier">FP_INFINITE</span> <span class="comment">/* 依据实现特 定的值 */</span> +<span class="preprocessor">#define</span> <span class="identifier">FP_NAN</span> <span class="comment">/* 依据实现特 定的值 */</span> +<span class="preprocessor">#define</span> <span class="identifier">FP_SUBNORMAL</span> <span class="comment">/* 依据实现特 定的值 */</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">int</span> <span class="identifier">fpclassify</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isfinite</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">z</span><span class="special">);</span> <span class="comment">// 既不是无限数又不是 NaN(Not a Number : 不是一个数字).
+</span>+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isinf</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span> <span class="comment">// 无限数 (+ 或 -).
+</span>+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isnan</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span> <span class="comment">// NaN.
+</span>+<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isnormal</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span> <span class="comment">// 有限的并且是规格化的.
+ +包含头文件 +</span>+<span class="preprocessor">#include</span> <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">special_functions</span><span class="special">\</span><span class="identifier">fpclassify</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<p> + 来使用这些函数</p> +<a name="math_toolkit.special.fpclass.description"></a> +<h5> +<a name="id740726"></a>+ <a href="fpclass.html#math_toolkit.special.fpclass.description">描 述</a>
+ </h5> +<p>+ 这些函数与C99中的同名宏提供相同的功能,实际上,如果C99中的宏是可用 的,那么这些函数就使用这些宏来实现。 否则的话这些函数依赖于 std::numeric_limits<>。</p>
+<p>+ 注意:在那些已经以宏的形式提供这些函数的平台上,这些函数的定义并没 有覆盖(suppress:抑制)由头文件<span class="emphasis"><em>math.h</em></span>以 宏的形式定义的这些名字。这意味着下面的代码具有不同的含义:
+ </p>+<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">;</span>
+ +<span class="comment">//如果定义了的话,那么下面的代码可能会调用一个全局宏+</span><span class="comment">//但是如果类型Z没有得到标准库中的的支持,那么 下面的代码可能无法编译 +</span><span class="identifier">isnan</span><span class="special">(</span><span class="identifier">z</span><span class="special">);</span>
+<span class="comment">// +</span><span class="comment">// 下面的代码调用Boost版本的isnan +</span><span class="comment">// (通过"using namespace boost::math"来找到)+</span><span class="comment">// 对于任何具有numeric_limits支持的任何类型 Z,Boost版本的isnan都可以正常工作: +</span><span class="special">(</span><span class="identifier">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">);</span>
+<span class="comment">// +</span><span class="comment">// 和上面一样,但是使用了名字空间限定.+</span><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">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">);</span>
+<span class="comment">//+</span><span class="comment">// 如果isnan是一个本地宏,那么下面的代码将会导 致一个编译错误: +</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">isnan</span><span class="special">(</span><span class="identifier">z</span><span class="special">);</span>
+<span class="comment">//所以请一直使用下面的形式:+</span><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">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">);</span>
+<span class="comment">//+</span><span class="comment">// 你也可以使用一个.cpp文件中使用一个全局的 using声明, +</span><span class="comment">// 也可以在一个.hpp文件中的函数中使用一个局部 的using声明. +</span><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">isnan</span><span class="special">;</span>
+<span class="comment">// 那么你的代码可以写得理简短也更整洁一些+</span><span class="special">(</span><span class="identifier">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">)</span> +<span class="comment">// 但是与上面一样,如果 isnan 是一个本地宏,那么上面的 代码会产生一个编译错误 +</span><span class="comment">// 因为宏永远最先获得这个名字, 除非包含在一对 ()里面。</span></pre>
+<p> + 这些函数的详细描述如下: + </p>+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">int</span> <span class="identifier">fpclassify</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
+</pre> +<p> + 返回一个将<span class="emphasis"><em>t</em></span>的值分类的整数: + </p> +<div class="informaltable"><table class="table"> +<colgroup> +<col> +<col> +</colgroup> +<thead><tr> +<th> + <p> + fp 的分类值 </p> + </th> +<th> + <p> + t的类别. + </p> + </th> +</tr></thead> +<tbody> +<tr> +<td> + <p> + FP_ZERO + </p> + </td> +<td> + <p> + 如果<span class="emphasis"><em> t</em></span> 的值为0. + </p> + </td> +</tr> +<tr> +<td> + <p> + FP_NORMAL + </p> + </td> +<td> + <p>+ 如果 <span class="emphasis"><em>t</em></span> 是非零的, 并且 是规范化的有限值</p>
+ </td> +</tr> +<tr> +<td> + <p> + FP_INFINITE + </p> + </td> +<td> + <p>+ 如果 <span class="emphasis"><em>t</em></span> 是正无穷或是 负无穷</p>
+ </td> +</tr> +<tr> +<td> + <p> + FP_NAN + </p> + </td> +<td> + <p>+ 如果 <span class="emphasis"><em>t</em></span> 是一个 NaN(Not a Number)</p>
+ </td> +</tr> +<tr> +<td> + <p> + FP_SUBNORMAL + </p> + </td> +<td>+ <p> 如果 <span class="emphasis"><em>t</em></span> 是一个非规范化的数字 </p>
+ </td> +</tr> +</tbody> +</table></div>+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isfinite</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">z</span><span class="special">);</span>
+</pre> +<p>+ 仅当<span class="emphasis"><em>z</em></span> 的值不是无穷的且不是 NaN是才返回true.
+ </p>+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isinf</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
+</pre> +<p>+ 仅当<span class="emphasis"><em>z</em></span> 的值是下无穷或是负无穷 时才返回true.
+ </p>+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isnan</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
+</pre>+<p> 仅当 <span class="emphasis"><em>z</em></span> 的值是<a href="http://en.wikipedia.org/wiki/NaN"; target="_top">NaN</a> 才返回true.
+ </p>+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">bool</span> <span class="identifier">isnormal</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
+</pre> +<p>+ 仅当<span class="emphasis"><em>z</em></span> 是一个常规的数字 (非 零,
+ 非无限, 非NaN, 或是规范化的)时才返回true. + </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
+ Holin, Xiaogang Zhang and Bruno Lalande<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="rounding/modf.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/next_float.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,69 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">+<title>Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values</title> +<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<link rel="start" href="../../index.html" title="Math Toolkit"> +<link rel="up" href="../special.html" title="Special Functions">+<link rel="prev" href="fpclass.html" title="Floating-Point Classification: Infinities and NaN's"> +<link rel="next" href="next_float/nextafter.html" title="Finding the Next Representable Value in a Specific Direction (nextafter)">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="fpclass.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float/nextafter.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div> + <h3 class="title">+<a name="math_toolkit.special.next_float"></a><a href="next_float.html" title="Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values"> 浮点表示距离 (ULP), 以及查找邻近的浮点值 </a>
+</h3> +</div></div></div> +<div class="toc"><dl>+<dt><span class="section"><a href="next_float/nextafter.html"> 在一个特定的 方向上查找下一个可以表示的浮点值 (nextafter)</a></span></dt> +<dt><span class="section"><a href="next_float/float_next.html"> 查找下一个 查找的浮点值 (float_next)</a></span></dt> +<dt><span class="section"><a href="next_float/float_prior.html"> 查找下一个 查找的浮点值 (float_prior)</a></span></dt> +<dt><span class="section"><a href="next_float/float_distance.html"> 计算两 个浮点数之间的浮点距离 (ULP) </a></span></dt> +<dt><span class="section"><a href="next_float/float_advance.html"> 将一个浮 点值增加一个特定的浮点距离 (ULP)</a></span></dt>
+</dl></div> +<p>+ <a href="http://en.wikipedia.org/wiki/Unit_in_the_last_place"; target="_top">最小精度单元或上一个位置单元</a> 是两个不同的,但是尽可能接近 的浮点值的间隙</p>
+<p>+ 大多数的十进制值, 例如 0.1, 无法由浮点数精确的表示, 但是将会由最邻 近的可表示的浮点值来存储.
+ </p> +<p>+ 这些函数用于查找邻近的较大的或较小的浮点值, 以及估算任意两个浮点数 之间的间隔的个数.
+ </p> +<p> + 浮点类型FPT的表示中必须有固定的比特位数.+ 具体的比特数个数可以在运行时设定, 但是比特的个数对于所有的浮点数必 须是一样的.例如, <a href="http://shoup.net/ntl/doc/quad_float.txt"; target="_top">NTL::quad_float</a> + 类型 (固定的 128-bit 表示) 或者 <a href="http://shoup.net/ntl/doc/RR.txt"; target="_top">NTL::RR</a> + 类型 (任意的比特数 但是具有固定的十进制数字, 缺省为 150) 但 <span class="bold"><strong>不是</strong></span> + 一个为了精确的描述任意数字而扩展浮点表示的类型, 例如<a href="http://keithbriggs.info/xrc.html"; target="_top">XRC
+ eXact Real in C</a>. + </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
+ Holin, Xiaogang Zhang and Bruno Lalande<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="fpclass.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float/nextafter.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/rounding.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,51 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>Rounding Truncation and Integer Conversion</title>+<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> +<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
+<link rel="start" href="../../index.html" title="Math Toolkit"> +<link rel="up" href="../special.html" title="Special Functions"> +<link rel="prev" href="inv_hyper/atanh.html" title="atanh"> +<link rel="next" href="rounding/round.html" title="Rounding Functions"> +</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="inv_hyper/atanh.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="rounding/round.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div> + <h3 class="title">+<a name="math_toolkit.special.rounding"></a><a href="rounding.html" title="Rounding Truncation and Integer Conversion"> 舍入截断和整数转换 </a>
+</h3> +</div></div></div> +<div class="toc"><dl>+<dt><span class="section"><a href="rounding/round.html"> 舍入函数 </a></span></dt> +<dt><span class="section"><a href="rounding/trunc.html"> 截断函数 </a></span></dt> +<dt><span class="section"><a href="rounding/modf.html"> 整数部分和小数部分 切分 (modf函数)</a></span></dt>
+</dl></div> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
+ Holin, Xiaogang Zhang and Bruno Lalande<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="inv_hyper/atanh.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="rounding/round.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils/sign_functions.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,98 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Sign Manipulation Functions</title>+<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../../index.html" title="Math Toolkit"> +<link rel="up" href="../utils.html" title="Floating Point Utilities">+<link rel="prev" href="fpclass.html" title="Floating-Point Classification: Infinities and NaN's"> +<link rel="next" href="next_float.html" title="Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> +<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
+</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="fpclass.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../utils.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h3 class="title">+<a name="math_toolkit.utils.sign_functions"></a><a class="link" href="sign_functions.html" title="Sign Manipulation Functions"> Sign Manipulation
+ Functions</a> +</h3></div></div></div> +<a name="math_toolkit.utils.sign_functions.synopsis"></a><h5> +<a name="id904917"></a>+ <a class="link" href="sign_functions.html#math_toolkit.utils.sign_functions.synopsis">Synopsis</a>
+ </h5> +<p> + +</p>+<pre class="programlisting"><span class="preprocessor">#include</span> <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">special_functions</span><span class="special">/</span><span class="identifier">sign</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
+</pre> +<p> + </p>+<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">{</span> <span class="keyword">namespace</span> <span class="identifier">math</span><span class="special">{</span>
++<span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">int</span> <span class="identifier">signbit</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">);</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">inline</span> <span class="keyword">int</span> <span class="identifier">sign</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">z</span><span class="special">);</span>
++<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">inline</span> <span class="identifier">T</span> <span class="identifier">copysign</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">y</span><span class="special">);</span>
+ +<span class="special">}}</span> <span class="comment">// namespaces +</span></pre> +<a name="math_toolkit.utils.sign_functions.description"></a><h5> +<a name="id905211"></a>+ <a class="link" href="sign_functions.html#math_toolkit.utils.sign_functions.description">Description</a>
+ </h5>+<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">int</span> <span class="identifier">signbit</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">x</span><span class="special">);</span>
+</pre> +<p>+ Returns a non-zero value if the sign bit is set in variable <span class="emphasis"><em>x</em></span>, + otherwise <code class="computeroutput"><span class="number">0</span></code>.
+ </p>+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">inline</span> <span class="keyword">int</span> <span class="identifier">sign</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">z</span><span class="special">);</span>
+</pre> +<p>+ Returns <code class="computeroutput"><span class="number">1</span></code> if <code class="computeroutput"><span class="identifier">x</span> + <span class="special">></span> <span class="number">0</span></code>, + <code class="computeroutput"><span class="special">-</span><span class="number">1</span></code> + if <code class="computeroutput"><span class="identifier">x</span> <span class="special"><</span> + <span class="number">0</span></code>, and <code class="computeroutput"><span class="number">0</span></code>
+ if x is zero. + </p>+<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> +<span class="keyword">inline</span> <span class="identifier">T</span> <span class="identifier">copysign</span> <span class="special">(</span><span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <span class="identifier">T</span><span class="special">&</span> <span class="identifier">y</span><span class="special">);</span>
+</pre> +<p>+ Sets the sign of <span class="emphasis"><em>x</em></span> to be the same as the sign of <span class="emphasis"><em>y</em></span>.
+ </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="fpclass.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../utils.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/utils.html Wed Sep 9 20:09:56 2009
@@ -0,0 +1,75 @@ +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> +<title>Floating Point Utilities</title>+<link rel="stylesheet" href="../../../../../../doc/html/boostbook.css" type="text/css">
+<meta name="generator" content="DocBook XSL Stylesheets V1.74.0"> +<link rel="home" href="../index.html" title="Math Toolkit"> +<link rel="up" href="../index.html" title="Math Toolkit"> +<link rel="prev" href="special/inv_hyper/atanh.html" title="atanh">+<link rel="next" href="utils/rounding.html" title="Rounding Truncation and Integer Conversion">
+</head>+<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
+<table cellpadding="2" width="100%"><tr>+<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
+<td align="center"><a href="../../../../../../index.html">Home</a></td>+<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> +<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> +<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td>
+<td align="center"><a href="../../../../../../more/index.htm">More</a></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="special/inv_hyper/atanh.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="utils/rounding.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +<div class="section" lang="en"> +<div class="titlepage"><div><div><h2 class="title" style="clear: both">+<a name="math_toolkit.utils"></a><a class="link" href="utils.html" title="Floating Point Utilities"> Floating Point Utilities</a>
+</h2></div></div></div> +<div class="toc"><dl>+<dt><span class="section"><a href="utils/rounding.html"> Rounding Truncation and
+ Integer Conversion</a></span></dt> +<dd><dl>+<dt><span class="section"><a href="utils/rounding/round.html"> Rounding Functions</a></span></dt> +<dt><span class="section"><a href="utils/rounding/trunc.html"> Truncation Functions</a></span></dt> +<dt><span class="section"><a href="utils/rounding/modf.html"> Integer and Fractional
+ Part Splitting (modf)</a></span></dt> +</dl></dd>+<dt><span class="section"><a href="utils/fpclass.html"> Floating-Point Classification:
+ Infinities and NaN's</a></span></dt>+<dt><span class="section"><a href="utils/sign_functions.html"> Sign Manipulation
+ Functions</a></span></dt>+<dt><span class="section"><a href="utils/next_float.html"> Floating-Point Representation + Distance (ULP), and Finding Adjacent Floating-Point Values</a></span></dt>
+<dd><dl>+<dt><span class="section"><a href="utils/next_float/nextafter.html"> Finding the + Next Representable Value in a Specific Direction (nextafter)</a></span></dt> +<dt><span class="section"><a href="utils/next_float/float_next.html"> Finding
+ the Next Greater Representable Value (float_next)</a></span></dt>+<dt><span class="section"><a href="utils/next_float/float_prior.html"> Finding
+ the Next Smaller Representable Value (float_prior)</a></span></dt>+<dt><span class="section"><a href="utils/next_float/float_distance.html"> Calculating + the Representation Distance Between Two Floating Point Values (ULP) float_distance</a></span></dt> +<dt><span class="section"><a href="utils/next_float/float_advance.html"> Advancing + a Floating Point Value by a Specific Representation Distance (ULP) float_advance</a></span></dt>
+</dl></dd> +</dl></div> +<p> + </p> +</div>+<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
+<td align="left"></td>+<td align="right"><div class="copyright-footer">Copyright © 2006 , 2007, 2008, 2009 John Maddock, Paul A. Bristow, + Hubert Holin, Xiaogang Zhang, Bruno Lalande, Johan Råde, Gautam Sewani
+ and Thijs van den Berg<p>+ Distributed under the Boost Software License, Version 1.0. (See accompanying + 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>)
+ </p> +</div></td> +</tr></table> +<hr> +<div class="spirit-nav">+<a accesskey="p" href="special/inv_hyper/atanh.html"><img src="../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../index.html"><img src="../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="utils/rounding.html"><img src="../../../../../../doc/html/images/next.png" alt="Next"></a>
+</div> +</body> +</html> ======================================= --- /dev/null+++ /trunk/libs/math/dot_net_example/distribution_explorer/boost.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. =======================================--- /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/extern_c.html Sat Dec 6 05:06:05 2008
+++ /dev/null @@ -1,51 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<title>TR1 and C99 external "C" Functions</title>-<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
-<link rel="start" href="../../index.html" title="Math Toolkit"> -<link rel="up" href="../special.html" title="Special Functions">-<link rel="prev" href="next_float/float_advance.html" title="Advancing a Floating Point Value by a Specific Representation Distance (ULP) float_advance"> -<link rel="next" href="extern_c/tr1.html" title="C99 and TR1 C Functions Overview">
-</head>-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
-<td align="center"><a href="../../../../../../../index.html">Home</a></td>-<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> -<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> -<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> -<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
-</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="next_float/float_advance.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="extern_c/tr1.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div> - <h3 class="title">-<a name="math_toolkit.special.extern_c"></a><a href="extern_c.html" title='TR1 and C99 external "C" Functions'> TR1 和 C99 中的 外部"C" 函数</a>
-</h3> -</div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="extern_c/tr1.html"> C99中TR1中的C函数概 览</a></span></dt> -<dt><span class="section"><a href="extern_c/c99.html"> C99中的C函数 </a></span></dt> -<dt><span class="section"><a href="extern_c/tr1_ref.html"> TR1中的C函数快速 参考</a></span></dt>
-</dl></div> -</div>-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
-<td align="left"></td>-<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
- Holin, Xiaogang Zhang and Bruno Lalande<p>- Distributed under the Boost Software License, Version 1.0. (See accompanying - 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>)
- </p> -</div></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="next_float/float_advance.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="extern_c/tr1.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -</body> -</html> =======================================--- /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/fpclass.html Sat Dec 6 05:06:05 2008
+++ /dev/null @@ -1,221 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<title>Floating-Point Classification: Infinities and NaN's</title>-<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
-<link rel="start" href="../../index.html" title="Math Toolkit"> -<link rel="up" href="../special.html" title="Special Functions">-<link rel="prev" href="rounding/modf.html" title="Integer and Fractional Part Splitting (modf)"> -<link rel="next" href="next_float.html" title="Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values">
-</head>-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
-<td align="center"><a href="../../../../../../../index.html">Home</a></td>-<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> -<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> -<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> -<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
-</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="rounding/modf.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div> - <h3 class="title">-<a name="math_toolkit.special.fpclass"></a><a href="fpclass.html" title="Floating-Point Classification: Infinities and NaN's"> 浮点数分类:
- 无限数和非数字(Infinities and NaN's)</a> -</h3> -</div></div></div> -<a name="math_toolkit.special.fpclass.synopsis"></a> -<h5> -<a name="id740192"></a>- <a href="fpclass.html#math_toolkit.special.fpclass.synopsis">概要 </a></h5> -<pre class="programlisting"><span class="preprocessor">#define</span> <span class="identifier">FP_ZERO</span> <span class="comment">/* 依据 实现特定的值 */</span> -<span class="preprocessor">#define</span> <span class="identifier">FP_NORMAL</span> <span class="comment">/* 依据实现特 定的值 */</span> -<span class="preprocessor">#define</span> <span class="identifier">FP_INFINITE</span> <span class="comment">/* 依据实现特 定的值 */</span> -<span class="preprocessor">#define</span> <span class="identifier">FP_NAN</span> <span class="comment">/* 依据实现特 定的值 */</span> -<span class="preprocessor">#define</span> <span class="identifier">FP_SUBNORMAL</span> <span class="comment">/* 依据实现特 定的值 */</span>
--<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">int</span> <span class="identifier">fpclassify</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
--<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isfinite</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">z</span><span class="special">);</span> <span class="comment">// 既不是无限数又不是 NaN(Not a Number : 不是一个数字).
-</span>-<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isinf</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span> <span class="comment">// 无限数 (+ 或 -).
-</span>-<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isnan</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span> <span class="comment">// NaN.
-</span>-<span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isnormal</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span> <span class="comment">// 有限的并且是规格化的.
- -包含头文件 -</span>-<span class="preprocessor">#include</span> <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">special_functions</span><span class="special">\</span><span class="identifier">fpclassify</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
-</pre> -<p> - 来使用这些函数</p> -<a name="math_toolkit.special.fpclass.description"></a> -<h5> -<a name="id740726"></a>- <a href="fpclass.html#math_toolkit.special.fpclass.description">描 述</a>
- </h5> -<p>- 这些函数与C99中的同名宏提供相同的功能,实际上,如果C99中的宏是可用 的,那么这些函数就使用这些宏来实现。 否则的话这些函数依赖于 std::numeric_limits<>。</p>
-<p>- 注意:在那些已经以宏的形式提供这些函数的平台上,这些函数的定义并没 有覆盖(suppress:抑制)由头文件<span class="emphasis"><em>math.h</em></span>以 宏的形式定义的这些名字。这意味着下面的代码具有不同的含义:
- </p>-<pre class="programlisting"><span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">;</span>
- -<span class="comment">//如果定义了的话,那么下面的代码可能会调用一个全局宏-</span><span class="comment">//但是如果类型Z没有得到标准库中的的支持,那么 下面的代码可能无法编译 -</span><span class="identifier">isnan</span><span class="special">(</span><span class="identifier">z</span><span class="special">);</span>
-<span class="comment">// -</span><span class="comment">// 下面的代码调用Boost版本的isnan -</span><span class="comment">// (通过"using namespace boost::math"来找到)-</span><span class="comment">// 对于任何具有numeric_limits支持的任何类型 Z,Boost版本的isnan都可以正常工作: -</span><span class="special">(</span><span class="identifier">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">);</span>
-<span class="comment">// -</span><span class="comment">// 和上面一样,但是使用了名字空间限定.-</span><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">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">);</span>
-<span class="comment">//-</span><span class="comment">// 如果isnan是一个本地宏,那么下面的代码将会导 致一个编译错误: -</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">math</span><span class="special">::</span><span class="identifier">isnan</span><span class="special">(</span><span class="identifier">z</span><span class="special">);</span>
-<span class="comment">//所以请一直使用下面的形式:-</span><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">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">);</span>
-<span class="comment">//-</span><span class="comment">// 你也可以使用一个.cpp文件中使用一个全局的 using声明, -</span><span class="comment">// 也可以在一个.hpp文件中的函数中使用一个局部 的using声明. -</span><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">isnan</span><span class="special">;</span>
-<span class="comment">// 那么你的代码可以写得理简短也更整洁一些-</span><span class="special">(</span><span class="identifier">isnan</span><span class="special">)(</span><span class="identifier">z</span><span class="special">)</span> -<span class="comment">// 但是与上面一样,如果 isnan 是一个本地宏,那么上面的 代码会产生一个编译错误 -</span><span class="comment">// 因为宏永远最先获得这个名字, 除非包含在一对 ()里面。</span></pre>
-<p> - 这些函数的详细描述如下: - </p>-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">int</span> <span class="identifier">fpclassify</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
-</pre> -<p> - 返回一个将<span class="emphasis"><em>t</em></span>的值分类的整数: - </p> -<div class="informaltable"><table class="table"> -<colgroup> -<col> -<col> -</colgroup> -<thead><tr> -<th> - <p> - fp 的分类值 </p> - </th> -<th> - <p> - t的类别. - </p> - </th> -</tr></thead> -<tbody> -<tr> -<td> - <p> - FP_ZERO - </p> - </td> -<td> - <p> - 如果<span class="emphasis"><em> t</em></span> 的值为0. - </p> - </td> -</tr> -<tr> -<td> - <p> - FP_NORMAL - </p> - </td> -<td> - <p>- 如果 <span class="emphasis"><em>t</em></span> 是非零的, 并且 是规范化的有限值</p>
- </td> -</tr> -<tr> -<td> - <p> - FP_INFINITE - </p> - </td> -<td> - <p>- 如果 <span class="emphasis"><em>t</em></span> 是正无穷或是 负无穷</p>
- </td> -</tr> -<tr> -<td> - <p> - FP_NAN - </p> - </td> -<td> - <p>- 如果 <span class="emphasis"><em>t</em></span> 是一个 NaN(Not a Number)</p>
- </td> -</tr> -<tr> -<td> - <p> - FP_SUBNORMAL - </p> - </td> -<td>- <p> 如果 <span class="emphasis"><em>t</em></span> 是一个非规范化的数字 </p>
- </td> -</tr> -</tbody> -</table></div>-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isfinite</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">z</span><span class="special">);</span>
-</pre> -<p>- 仅当<span class="emphasis"><em>z</em></span> 的值不是无穷的且不是 NaN是才返回true.
- </p>-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isinf</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
-</pre> -<p>- 仅当<span class="emphasis"><em>z</em></span> 的值是下无穷或是负无穷 时才返回true.
- </p>-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isnan</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
-</pre>-<p> 仅当 <span class="emphasis"><em>z</em></span> 的值是<a href="http://en.wikipedia.org/wiki/NaN"; target="_top">NaN</a> 才返回true.
- </p>-<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">></span> -<span class="keyword">bool</span> <span class="identifier">isnormal</span><span class="special">(</span><span class="identifier">T</span> <span class="identifier">t</span><span class="special">);</span>
-</pre> -<p>- 仅当<span class="emphasis"><em>z</em></span> 是一个常规的数字 (非 零,
- 非无限, 非NaN, 或是规范化的)时才返回true. - </p> -</div>-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
-<td align="left"></td>-<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
- Holin, Xiaogang Zhang and Bruno Lalande<p>- Distributed under the Boost Software License, Version 1.0. (See accompanying - 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>)
- </p> -</div></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="rounding/modf.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -</body> -</html> =======================================--- /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/next_float.html Sat Dec 6 05:06:05 2008
+++ /dev/null @@ -1,69 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">-<title>Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values</title> -<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
-<link rel="start" href="../../index.html" title="Math Toolkit"> -<link rel="up" href="../special.html" title="Special Functions">-<link rel="prev" href="fpclass.html" title="Floating-Point Classification: Infinities and NaN's"> -<link rel="next" href="next_float/nextafter.html" title="Finding the Next Representable Value in a Specific Direction (nextafter)">
-</head>-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
-<td align="center"><a href="../../../../../../../index.html">Home</a></td>-<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> -<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> -<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> -<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
-</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="fpclass.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float/nextafter.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div> - <h3 class="title">-<a name="math_toolkit.special.next_float"></a><a href="next_float.html" title="Floating-Point Representation Distance (ULP), and Finding Adjacent Floating-Point Values"> 浮点表示距离 (ULP), 以及查找邻近的浮点值 </a>
-</h3> -</div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="next_float/nextafter.html"> 在一个特定的 方向上查找下一个可以表示的浮点值 (nextafter)</a></span></dt> -<dt><span class="section"><a href="next_float/float_next.html"> 查找下一个 查找的浮点值 (float_next)</a></span></dt> -<dt><span class="section"><a href="next_float/float_prior.html"> 查找下一个 查找的浮点值 (float_prior)</a></span></dt> -<dt><span class="section"><a href="next_float/float_distance.html"> 计算两 个浮点数之间的浮点距离 (ULP) </a></span></dt> -<dt><span class="section"><a href="next_float/float_advance.html"> 将一个浮 点值增加一个特定的浮点距离 (ULP)</a></span></dt>
-</dl></div> -<p>- <a href="http://en.wikipedia.org/wiki/Unit_in_the_last_place"; target="_top">最小精度单元或上一个位置单元</a> 是两个不同的,但是尽可能接近 的浮点值的间隙</p>
-<p>- 大多数的十进制值, 例如 0.1, 无法由浮点数精确的表示, 但是将会由最邻 近的可表示的浮点值来存储.
- </p> -<p>- 这些函数用于查找邻近的较大的或较小的浮点值, 以及估算任意两个浮点数 之间的间隔的个数.
- </p> -<p> - 浮点类型FPT的表示中必须有固定的比特位数.- 具体的比特数个数可以在运行时设定, 但是比特的个数对于所有的浮点数必 须是一样的.例如, <a href="http://shoup.net/ntl/doc/quad_float.txt"; target="_top">NTL::quad_float</a> - 类型 (固定的 128-bit 表示) 或者 <a href="http://shoup.net/ntl/doc/RR.txt"; target="_top">NTL::RR</a> - 类型 (任意的比特数 但是具有固定的十进制数字, 缺省为 150) 但 <span class="bold"><strong>不是</strong></span> - 一个为了精确的描述任意数字而扩展浮点表示的类型, 例如<a href="http://keithbriggs.info/xrc.html"; target="_top">XRC
- eXact Real in C</a>. - </p> -</div>-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
-<td align="left"></td>-<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
- Holin, Xiaogang Zhang and Bruno Lalande<p>- Distributed under the Boost Software License, Version 1.0. (See accompanying - 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>)
- </p> -</div></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="fpclass.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="next_float/nextafter.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -</body> -</html> =======================================--- /trunk/libs/math/doc/sf_and_dist/html/math_toolkit/special/rounding.html Sat Dec 6 05:06:05 2008
+++ /dev/null @@ -1,51 +0,0 @@ -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<title>Rounding Truncation and Integer Conversion</title>-<link rel="stylesheet" href="../../../../../../../doc/html/boostbook.css" type="text/css"> -<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot_2006-12-17_0120">
-<link rel="start" href="../../index.html" title="Math Toolkit"> -<link rel="up" href="../special.html" title="Special Functions"> -<link rel="prev" href="inv_hyper/atanh.html" title="atanh"> -<link rel="next" href="rounding/round.html" title="Rounding Functions"> -</head>-<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
-<table cellpadding="2" width="100%"><tr>-<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td>
-<td align="center"><a href="../../../../../../../index.html">Home</a></td>-<td align="center"><a href="../../../../../../../libs/libraries.htm">Libraries</a></td> -<td align="center"><a href="http://www.boost.org/users/people.html";>People</a></td> -<td align="center"><a href="http://www.boost.org/users/faq.html";>FAQ</a></td> -<td align="center"><a href="../../../../../../../more/index.htm">More</a></td>
-</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="inv_hyper/atanh.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="rounding/round.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -<div class="section" lang="en"> -<div class="titlepage"><div><div> - <h3 class="title">-<a name="math_toolkit.special.rounding"></a><a href="rounding.html" title="Rounding Truncation and Integer Conversion"> 舍入截断和整数转换 </a>
-</h3> -</div></div></div> -<div class="toc"><dl>-<dt><span class="section"><a href="rounding/round.html"> 舍入函数 </a></span></dt> -<dt><span class="section"><a href="rounding/trunc.html"> 截断函数 </a></span></dt> -<dt><span class="section"><a href="rounding/modf.html"> 整数部分和小数部分 切分 (modf函数)</a></span></dt>
-</dl></div> -</div>-<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision"; width="100%"><tr>
-<td align="left"></td>-<td align="right"><div class="copyright-footer">Copyright ?2006 , 2007, 2008 John Maddock, Paul A. Bristow, Hubert
- Holin, Xiaogang Zhang and Bruno Lalande<p>- Distributed under the Boost Software License, Version 1.0. (See accompanying - 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>)
- </p> -</div></td> -</tr></table> -<hr> -<div class="spirit-nav">-<a accesskey="p" href="inv_hyper/atanh.html"><img src="../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../special.html"><img src="../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="rounding/round.html"><img src="../../../../../../../doc/html/images/next.png" alt="Next"></a>
-</div> -</body> -</html> =======================================--- /trunk/libs/math/doc/sf_and_dist/graphs/acosh.png Thu Sep 4 22:46:36 2008 +++ /trunk/libs/math/doc/sf_and_dist/graphs/acosh.png Wed Sep 9 20:09:56 2009
Binary file, no diff available. ======================================= ***Additional files exist in this changeset.***