Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65152 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2010-08-31 11:01:58


Author: pbristow
Date: 2010-08-31 11:01:57 EDT (Tue, 31 Aug 2010)
New Revision: 65152
URL: http://svn.boost.org/trac/boost/changeset/65152

Log:
Avoid name ambiguity, etc
Text files modified:
   trunk/libs/math/example/Jamfile.v2 | 6 +++---
   trunk/libs/math/example/binomial_coinflip_example.cpp | 2 +-
   trunk/libs/math/example/binomial_example_nag.cpp | 2 +-
   trunk/libs/math/example/find_location_example.cpp | 11 ++++++-----
   trunk/libs/math/example/find_mean_and_sd_normal.cpp | 10 ++++++----
   trunk/libs/math/example/find_root_example.cpp | 9 +++++----
   6 files changed, 22 insertions(+), 18 deletions(-)

Modified: trunk/libs/math/example/Jamfile.v2
==============================================================================
--- trunk/libs/math/example/Jamfile.v2 (original)
+++ trunk/libs/math/example/Jamfile.v2 2010-08-31 11:01:57 EDT (Tue, 31 Aug 2010)
@@ -1,6 +1,7 @@
-# \math_toolkit\libs\math\example\jamfile.v2
+# \libs\math\example\jamfile.v2
 # Runs statistics examples
-# Copyright 2007 John Maddock and Paul A. Bristow.
+# Copyright 2007 John Maddock
+# Copyright Paul A. Bristow 2007, 2010.
 # 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)
 
@@ -28,7 +29,6 @@
 
 run binomial_coinflip_example.cpp ;
 run binomial_confidence_limits.cpp ;
-run binomial_example3.cpp ;
 run binomial_example_nag.cpp ;
 run binomial_quiz_example.cpp ;
 run binomial_sample_sizes.cpp ;

Modified: trunk/libs/math/example/binomial_coinflip_example.cpp
==============================================================================
--- trunk/libs/math/example/binomial_coinflip_example.cpp (original)
+++ trunk/libs/math/example/binomial_coinflip_example.cpp 2010-08-31 11:01:57 EDT (Tue, 31 Aug 2010)
@@ -1,4 +1,4 @@
-// Copyright Paul A. 2007
+// Copyright Paul A. 2007, 2010
 // Copyright John Maddock 2006
 
 // Use, modification and distribution are subject to the

Modified: trunk/libs/math/example/binomial_example_nag.cpp
==============================================================================
--- trunk/libs/math/example/binomial_example_nag.cpp (original)
+++ trunk/libs/math/example/binomial_example_nag.cpp 2010-08-31 11:01:57 EDT (Tue, 31 Aug 2010)
@@ -1,4 +1,4 @@
-// Copyright Paul A. 2007
+// Copyright Paul A. 2007, 2010
 // Copyright John Maddock 2007
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0.

Modified: trunk/libs/math/example/find_location_example.cpp
==============================================================================
--- trunk/libs/math/example/find_location_example.cpp (original)
+++ trunk/libs/math/example/find_location_example.cpp 2010-08-31 11:01:57 EDT (Tue, 31 Aug 2010)
@@ -1,6 +1,6 @@
 // find_location.cpp
 
-// Copyright Paul A. Bristow 2008.
+// Copyright Paul A. Bristow 2008, 2010.
 
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0.
@@ -13,9 +13,9 @@
 // Note that this file contains Quickbook mark-up as well as code
 // and comments, don't change any of the special comment mark-ups!
 
-#ifdef _MSC_VER
-# pragma warning(disable: 4180) // qualifier has no effect (in fusion).
-#endif
+//#ifdef _MSC_VER
+//# pragma warning(disable: 4180) // qualifier has no effect (in Fusion).
+//#endif
 
 //[find_location1
 /*`
@@ -40,11 +40,12 @@
   using std::setw; using std::setprecision;
 #include <limits>
   using std::numeric_limits;
+
 //] [/find_location1]
 
 int main()
 {
- cout << "Example: Find location (mean)." << endl;
+ cout << "Example: Find location (or mean)." << endl;
   try
   {
 //[find_location2

Modified: trunk/libs/math/example/find_mean_and_sd_normal.cpp
==============================================================================
--- trunk/libs/math/example/find_mean_and_sd_normal.cpp (original)
+++ trunk/libs/math/example/find_mean_and_sd_normal.cpp 2010-08-31 11:01:57 EDT (Tue, 31 Aug 2010)
@@ -1,6 +1,6 @@
 // find_mean_and_sd_normal.cpp
 
-// Copyright Paul A. Bristow 2007.
+// Copyright Paul A. Bristow 2007, 2010.
 
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0.
@@ -36,6 +36,8 @@
   using std::setw; using std::setprecision;
 #include <limits>
   using std::numeric_limits;
+#include <stdexcept>
+ using std::exception;
 //] [/normal_std Quickbook]
 
 int main()
@@ -364,13 +366,13 @@
 //] [/normal_find_location_and_scale_eg Quickbook end]
 
   }
- catch(const std::exception& e)
+ catch(const exception& e)
   { // Always useful to include try & catch blocks because default policies
     // are to throw exceptions on arguments that cause errors like underflow, overflow.
     // Lacking try & catch blocks, the program will abort without a message below,
     // which may give some helpful clues as to the cause of the exception.
- std::cout <<
- "\n""Message from thrown exception was:\n " << e.what() << std::endl;
+ cout <<
+ "\n""Message from thrown exception was:\n " << e.what() << endl;
   }
   return 0;
 } // int main()

Modified: trunk/libs/math/example/find_root_example.cpp
==============================================================================
--- trunk/libs/math/example/find_root_example.cpp (original)
+++ trunk/libs/math/example/find_root_example.cpp 2010-08-31 11:01:57 EDT (Tue, 31 Aug 2010)
@@ -1,6 +1,6 @@
 // find_root_example.cpp
 
-// Copyright Paul A. Bristow 2007.
+// Copyright Paul A. Bristow 2007, 2010.
 
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0.
@@ -29,10 +29,11 @@
   using std::setw; using std::setprecision;
 #include <limits>
   using std::numeric_limits;
-//] //[/root_find1]
-
-
+#include <stdexcept>
+ using std::exception;
 
+//] //[/root_find1]
+
 int main()
 {
   cout << "Example: Normal distribution, root finding.";


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