Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82874 - in trunk/boost/math/special_functions: . detail
From: pbristow_at_[hidden]
Date: 2013-02-14 09:34:02


Author: pbristow
Date: 2013-02-14 09:34:01 EST (Thu, 14 Feb 2013)
New Revision: 82874
URL: http://svn.boost.org/trac/boost/changeset/82874

Log:
unsigned m changed to int
Text files modified:
   trunk/boost/math/special_functions/bessel.hpp | 52 ++++++++++++++++++++++++++-------------
   trunk/boost/math/special_functions/detail/bessel_jy_zero.hpp | 4 +-
   trunk/boost/math/special_functions/math_fwd.hpp | 32 ++++++++++++------------
   3 files changed, 52 insertions(+), 36 deletions(-)

Modified: trunk/boost/math/special_functions/bessel.hpp
==============================================================================
--- trunk/boost/math/special_functions/bessel.hpp (original)
+++ trunk/boost/math/special_functions/bessel.hpp 2013-02-14 09:34:01 EST (Thu, 14 Feb 2013)
@@ -1,4 +1,5 @@
-// Copyright (c) 2007 John Maddock
+// Copyright (c) 2007, 2013 John Maddock
+// Copyright Christopher Kormanyos 2013.
 // Use, modification and distribution are subject to 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)
@@ -11,7 +12,7 @@
 #define BOOST_MATH_BESSEL_HPP
 
 #ifdef _MSC_VER
-#pragma once
+# pragma once
 #endif
 
 #include <boost/math/special_functions/detail/bessel_jy.hpp>
@@ -354,18 +355,25 @@
 }
 
 template <class T, class Policy>
-inline T cyl_bessel_j_zero_imp(T v, unsigned m, const Policy& pol)
+inline T cyl_bessel_j_zero_imp(T v, int m, const Policy& pol)
 {
    BOOST_MATH_STD_USING // ADL of std names, needed for log.
 
- static const char* function = "boost::math::cyl_bessel_j_zero<%1%>(%1%, unsigned)";
+ static const char* function = "boost::math::cyl_bessel_j_zero<%1%>(%1%, int)";
    // Handle negative order or if the zero'th zero is requested.
    // Return NaN if NaN is available or return 0 if NaN is not available.
    if(v < 0)
+ {
       return policies::raise_domain_error<T>(function, "Order argument is %1%, but must be >= 0 !", v, pol);
- if(m == 0)
+ }
+ else if (!(boost::math::isfinite)(v) )
+ {
+ return policies::raise_domain_error<T>(function, "Order argument is %1%, but must be finite >= 0 !", v, pol);
+ }
+ if(m <= 0)
+ {
       return policies::raise_domain_error<T>(function, "Requested the %1%'th zero, but must be > 0 !", m, pol);
-
+ }
    // Set up the initial guess for the upcoming root-finding.
    const T guess_root = boost::math::detail::bessel_zero::cyl_bessel_j_zero_detail::initial_guess<T>(v, m);
 
@@ -396,16 +404,24 @@
 }
 
 template <class T, class Policy>
-inline T cyl_neumann_zero_imp(T v, unsigned m, const Policy& pol)
+inline T cyl_neumann_zero_imp(T v, int m, const Policy& pol)
 {
    BOOST_MATH_STD_USING // ADL of std names, needed for log.
 
- static const char* function = "boost::math::cyl_neumann_zero<%1%>(%1%, unsigned)";
+ static const char* function = "boost::math::cyl_neumann_zero<%1%>(%1%, int)";
    // Handle negative order or if the zero'th zero is requested.
- if(v < 0)
+ if (!(boost::math::isfinite)(v) )
+ {
+ return policies::raise_domain_error<T>(function, "Order argument is %1%, but must be finite >= 0 !", v, pol);
+ }
+ else if(v < 0)
+ {
       return policies::raise_domain_error<T>(function, "Order argument is %1%, but must be >= 0 !", v, pol);
- if(m == 0)
+ }
+ if(m <= 0)
+ {
       return policies::raise_domain_error<T>(function, "Requested the %1%'th zero, but must be > 0 !", m, pol);
+ }
 
    // Set up the initial guess for the upcoming root-finding.
    const T guess_root = boost::math::detail::bessel_zero::cyl_neumann_zero_detail::initial_guess<T>(v, m);
@@ -568,7 +584,7 @@
 }
 
 template <class T, class Policy>
-inline typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, unsigned m, const Policy& /* pol */)
+inline typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, int m, const Policy& /* pol */)
 {
    BOOST_FPU_EXCEPTION_GUARD
    typedef typename detail::bessel_traits<T, T, Policy>::result_type result_type;
@@ -584,7 +600,7 @@
 }
 
 template <class T>
-inline typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, unsigned m)
+inline typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, int m)
 {
    BOOST_STATIC_ASSERT_MSG(false == std::numeric_limits<T>::is_integer, "Order must be a floating-point type.");
    return cyl_bessel_j_zero<T, policies::policy<> >(v, m, policies::policy<>());
@@ -592,7 +608,7 @@
 
 template <class T, class OutputIterator, class Policy>
 inline OutputIterator cyl_bessel_j_zero(T v,
- unsigned start_index,
+ int start_index,
                               unsigned number_of_zeros,
                               OutputIterator out_it,
                               const Policy& pol)
@@ -608,7 +624,7 @@
 
 template <class T, class OutputIterator>
 inline OutputIterator cyl_bessel_j_zero(T v,
- unsigned start_index,
+ int start_index,
                               unsigned number_of_zeros,
                               OutputIterator out_it)
 {
@@ -616,7 +632,7 @@
 }
 
 template <class T, class Policy>
-inline typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, unsigned m, const Policy& /* pol */)
+inline typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, int m, const Policy& /* pol */)
 {
    BOOST_FPU_EXCEPTION_GUARD
    typedef typename detail::bessel_traits<T, T, Policy>::result_type result_type;
@@ -632,7 +648,7 @@
 }
 
 template <class T>
-inline typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, unsigned m)
+inline typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, int m)
 {
    BOOST_STATIC_ASSERT_MSG(false == std::numeric_limits<T>::is_integer, "Order must be a floating-point type.");
    return cyl_neumann_zero<T, policies::policy<> >(v, m, policies::policy<>());
@@ -640,7 +656,7 @@
 
 template <class T, class OutputIterator, class Policy>
 inline OutputIterator cyl_neumann_zero(T v,
- unsigned start_index,
+ int start_index,
                              unsigned number_of_zeros,
                              OutputIterator out_it,
                              const Policy& pol)
@@ -656,7 +672,7 @@
 
 template <class T, class OutputIterator>
 inline OutputIterator cyl_neumann_zero(T v,
- unsigned start_index,
+ int start_index,
                              unsigned number_of_zeros,
                              OutputIterator out_it)
 {

Modified: trunk/boost/math/special_functions/detail/bessel_jy_zero.hpp
==============================================================================
--- trunk/boost/math/special_functions/detail/bessel_jy_zero.hpp (original)
+++ trunk/boost/math/special_functions/detail/bessel_jy_zero.hpp 2013-02-14 09:34:01 EST (Thu, 14 Feb 2013)
@@ -184,7 +184,7 @@
         }
 
         template<class T>
- T initial_guess(const T& v, unsigned m)
+ T initial_guess(const T& v, int m)
         {
           // Compute an estimate of the m'th root of cyl_bessel_j.
 
@@ -303,7 +303,7 @@
         }
 
         template<class T>
- T initial_guess(T v, unsigned m)
+ T initial_guess(T v, int m)
         {
           // Compute an estimate of the m'th root of cyl_neumann.
 

Modified: trunk/boost/math/special_functions/math_fwd.hpp
==============================================================================
--- trunk/boost/math/special_functions/math_fwd.hpp (original)
+++ trunk/boost/math/special_functions/math_fwd.hpp 2013-02-14 09:34:01 EST (Thu, 14 Feb 2013)
@@ -615,39 +615,39 @@
    typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
 
    template <class T, class Policy>
- typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, unsigned m, const Policy& pol);
+ typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, int m, const Policy& pol);
 
    template <class T>
- typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, unsigned m);
+ typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, int m);
 
    template <class T, class OutputIterator>
    OutputIterator cyl_bessel_j_zero(T v,
- unsigned start_index,
+ int start_index,
                           unsigned number_of_zeros,
                           OutputIterator out_it);
 
    template <class T, class OutputIterator, class Policy>
    OutputIterator cyl_bessel_j_zero(T v,
- unsigned start_index,
+ int start_index,
                           unsigned number_of_zeros,
                           OutputIterator out_it,
                           const Policy&);
 
    template <class T, class Policy>
- typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, unsigned m, const Policy& pol);
+ typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, int m, const Policy& pol);
 
    template <class T>
- typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, unsigned m);
+ typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, int m);
 
    template <class T, class OutputIterator>
    OutputIterator cyl_neumann_zero(T v,
- unsigned start_index,
+ int start_index,
                          unsigned number_of_zeros,
                          OutputIterator out_it);
 
    template <class T, class OutputIterator, class Policy>
    OutputIterator cyl_neumann_zero(T v,
- unsigned start_index,
+ int start_index,
                          unsigned number_of_zeros,
                          OutputIterator out_it,
                          const Policy&);
@@ -1215,23 +1215,23 @@
    sph_neumann(unsigned v, T x){ return boost::math::sph_neumann(v, x, Policy()); }\
 \
    template <class T>\
- inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_bessel_j_zero(T v, unsigned m)\
+ inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_bessel_j_zero(T v, int m)\
    { return boost::math::cyl_bessel_j_zero(v, m, Policy()); }\
 \
 template <class OutputIterator, class T>\
    inline void cyl_bessel_j_zero(T v,\
- unsigned start_index,\
+ int start_index,\
                                  unsigned number_of_zeros,\
                                  OutputIterator out_it)\
    { boost::math::cyl_bessel_j_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
 \
    template <class T>\
- inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_neumann_zero(T v, unsigned m)\
+ inline typename boost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_neumann_zero(T v, int m)\
    { return boost::math::cyl_neumann_zero(v, m, Policy()); }\
 \
 template <class OutputIterator, class T>\
    inline void cyl_neumann_zero(T v,\
- unsigned start_index,\
+ int start_index,\
                                 unsigned number_of_zeros,\
                                 OutputIterator out_it)\
    { boost::math::cyl_neumann_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
@@ -1385,17 +1385,17 @@
    { return boost::math::airy_bi_prime(x, Policy()); }\
    \
    template <class T>\
- inline T airy_ai_zero(unsigned m)\
+ inline T airy_ai_zero(int m)\
    { return boost::math::airy_ai_zero<T>(m, Policy()); }\
    template <class T, class OutputIterator>\
- OutputIterator airy_ai_zero(unsigned start_index, unsigned number_of_zeros, OutputIterator out_it)\
+ OutputIterator airy_ai_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
    { return boost::math::airy_ai_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
    \
    template <class T>\
- inline T airy_bi_zero(unsigned m)\
+ inline T airy_bi_zero(int m)\
    { return boost::math::airy_bi_zero<T>(m, Policy()); }\
    template <class T, class OutputIterator>\
- OutputIterator airy_bi_zero(unsigned start_index, unsigned number_of_zeros, OutputIterator out_it)\
+ OutputIterator airy_bi_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
    { return boost::math::airy_bi_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
    \
 


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