Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83560 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2013-03-25 13:54:58


Author: pbristow
Date: 2013-03-25 13:54:57 EDT (Mon, 25 Mar 2013)
New Revision: 83560
URL: http://svn.boost.org/trac/boost/changeset/83560

Log:
Added #include and try/n/catch blocks to try to see why fails on some platforms (mainly Teeks).
Text files modified:
   trunk/libs/math/example/bessel_zeros_example_1.cpp | 4 ++--
   trunk/libs/math/example/distribution_construction.cpp | 26 ++++++++++++++++++++++++++
   2 files changed, 28 insertions(+), 2 deletions(-)

Modified: trunk/libs/math/example/bessel_zeros_example_1.cpp
==============================================================================
--- trunk/libs/math/example/bessel_zeros_example_1.cpp (original)
+++ trunk/libs/math/example/bessel_zeros_example_1.cpp 2013-03-25 13:54:57 EDT (Mon, 25 Mar 2013)
@@ -47,7 +47,7 @@
 // #include <boost/math/special_functions/math_fwd.hpp>
 
 /*`but more details are in the full documentation, for example at
-[@http://www.boost.org/doc/libs/1_53_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html Boost.Math Bessel functions]
+[@http://www.boost.org/doc/libs/1_53_0/libs/math/doc/sf_and_dist/html/math_toolkit/special/bessel/bessel_over.html Boost.Math Bessel functions].
 */
 
 /*`This example shows obtaining both a single zero of the Bessel function,
@@ -117,7 +117,7 @@
   error C2338: Order must be a floating-point type.
 ``
 
-Optionally, we can use a policy to ignore errors, C-style, returning some value
+Optionally, we can use a policy to ignore errors, C-style, returning some value,
 perhaps infinity or NaN, or the best that can be done. (See __user_error_handling).
 
 To create a (possibly unwise!) policy `ignore_all_policy` that ignores all errors:

Modified: trunk/libs/math/example/distribution_construction.cpp
==============================================================================
--- trunk/libs/math/example/distribution_construction.cpp (original)
+++ trunk/libs/math/example/distribution_construction.cpp 2013-03-25 13:54:57 EDT (Mon, 25 Mar 2013)
@@ -13,6 +13,10 @@
 #ifdef _MSC_VER
 # pragma warning (disable : 4996) // disable -D_SCL_SECURE_NO_WARNINGS C++ 'Checked Iterators'
 #endif
+
+#include <iostream>
+#include <exception>
+
 //[distribution_construction_1
 
 /*`
@@ -48,6 +52,8 @@
 
 int main()
 {
+ try
+ {
 //[distribution_construction_2
 /*`
 First, a negative binomial distribution with 8 successes
@@ -243,6 +249,12 @@
   normal norm2(2); // Mean = 2, std deviation = 1.
   normal norm3(2, 3); // Mean = 2, std deviation = 3.
 
+ }
+ catch(std::exception &ex)
+ {
+ std::cout << ex.what() << std::endl;
+ }
+
   return 0;
 } // int main()
 
@@ -250,3 +262,17 @@
 
 //] [/end of distribution_construction_2]
 
+/*
+//[distribution_construction_output
+
+ 0.00012630010495970320103876754721976419438231705359935
+ 0.00012630010495970318465064569310967179576805651692929
+ 0.00012630010495970318465064569310967179576805651692929
+ 0.00012630010495970320103876754721976419438231705359935
+
+//] [/distribution_construction_output]
+
+*/
+
+
+


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