|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r83361 - trunk/libs/math/example
From: pbristow_at_[hidden]
Date: 2013-03-08 07:50:41
Author: pbristow
Date: 2013-03-08 07:50:39 EST (Fri, 08 Mar 2013)
New Revision: 83361
URL: http://svn.boost.org/trac/boost/changeset/83361
Log:
Bessel and Neumann examples, split into four files.
Added:
trunk/libs/math/example/bessel_errors_example.cpp (contents, props changed)
trunk/libs/math/example/bessel_zeros_example_1.cpp (contents, props changed)
trunk/libs/math/example/bessel_zeros_interator_example.cpp (contents, props changed)
trunk/libs/math/example/neumann_zeros_example_1.cpp (contents, props changed)
Added: trunk/libs/math/example/bessel_errors_example.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/example/bessel_errors_example.cpp 2013-03-08 07:50:39 EST (Fri, 08 Mar 2013)
@@ -0,0 +1,170 @@
+// Copyright Christopher Kormanyos 2013.
+// Copyright Paul A. Bristow 2013.
+// Copyright John Maddock 2013.
+
+// 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).
+
+#ifdef _MSC_VER
+# pragma warning (disable : 4512) // assignment operator could not be generated.
+# pragma warning (disable : 4996) // assignment operator could not be generated.
+#endif
+
+#include <iostream>
+#include <limits>
+#include <vector>
+#include <algorithm>
+#include <iomanip>
+#include <exception>
+
+// Weisstein, Eric W. "Bessel Function Zeros." From MathWorld--A Wolfram Web Resource.
+// http://mathworld.wolfram.com/BesselFunctionZeros.html
+// Test values can be calculated using [@wolframalpha.com WolframAplha]
+// See also http://dlmf.nist.gov/10.21
+
+//[bessel_errors_example_1
+
+/*`[h5 Error messages from 'bad' input]
+
+Another example demonstrates calculating zeros of the Bessel functions
+showing the error messages from 'bad' input is handled by throwing exceptions.
+
+To use the functions for finding zeros of the functions we need:
+*/
+ #include <boost/math/special_functions/bessel.hpp>
+ #include <boost/math/special_functions/airy.hpp>
+
+//] [/bessel_errors_example_1]
+
+int main()
+{
+//[bessel_errors_example_2
+
+/*`[tip It is always wise to place all code using Boost.Math inside try'n'catch blocks;
+this will ensure that helpful error messages can be shown when exceptional conditions arise.]
+
+Examples below show messages from several 'bad' arguments that throw a `domain_error` exception.
+*/
+ try
+ { // Try a zero order v.
+ float dodgy_root = boost::math::cyl_bessel_j_zero(0.F, 0);
+ std::cout << "boost::math::cyl_bessel_j_zero(0.F, 0) " << dodgy_root << std::endl;
+ // Thrown exception Error in function boost::math::cyl_bessel_j_zero<double>(double, int):
+ // Requested the 0'th zero of J0, but the rank must be > 0 !
+ }
+ catch (std::exception& ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+
+/*`[note The type shown is the type [*after promotion],
+using __precision_policy and __promotion_policy, from `float` to `double` in this case.]
+
+In this example the promotion goes:
+
+# Arguments are `float` and `int`.
+# Treat `int` "as if" it were a `double`, so arguments are `float` and `double`.
+# Common type is `double` - so that's the precision we want (and the type that will be returned).
+# Evaluate internally as `long double` for full `double` precision.
+
+See full code for other examples that promote from `double` to `long double`.
+
+Other examples of 'bad' inputs like infinity and NaN are below.
+Some compiler warnings indicate that 'bad' values are detected at compile time.
+*/
+
+ try
+ { // order v = inf
+ std::cout << "boost::math::cyl_bessel_j_zero(inf, 1) " << std::endl;
+ double inf = std::numeric_limits<double>::infinity();
+ double inf_root = boost::math::cyl_bessel_j_zero(inf, 1);
+ std::cout << "boost::math::cyl_bessel_j_zero(inf, 1) " << inf_root << std::endl;
+ // Throw exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, unsigned):
+ // Order argument is 1.#INF, but must be finite >= 0 !
+ }
+ catch (std::exception& ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+
+ try
+ { // order v = NaN, rank m = 1
+ std::cout << "boost::math::cyl_bessel_j_zero(nan, 1) " << std::endl;
+ double nan = std::numeric_limits<double>::quiet_NaN();
+ double nan_root = boost::math::cyl_bessel_j_zero(nan, 1);
+ std::cout << "boost::math::cyl_bessel_j_zero(nan, 1) " << nan_root << std::endl;
+ // Throw exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, unsigned):
+ // Order argument is 1.#QNAN, but must be finite >= 0 !
+ }
+ catch (std::exception& ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+
+/*`The output from other examples are shown appended to the full code listing.
+*/
+//] [/bessel_errors_example_2]
+ try
+ { // Try a zero rank m.
+ std::cout << "boost::math::cyl_neumann_zero(0.0, 0) " << std::endl;
+ double dodgy_root = boost::math::cyl_bessel_j_zero(0.0, 0);
+ // warning C4146: unary minus operator applied to unsigned type, result still unsigned.
+ std::cout << "boost::math::cyl_neumann_zero(0.0, -1) " << dodgy_root << std::endl;
+ // boost::math::cyl_neumann_zero(0.0, -1) 6.74652e+009
+ // This *should* fail because m is unreasonably large.
+
+ }
+ catch (std::exception& ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+
+ try
+ { // m = inf
+ std::cout << "boost::math::cyl_bessel_j_zero(0.0, inf) " << std::endl;
+ double inf = std::numeric_limits<double>::infinity();
+ double inf_root = boost::math::cyl_bessel_j_zero(0.0, inf);
+ // warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data.
+ std::cout << "boost::math::cyl_bessel_j_zero(0.0, inf) " << inf_root << std::endl;
+ // Throw exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, int):
+ // Requested the 0'th zero, but must be > 0 !
+
+ }
+ catch (std::exception& ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+
+ try
+ { // m = NaN
+ double nan = std::numeric_limits<double>::quiet_NaN();
+ double nan_root = boost::math::airy_ai_zero<double>(nan);
+ // warning C4244: 'argument' : conversion from 'double' to 'int', possible loss of data.
+ std::cout << "boost::math::airy_ai_zero<double>(nan) " << nan_root << std::endl;
+ // Thrown exception Error in function boost::math::airy_ai_zero<double>(double,double):
+ // The requested rank of the zero is 0, but must be 1 or more !
+ }
+ catch (std::exception& ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+ } // int main()
+
+/*
+Output:
+
+ Description: Autorun "J:\Cpp\big_number\Debug\bessel_errors_example.exe"
+ Thrown exception Error in function boost::math::cyl_bessel_j_zero<double>(double, int): Requested the 0'th zero of J0, but the rank must be > 0 !
+ boost::math::cyl_bessel_j_zero(inf, 1)
+ Thrown exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, int): Order argument is 1.#INF, but must be finite >= 0 !
+ boost::math::cyl_bessel_j_zero(nan, 1)
+ Thrown exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, int): Order argument is 1.#QNAN, but must be finite >= 0 !
+ boost::math::cyl_neumann_zero(0.0, 0)
+ Thrown exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, int): Requested the 0'th zero of J0, but the rank must be > 0 !
+ boost::math::cyl_bessel_j_zero(0.0, inf)
+ Thrown exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, int): Requested the -2147483648'th zero, but the rank must be positive !
+ Thrown exception Error in function boost::math::airy_ai_zero<double>(double,double): The requested rank of the zero is 0, but must be 1 or more !
+
+
+*/
\ No newline at end of file
Added: trunk/libs/math/example/bessel_zeros_example_1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/example/bessel_zeros_example_1.cpp 2013-03-08 07:50:39 EST (Fri, 08 Mar 2013)
@@ -0,0 +1,211 @@
+
+// Copyright Christopher Kormanyos 2013.
+// Copyright Paul A. Bristow 2013.
+// Copyright John Maddock 2013.
+
+// 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).
+
+#ifdef _MSC_VER
+# pragma warning (disable : 4512) // assignment operator could not be generated.
+# pragma warning (disable : 4996) // assignment operator could not be generated.
+#endif
+
+#include <iostream>
+#include <limits>
+#include <vector>
+#include <algorithm>
+#include <iomanip>
+#include <iterator>
+
+// Weisstein, Eric W. "Bessel Function Zeros." From MathWorld--A Wolfram Web Resource.
+// http://mathworld.wolfram.com/BesselFunctionZeros.html
+// Test values can be calculated using [@wolframalpha.com WolframAplha]
+// See also http://dlmf.nist.gov/10.21
+
+//[bessel_zeros_example_1
+
+/*`This example demonstrates calculating zeros of the Bessel, Neumann and Airy functions.
+It also shows how Boost.Math and Boost.Multiprecision can be combined to provide
+a many decimal digit precision. For 50 decimal digit precision we need to include
+*/
+
+ #include <boost/multiprecision/cpp_dec_float.hpp>
+
+/*`and a `typedef` for `float_type` may be convenient
+(allowing a quick switch to re-compute at built-in `double` or other precision)
+*/
+ typedef boost::multiprecision::cpp_dec_float_50 float_type;
+
+//`To use the functions for finding zeros of the functions we need
+
+ #include <boost/math/special_functions/bessel.hpp>
+
+//`This file includes the forward declaration signatures for the zero-finding functions:
+
+// #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]
+*/
+
+/*`This example shows obtaining both a single zero of the Bessel function,
+and then placing multiple zeros into a container like `std::vector` by providing an iterator.
+The signature of the single value function is:
+
+ template <class T>
+ inline typename detail::bessel_traits<T, T, policies::policy<> >::result_type
+ cyl_bessel_j_zero(T v, // Floating-point value for Jv.
+ int m); // start index.
+
+The result type is controlled by the floating-point type of parameter `v`
+(but subject to the usual __precision_policy and __promotion_policy).
+
+The signature of multiple zeros function is:
+
+ template <class T, class OutputIterator>
+ inline OutputIterator cyl_bessel_j_zero(T v, // Floating-point value for Jv.
+ int start_index, // 1-based start index.
+ unsigned number_of_zeros,
+ OutputIterator out_it); // iterator into container for zeros.
+
+There is also a version which allows control of the __policy_section for error handling and precision.
+
+ template <class T, class OutputIterator, class Policy>
+ inline OutputIterator cyl_bessel_j_zero(T v, // Floating-point value for Jv.
+ int start_index, // 1-based start index.
+ unsigned number_of_zeros,
+ OutputIterator out_it,
+ const Policy& pol); // iterator into container for zeros.
+
+*/
+//] [/bessel_zeros_example_1]
+
+int main()
+{
+ try
+ {
+//[bessel_zeros_example_2
+
+/*`[tip It is always wise to place code using Boost.Math inside try'n'catch blocks;
+this will ensure that helpful error messages are shown when exceptional conditions arise.]
+
+First, evaluate a single Bessel zero.
+
+The precision is controlled by the float-point type of template parameter `T` of `v`
+so this example has `double` precision, at least 15 but up to 17 decimal digits (for the common 64-bit double).
+*/
+// double root = boost::math::cyl_bessel_j_zero(0.0, 1);
+// // Displaying with default precision of 6 decimal digits:
+// std::cout << "boost::math::cyl_bessel_j_zero(0.0, 1) " << root << std::endl; // 2.40483
+// // And with all the guaranteed (15) digits:
+// std::cout.precision(std::numeric_limits<double>::digits10);
+// std::cout << "boost::math::cyl_bessel_j_zero(0.0, 1) " << root << std::endl; // 2.40482555769577
+/*`But note that because the parameter `v` controls the precision of the result,
+`v` [*must be a floating-point type].
+So if you provide an integer type, say 0, rather than 0.0, then it will fail to compile thus:
+``
+ root = boost::math::cyl_bessel_j_zero(0, 1);
+``
+with this error message
+``
+ error C2338: Order must be a floating-point type.
+``
+
+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:
+*/
+
+ typedef boost::math::policies::policy<
+ boost::math::policies::domain_error<boost::math::policies::ignore_error>,
+ boost::math::policies::overflow_error<boost::math::policies::ignore_error>,
+ boost::math::policies::underflow_error<boost::math::policies::ignore_error>,
+ boost::math::policies::denorm_error<boost::math::policies::ignore_error>,
+ boost::math::policies::pole_error<boost::math::policies::ignore_error>,
+ boost::math::policies::evaluation_error<boost::math::policies::ignore_error>
+ > ignore_all_policy;
+ //`Examples of use of this `ignore_all_policy` are
+
+ double inf = std::numeric_limits<double>::infinity();
+ double nan = std::numeric_limits<double>::quiet_NaN();
+
+ double dodgy_root = boost::math::cyl_bessel_j_zero(-1.0, 1, ignore_all_policy());
+ std::cout << "boost::math::cyl_bessel_j_zero(-1.0, 1) " << dodgy_root << std::endl; // 1.#QNAN
+ double inf_root = boost::math::cyl_bessel_j_zero(inf, 1, ignore_all_policy());
+ std::cout << "boost::math::cyl_bessel_j_zero(inf, 1) " << inf_root << std::endl; // 1.#QNAN
+ double nan_root = boost::math::cyl_bessel_j_zero(nan, 1, ignore_all_policy());
+ std::cout << "boost::math::cyl_bessel_j_zero(nan, 1) " << nan_root << std::endl; // 1.#QNAN
+
+/*`Another version of `cyl_bessel_j_zero` allows calculation of multiple zeros with one call,
+placing the results in a container, often `std::vector`.
+For example, generate and display the first five `double` roots of J[sub v] for integral order 2,
+as column ['J[sub 2](x)] in table 1 of
+[@ http://mathworld.wolfram.com/BesselFunctionZeros.html Wolfram Bessel Function Zeros].
+*/
+ unsigned int n_roots = 5U;
+ std::vector<double> roots;
+ boost::math::cyl_bessel_j_zero(2.0, 1, n_roots, std::back_inserter(roots));
+ std::copy(roots.begin(),
+ roots.end(),
+ std::ostream_iterator<double>(std::cout, "\n"));
+
+/*`Or we can use Boost.Multiprecision to generate 50 decimal digit roots of ['J[sub v]]
+for non-integral order `v= 71/19 == 3.736842`, expressed as an exact-integer fraction
+to generate the most accurate value possible for all floating-point types.
+
+We set the precision of the output stream, and show trailing zeros to display a fixed 50 decimal digits.
+*/
+ std::cout.precision(std::numeric_limits<float_type>::digits10); // 50 decimal digits.
+ std::cout << std::showpoint << std::endl; // Show trailing zeros.
+
+ float_type x = float_type(71) / 19;
+ float_type r = boost::math::cyl_bessel_j_zero(x, 1); // 1st root.
+ std::cout << "x = " << x << ", r = " << r << std::endl;
+
+ r = boost::math::cyl_bessel_j_zero(x, 20U); // 20th root.
+ std::cout << "x = " << x << ", r = " << r << std::endl;
+
+ std::vector<float_type> zeros;
+ boost::math::cyl_bessel_j_zero(x, 1, 3, std::back_inserter(zeros));
+
+ std::cout << "cyl_bessel_j_zeros" << std::endl;
+ // Print the roots to the output stream.
+ std::copy(zeros.begin(), zeros.end(),
+ std::ostream_iterator<float_type>(std::cout, "\n"));
+//] [/bessel_zeros_example_2]
+ }
+ catch (std::exception ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+
+ } // int main()
+
+
+
+/*
+
+ Output:
+
+ Description: Autorun "J:\Cpp\big_number\Debug\bessel_zeros_example_1.exe"
+ boost::math::cyl_bessel_j_zero(-1.0, 1) 3.83171
+ boost::math::cyl_bessel_j_zero(inf, 1) 1.#QNAN
+ boost::math::cyl_bessel_j_zero(nan, 1) 1.#QNAN
+ 5.13562
+ 8.41724
+ 11.6198
+ 14.796
+ 17.9598
+
+ x = 3.7368421052631578947368421052631578947368421052632, r = 7.2731751938316489503185694262290765588963196701623
+ x = 3.7368421052631578947368421052631578947368421052632, r = 67.815145619696290925556791375555951165111460585458
+ cyl_bessel_j_zeros
+ 7.2731751938316489503185694262290765588963196701623
+ 10.724858308883141732536172745851416647110749599085
+ 14.018504599452388106120459558042660282427471931581
+
+*/
+
Added: trunk/libs/math/example/bessel_zeros_interator_example.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/example/bessel_zeros_interator_example.cpp 2013-03-08 07:50:39 EST (Fri, 08 Mar 2013)
@@ -0,0 +1,88 @@
+// Copyright Christopher Kormanyos 2013.
+// Copyright Paul A. Bristow 2013.
+// Copyright John Maddock 2013.
+
+// 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).
+
+#ifdef _MSC_VER
+# pragma warning (disable : 4512) // assignment operator could not be generated.
+# pragma warning (disable : 4996) // assignment operator could not be generated.
+#endif
+
+#include <iostream>
+#include <limits>
+#include <vector>
+#include <algorithm>
+#include <iomanip>
+#include <iterator>
+
+//[bessel_zeros_iterator_example_1
+
+/*`[h5 Using Output Iterator to sum zeros of Bessel Functions]
+
+This example demonstrates summing zeros of the Bessel functions.
+To use the functions for finding zeros of the functions we need
+ */
+
+#include <boost/math/special_functions/bessel.hpp>
+
+/*`We use the `cyl_bessel_j_zero` output iterator parameter `out_it`
+to create a sum of ['1/zeros[super 2]] by defining a custom output iterator:
+*/
+
+template <class T>
+struct output_summation_iterator
+{
+ output_summation_iterator(T* p) : p_sum(p)
+ {}
+ output_summation_iterator& operator*()
+ { return *this; }
+ output_summation_iterator& operator++()
+ { return *this; }
+ output_summation_iterator& operator++(int)
+ { return *this; }
+ output_summation_iterator& operator = (T const& val)
+ {
+ *p_sum += 1./ (val * val); // Summing 1/zero^2.
+ return *this;
+ }
+private:
+ T* p_sum;
+};
+
+//] [/bessel_zeros_iterator_example_1]
+
+int main()
+{
+ try
+ {
+//[bessel_zeros_iterator_example_2
+
+/*`The sum is calculated for many values, converging on the analytical exact value of `1/8`.
+*/
+ using boost::math::cyl_bessel_j_zero;
+ double nu = 1.;
+ double sum = 0;
+ output_summation_iterator<double> it(&sum); // sum of 1/zeros^2
+ cyl_bessel_j_zero(nu, 1, 10000, it);
+
+ double s = 1/(4 * (nu + 1)); // 0.125 = 1/8 is exact analytical solution.
+ std::cout << std::setprecision(6) << "nu = " << nu << ", sum = " << sum
+ << ", exact = " << s << std::endl;
+ // nu = 1.00000, sum = 0.124990, exact = 0.125000
+//] [/bessel_zeros_iterator_example_2]
+ }
+ catch (std::exception ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+ return 0;
+ } // int_main()
+
+/*
+ Output:
+
+ nu = 1, sum = 0.12499, exact = 0.125
+*/
Added: trunk/libs/math/example/neumann_zeros_example_1.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/math/example/neumann_zeros_example_1.cpp 2013-03-08 07:50:39 EST (Fri, 08 Mar 2013)
@@ -0,0 +1,85 @@
+
+// Copyright Christopher Kormanyos 2013.
+// Copyright Paul A. Bristow 2013.
+// Copyright John Maddock 2013.
+
+// 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).
+
+#ifdef _MSC_VER
+# pragma warning (disable : 4512) // assignment operator could not be generated.
+# pragma warning (disable : 4996) // assignment operator could not be generated.
+#endif
+
+#include <iostream>
+#include <limits>
+#include <vector>
+#include <algorithm>
+#include <iomanip>
+#include <iterator>
+
+//[neumann_zeros_example_1
+
+/*`[h5 Calculating zeros of the Neumann function.]
+This example also shows how Boost.Math and Boost.Multiprecision can be combined to provide
+a many decimal digit precision. For 50 decimal digit precision we need to include
+*/
+
+ #include <boost/multiprecision/cpp_dec_float.hpp>
+
+/*`and a `typedef` for `float_type` may be convenient
+(allowing a quick switch to re-compute at built-in `double` or other precision)
+*/
+ typedef boost::multiprecision::cpp_dec_float_50 float_type;
+
+//`To use the functions for finding zeros of the `cyl_neumann` function we need:
+
+ #include <boost/math/special_functions/bessel.hpp>
+//] [/neumann_zerso_example_1]
+
+int main()
+{
+ try
+ {
+ {
+//[neumann_zeros_example_2
+/*`The Neumann (Bessel Y) function zeros are evaluated very similarly:
+*/
+ using boost::math::cyl_neumann_zero;
+ double zn = cyl_neumann_zero(2., 1);
+ std::cout << "cyl_neumann_zero(2., 1) = " << zn << std::endl;
+
+ std::vector<float> nzeros(3); // Space for 3 zeros.
+ cyl_neumann_zero<float>(2.F, 1, nzeros.size(), nzeros.begin());
+
+ std::cout << "cyl_neumann_zero<float>(2.F, 1, ";
+ // Print the zeros to the output stream.
+ std::copy(nzeros.begin(), nzeros.end(),
+ std::ostream_iterator<float>(std::cout, ", "));
+
+ std::cout << "\n""cyl_neumann_zero(static_cast<float_type>(220)/100, 1) = "
+ << cyl_neumann_zero(static_cast<float_type>(220)/100, 1) << std::endl;
+ // 3.6154383428745996706772556069431792744372398748422
+
+//] //[/neumann_zeros_example_2]
+ }
+ }
+ catch (std::exception ex)
+ {
+ std::cout << "Thrown exception " << ex.what() << std::endl;
+ }
+} // int main()
+
+/*
+ Output:
+
+cyl_neumann_zero(2., 1) = 3.38424
+cyl_neumann_zero<float>(2.F, 1,
+3.38424
+6.79381
+10.0235
+3.61544
+*/
+
+
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