|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r78011 - trunk/libs/math/doc/sf_and_dist
From: pbristow_at_[hidden]
Date: 2012-04-16 11:17:39
Author: pbristow
Date: 2012-04-16 11:17:37 EDT (Mon, 16 Apr 2012)
New Revision: 78011
URL: http://svn.boost.org/trac/boost/changeset/78011
Log:
Updates for skew normal, non_num facets and roadmap
Text files modified:
trunk/libs/math/doc/sf_and_dist/constants.qbk | 37 +++++++++++++++++++++++++------------
trunk/libs/math/doc/sf_and_dist/credits.qbk | 2 ++
trunk/libs/math/doc/sf_and_dist/dist_reference.qbk | 1 +
trunk/libs/math/doc/sf_and_dist/fp_facets.qbk | 16 +++++++++++++++-
trunk/libs/math/doc/sf_and_dist/html4_symbols.qbk | 12 +++++++-----
5 files changed, 50 insertions(+), 18 deletions(-)
Modified: trunk/libs/math/doc/sf_and_dist/constants.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/constants.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/constants.qbk 2012-04-16 11:17:37 EDT (Mon, 16 Apr 2012)
@@ -392,7 +392,7 @@
namespace boost{ namespace math{ namespace constants{
- BOOST_DEFINE_MATH_CONSTANT(my_constant, 0, "0");
+ BOOST_DEFINE_MATH_CONSTANT(my_constant, 0.0, "0");
}}}
@@ -409,23 +409,36 @@
Then to `boost/math/constants/constants.hpp` add:
- BOOST_DEFINE_MATH_CONSTANT(half_pi, 0, "0"); // actual values are temporary, we'll replace them later
+ BOOST_DEFINE_MATH_CONSTANT(half_pi, 0.0, "0"); // Actual values are temporary, we'll replace them later.
-[note Previously defined constants like pi and e can be used, but by not simply calling `pi<T>()`;
-specifying the precision via the policy is essential to ensure full accuracy.]
-
-[note Newly defined constants can only be used once they are included in
- `boost/math/constants/constants.hpp`. So if you add
-`template <class T, class N> T calculate_new_constant{...}`,
-then you cannot define `calculate_one_div_new_constant`
-until you add the `BOOST_DEFINE_MATH_CONSTANT(new_constant, 1.234...)`.]
+[note Previously defined constants like pi and e can be used, but by *not simply calling* `pi<T>()`;
+specifying the precision via the policy
+`pi<T, policies::policy<policies::digits2<N> > >()`
+is essential to ensure full accuracy.]
+
+[warning Newly defined constants can only be used once they are included in
+`boost/math/constants/constants.hpp`. So if you add
+`template <class T, class N> T constant_my_constant{...}`,
+then you cannot define `constant_my_constant`
+until you add the temporary `BOOST_DEFINE_MATH_CONSTANT(my_constant, 0.0, "0")`.
+Failing to do this will result in surprising compile errors:
+``
+ error C2143: syntax error : missing ';' before '<'
+ error C2433: 'constant_root_two_div_pi' : 'inline' not permitted on data declarations
+ error C2888: 'T constant_root_two_div_pi' : symbol cannot be defined within namespace 'detail'
+ error C2988: unrecognizable template declaration/definition
+``
+]
-2. [*You will need an arbitary precision type to use to calculate the value]. This library
+2. [*You will need an arbitrary precision type to use to calculate the value]. This library
currently supports either `cpp_float`, `NTL::RR` or `mpfr_class` used via the bindings in `boost/math/bindings`.
The default is to use `NTL::RR` unless you define an alternate macro, for example,
`USE_MPFR` or `USE_CPP_FLOAT` at the start of your program.
-3. The complete program to generate the constant `half_pi` using function `calculate_half_pi` is then:
+3. It is necessary to link to the Boost.Regex library,
+and probably to your chosen arbitrary precision type library.
+
+4. The complete program to generate the constant `half_pi` using function `calculate_half_pi` is then:
#define USE_CPP_FLOAT // If required.
#include <boost/math/constants/generate.hpp>
Modified: trunk/libs/math/doc/sf_and_dist/credits.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/credits.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/credits.qbk 2012-04-16 11:17:37 EDT (Mon, 16 Apr 2012)
@@ -64,6 +64,8 @@
from __Mathematica, and of course,
to Eric Weissten for nurturing __Mathworld, an invaluable resource.
+The Skew-normal distribution and Owen's t function were written by Benjamin Sobotta.
+
Plots of the functions and distributions were prepared in
[@http://www.w3.org/ W3C] standard
[@http://www.svg.org/ Scalable Vector Graphic (SVG)] format
Modified: trunk/libs/math/doc/sf_and_dist/dist_reference.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/dist_reference.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/dist_reference.qbk 2012-04-16 11:17:37 EDT (Mon, 16 Apr 2012)
@@ -30,6 +30,7 @@
[include distributions/pareto.qbk]
[include distributions/poisson.qbk]
[include distributions/rayleigh.qbk]
+[include distributions/skew_normal.qbk]
[include distributions/students_t.qbk]
[include distributions/triangular.qbk]
[include distributions/uniform.qbk]
Modified: trunk/libs/math/doc/sf_and_dist/fp_facets.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/fp_facets.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/fp_facets.qbk 2012-04-16 11:17:37 EDT (Mon, 16 Apr 2012)
@@ -338,7 +338,7 @@
[h5 signed_zero]
If the `signed_zero` flag is used with `nonfinite_num_put`,
-then the facet will distinguish between positive and negative zero.
+then the facet will always distinguish between positive and negative zero.
It will format positive zero as "0" or "+0" and negative zero as "-0".
The string representation of positive zero can be controlled
with the `showpos` and `noshowpos` manipulators.
@@ -348,6 +348,16 @@
as positive zero and "-0" as negative zero,
as do most implementations of `std::num_get`.
+[note If the `signed_zero` flag is not set (the default), then a negative zero value
+will be displayed on output in whatever way the platform normally handles it.
+For most platforms, this it will format positive zero as "0" or "+0" and negative zero as "-0".
+But setting the `signed_zero` flag may be more portable.]
+
+[tip A negative zero value can be portably produced using the changesign function
+`(changesign)(static_cast<ValType>(0))` where `ValType` is `float`, `double` or `long double`,
+ or a User-Defined floating-point type (UDT) provided that this UDT has a sign
+and that the changesign function is implemented.]
+
[h5 trap_infinity]
If the `trap_infinity` flag is used with `nonfinite_num_put`,
@@ -361,6 +371,7 @@
then the facet will set the `fail bit` of the stream when an attempt is made
to parse a string that represents positive or negative infinity.
+
(See Design Rationale below for a discussion of this inconsistency.)
[h5 trap_nan]
@@ -502,6 +513,9 @@
Example [@../../../example/nonfinite_num_facet.cpp] shows output and re-input
of various finite and nonfinite values.
+A simple example of trapping nonfinite output is at
+[@../../../example/nonfinite_num_facet_trap.cpp nonfinite_num_facet_trap.cpp].
+
A very basic example of using Boost.Archive is at
[@../../../example/nonfinite_serialization_archives.cpp].
Modified: trunk/libs/math/doc/sf_and_dist/html4_symbols.qbk
==============================================================================
--- trunk/libs/math/doc/sf_and_dist/html4_symbols.qbk (original)
+++ trunk/libs/math/doc/sf_and_dist/html4_symbols.qbk 2012-04-16 11:17:37 EDT (Mon, 16 Apr 2012)
@@ -4,16 +4,16 @@
[/ See also http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references]
[/ http://www.alanwood.net/demos/ent4_frame.html]
[/ http://www.unicode.org/charts/PDF/U2200.pdf and others]
-[/ All (except 2 angle brackets) show OK on Firefox 2.0]
+[/ All (except 2 angle brackets) show OK on Firefox 2.0 and higher]
[/ See also Latin-1 aka Western (ISO-8859-1) in latin1_symbols.qbk]
[/ http://www.htmlhelp.com/reference/html40/entities/latin1.html]
[/Unicode Latin extended http://www.unicode.org/charts/U0080.pdf]
-[/ Also some miscellaneous math charaters added to this list - see the end.]
+[/ Also some miscellaneous math characters added to this list - see the end.]
[/ For others see also math_symbols.qbk]
-[/ To use, enclose the template name in square brackets.]
+[/ To use, enclose the template name in square brackets, for example: [pi]]
[template fnof[]'''ƒ'''] [/ Latin small f with hook = function = florin]
[/ Capital Greek start with capital letter, lower case all small.]
@@ -186,9 +186,11 @@
[template plusminus[]'''±'''] [/ ? plus or minus sign]
[template sqrt[]'''√'''] [/ ? square root sqrt symbol]
-[/template pow2[]'''⁳'''] [/ 2073 is NOT superscript 2 character]
+[/template pow2[]'''⁳'''] [/ 2073 is NOT superscript 2 and 3 characters]
[template pow2[]'''²'''] [/ superscript 2 character]
[template pow3[]'''³'''] [/ superscript 3 character]
+[/ Unicode 2070 to 209F has super and subscript digits and characters, unicode.org/charts/PDF/U2070.pdf]
+[template pow4[]'''⁴'''] [/ superscript 4 character]
[template pown[]'''ⁿ'''] [/ superscript n character]
[template frac12[]'''½'''] [/ fraction half]
[template frac14[]'''¼'''] [/ fraction quarter]
@@ -207,7 +209,7 @@
[template raquo[]'''»'''] [/ right-pointing double angle quotation mark = right pointing guillemet ]
[/
-Copyright 2007, 2010 Paul A. Bristow.
+Copyright 2007, 2010, 2012 Paul A. Bristow.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt).
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk