Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2008-05-08 12:16:52


Author: johnmaddock
Date: 2008-05-08 12:16:51 EDT (Thu, 08 May 2008)
New Revision: 45216
URL: http://svn.boost.org/trac/boost/changeset/45216

Log:
Renamed next_* functions to float_*.
Text files modified:
   sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp | 18 ++++++++--------
   sandbox/math_toolkit/boost/math/special_functions/next.hpp | 44 ++++++++++++++++++++--------------------
   sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp | 18 ++++++++--------
   sandbox/math_toolkit/libs/math/test/compile_test/sf_next_incl_test.cpp | 18 ++++++++--------
   sandbox/math_toolkit/libs/math/test/test_next.cpp | 34 +++++++++++++++---------------
   5 files changed, 66 insertions(+), 66 deletions(-)

Modified: sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/math_fwd.hpp 2008-05-08 12:16:51 EDT (Thu, 08 May 2008)
@@ -685,17 +685,17 @@
    template <class T>
    T nextafter(const T&, const T&);
    template <class T, class Policy>
- T next_greater(const T&, const Policy&);
+ T float_next(const T&, const Policy&);
    template <class T>
- T next_greater(const T&);
+ T float_next(const T&);
    template <class T, class Policy>
- T next_less(const T&, const Policy&);
+ T float_prior(const T&, const Policy&);
    template <class T>
- T next_less(const T&);
+ T float_prior(const T&);
    template <class T, class Policy>
- T edit_distance(const T&, const T&, const Policy&);
+ T float_distance(const T&, const T&, const Policy&);
    template <class T>
- T edit_distance(const T&, const T&);
+ T float_distance(const T&, const T&);
 
     } // namespace math
 } // namespace boost
@@ -1044,9 +1044,9 @@
    template <int N, class T>\
    inline typename boost::math::tools::promote_args<T>::type pow(T v){ return boost::math::pow<N>(v, Policy()); }\
    template <class T> T nextafter(const T& a, const T& b){ return boost::math::nextafter(a, b, Policy()); }\
- template <class T> T next_greater(const T& a){ return boost::math::next_greater(a, Policy()); }\
- template <class T> T next_less(const T& a){ return boost::math::next_less(a, Policy()); }\
- template <class T> T edit_distance(const T& a, const T& b){ return boost::math::edit_distance(a, b, Policy()); }\
+ template <class T> T float_next(const T& a){ return boost::math::float_next(a, Policy()); }\
+ template <class T> T float_prior(const T& a){ return boost::math::float_prior(a, Policy()); }\
+ template <class T> T float_distance(const T& a, const T& b){ return boost::math::float_distance(a, b, Policy()); }\
 
 
 #endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP

Modified: sandbox/math_toolkit/boost/math/special_functions/next.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/next.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/next.hpp 2008-05-08 12:16:51 EDT (Thu, 08 May 2008)
@@ -43,11 +43,11 @@
 }
 
 template <class T, class Policy>
-T next_greater(const T& val, const Policy& pol)
+T float_next(const T& val, const Policy& pol)
 {
    BOOST_MATH_STD_USING
    int expon;
- static const char* function = "next_greater<%1%>(%1%)";
+ static const char* function = "float_next<%1%>(%1%)";
 
    if(!(boost::math::isfinite)(val))
       return policies::raise_domain_error<T>(
@@ -70,9 +70,9 @@
 
 #ifdef BOOST_MSVC
 template <class Policy>
-inline double next_greater(const double& val, const Policy& pol)
+inline double float_next(const double& val, const Policy& pol)
 {
- static const char* function = "next_greater<%1%>(%1%)";
+ static const char* function = "float_next<%1%>(%1%)";
 
    if(!(boost::math::isfinite)(val))
       return policies::raise_domain_error<double>(
@@ -87,17 +87,17 @@
 #endif
 
 template <class T>
-inline T next_greater(const T& val)
+inline T float_next(const T& val)
 {
- return next_greater(val, policies::policy<>());
+ return float_next(val, policies::policy<>());
 }
 
 template <class T, class Policy>
-T next_less(const T& val, const Policy& pol)
+T float_prior(const T& val, const Policy& pol)
 {
    BOOST_MATH_STD_USING
    int expon;
- static const char* function = "next_less<%1%>(%1%)";
+ static const char* function = "float_prior<%1%>(%1%)";
 
    if(!(boost::math::isfinite)(val))
       return policies::raise_domain_error<T>(
@@ -121,9 +121,9 @@
 
 #ifdef BOOST_MSVC
 template <class Policy>
-inline double next_less(const double& val, const Policy& pol)
+inline double float_prior(const double& val, const Policy& pol)
 {
- static const char* function = "next_less<%1%>(%1%)";
+ static const char* function = "float_prior<%1%>(%1%)";
 
    if(!(boost::math::isfinite)(val))
       return policies::raise_domain_error<double>(
@@ -138,15 +138,15 @@
 #endif
 
 template <class T>
-inline T next_less(const T& val)
+inline T float_prior(const T& val)
 {
- return next_less(val, policies::policy<>());
+ return float_prior(val, policies::policy<>());
 }
 
 template <class T, class Policy>
 inline T nextafter(const T& val, const T& direction, const Policy& pol)
 {
- return val < direction ? boost::math::next_greater(val, pol) : val == direction ? val : boost::math::next_less(val, pol);
+ return val < direction ? boost::math::float_next(val, pol) : val == direction ? val : boost::math::float_prior(val, pol);
 }
 
 template <class T>
@@ -156,13 +156,13 @@
 }
 
 template <class T, class Policy>
-T edit_distance(const T& a, const T& b, const Policy& pol)
+T float_distance(const T& a, const T& b, const Policy& pol)
 {
    BOOST_MATH_STD_USING
    //
    // Error handling:
    //
- static const char* function = "edit_distance<%1%>(%1%, %1%)";
+ static const char* function = "float_distance<%1%>(%1%, %1%)";
    if(!(boost::math::isfinite)(a))
       return policies::raise_domain_error<T>(
          function,
@@ -177,18 +177,18 @@
    if(a == b)
       return 0;
    if(a == 0)
- return 1 + edit_distance(boost::math::sign(b) * detail::get_smallest_value<T>(), b, pol);
+ return 1 + float_distance(boost::math::sign(b) * detail::get_smallest_value<T>(), b, pol);
    if(b == 0)
- return 1 + edit_distance(boost::math::sign(a) * detail::get_smallest_value<T>(), a, pol);
+ return 1 + float_distance(boost::math::sign(a) * detail::get_smallest_value<T>(), a, pol);
    if(boost::math::sign(a) != boost::math::sign(b))
- return 2 + edit_distance(boost::math::sign(b) * detail::get_smallest_value<T>(), b, pol)
- + edit_distance(boost::math::sign(a) * detail::get_smallest_value<T>(), a, pol);
+ return 2 + float_distance(boost::math::sign(b) * detail::get_smallest_value<T>(), b, pol)
+ + float_distance(boost::math::sign(a) * detail::get_smallest_value<T>(), a, pol);
 
    if((std::min)(fabs(a), fabs(b)) / (std::max)(fabs(a), fabs(b)) < 2 * tools::epsilon<T>())
    {
       bool biga = fabs(a) > fabs(b);
       T split = ldexp(biga ? b : a, tools::digits<T>() - 2);
- return edit_distance(a, split, pol) + edit_distance(split, b, pol);
+ return float_distance(a, split, pol) + float_distance(split, b, pol);
    }
 
    BOOST_MATH_STD_USING
@@ -229,9 +229,9 @@
 }
 
 template <class T>
-T edit_distance(const T& a, const T& b)
+T float_distance(const T& a, const T& b)
 {
- return boost::math::edit_distance(a, b, policies::policy<>());
+ return boost::math::float_distance(a, b, policies::policy<>());
 }
 
 }} // namespaces

Modified: sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/instantiate.hpp 2008-05-08 12:16:51 EDT (Thu, 08 May 2008)
@@ -247,9 +247,9 @@
 #endif
    boost::math::pow<2>(v1);
    boost::math::nextafter(v1, v1);
- boost::math::next_greater(v1);
- boost::math::next_less(v1);
- boost::math::edit_distance(v1, v1);
+ boost::math::float_next(v1);
+ boost::math::float_prior(v1);
+ boost::math::float_distance(v1, v1);
    //
    // All over again, with a policy this time:
    //
@@ -373,9 +373,9 @@
 #endif
    boost::math::pow<2>(v1, pol);
    boost::math::nextafter(v1, v1, pol);
- boost::math::next_greater(v1, pol);
- boost::math::next_less(v1, pol);
- boost::math::edit_distance(v1, v1, pol);
+ boost::math::float_next(v1, pol);
+ boost::math::float_prior(v1, pol);
+ boost::math::float_distance(v1, v1, pol);
    //
    // All over again with the versions in test::
    //
@@ -492,9 +492,9 @@
 #endif
    test::pow<2>(v1);
    test::nextafter(v1, v1);
- test::next_greater(v1);
- test::next_less(v1);
- test::edit_distance(v1, v1);
+ test::float_next(v1);
+ test::float_prior(v1);
+ test::float_distance(v1, v1);
 }
 
 template <class RealType>

Modified: sandbox/math_toolkit/libs/math/test/compile_test/sf_next_incl_test.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/compile_test/sf_next_incl_test.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/compile_test/sf_next_incl_test.cpp 2008-05-08 12:16:51 EDT (Thu, 08 May 2008)
@@ -21,22 +21,22 @@
    check_result<long double>(boost::math::nextafter<long double>(l, l));
 #endif
 
- check_result<float>(boost::math::next_greater<float>(f));
- check_result<double>(boost::math::next_greater<double>(d));
+ check_result<float>(boost::math::float_next<float>(f));
+ check_result<double>(boost::math::float_next<double>(d));
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- check_result<long double>(boost::math::next_greater<long double>(l));
+ check_result<long double>(boost::math::float_next<long double>(l));
 #endif
 
- check_result<float>(boost::math::next_less<float>(f));
- check_result<double>(boost::math::next_less<double>(d));
+ check_result<float>(boost::math::float_prior<float>(f));
+ check_result<double>(boost::math::float_prior<double>(d));
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- check_result<long double>(boost::math::next_less<long double>(l));
+ check_result<long double>(boost::math::float_prior<long double>(l));
 #endif
 
- check_result<float>(boost::math::edit_distance<float>(f, f));
- check_result<double>(boost::math::edit_distance<double>(d, d));
+ check_result<float>(boost::math::float_distance<float>(f, f));
+ check_result<double>(boost::math::float_distance<double>(d, d));
 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- check_result<long double>(boost::math::edit_distance<long double>(l, l));
+ check_result<long double>(boost::math::float_distance<long double>(l, l));
 #endif
 
 }

Modified: sandbox/math_toolkit/libs/math/test/test_next.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_next.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_next.cpp 2008-05-08 12:16:51 EDT (Thu, 08 May 2008)
@@ -17,20 +17,20 @@
 
    std::cout << "Testing type " << name << " with initial value " << val << std::endl;
 
- BOOST_CHECK_EQUAL(edit_distance(next_greater(val), val), 1);
- BOOST_CHECK(next_greater(val) > val);
- BOOST_CHECK_EQUAL(edit_distance(next_less(val), val), 1);
- BOOST_CHECK(next_less(val) < val);
- BOOST_CHECK_EQUAL(edit_distance(nextafter(val, upper), val), 1);
+ BOOST_CHECK_EQUAL(float_distance(float_next(val), val), 1);
+ BOOST_CHECK(float_next(val) > val);
+ BOOST_CHECK_EQUAL(float_distance(float_prior(val), val), 1);
+ BOOST_CHECK(float_prior(val) < val);
+ BOOST_CHECK_EQUAL(float_distance(nextafter(val, upper), val), 1);
    BOOST_CHECK(nextafter(val, upper) > val);
- BOOST_CHECK_EQUAL(edit_distance(nextafter(val, lower), val), 1);
+ BOOST_CHECK_EQUAL(float_distance(nextafter(val, lower), val), 1);
    BOOST_CHECK(nextafter(val, lower) < val);
- BOOST_CHECK_EQUAL(edit_distance(next_greater(next_greater(val)), val), 2);
- BOOST_CHECK_EQUAL(edit_distance(next_less(next_less(val)), val), 2);
- BOOST_CHECK_EQUAL(edit_distance(next_less(next_greater(val)), val), 0);
- BOOST_CHECK_EQUAL(edit_distance(next_greater(next_less(val)), val), 0);
- BOOST_CHECK_EQUAL(next_less(next_greater(val)), val);
- BOOST_CHECK_EQUAL(next_greater(next_less(val)), val);
+ BOOST_CHECK_EQUAL(float_distance(float_next(float_next(val)), val), 2);
+ BOOST_CHECK_EQUAL(float_distance(float_prior(float_prior(val)), val), 2);
+ BOOST_CHECK_EQUAL(float_distance(float_prior(float_next(val)), val), 0);
+ BOOST_CHECK_EQUAL(float_distance(float_next(float_prior(val)), val), 0);
+ BOOST_CHECK_EQUAL(float_prior(float_next(val)), val);
+ BOOST_CHECK_EQUAL(float_next(float_prior(val)), val);
 }
 
 template <class T>
@@ -82,17 +82,17 @@
       T v2 = val;
       for(unsigned j = 0; j < primes[i]; ++j)
       {
- v1 = boost::math::next_greater(v1);
- v2 = boost::math::next_less(v2);
+ v1 = boost::math::float_next(v1);
+ v2 = boost::math::float_prior(v2);
       }
- BOOST_CHECK_EQUAL(boost::math::edit_distance(v1, val), primes[i]);
- BOOST_CHECK_EQUAL(boost::math::edit_distance(v2, val), primes[i]);
+ BOOST_CHECK_EQUAL(boost::math::float_distance(v1, val), primes[i]);
+ BOOST_CHECK_EQUAL(boost::math::float_distance(v2, val), primes[i]);
    }
 }
 
 int test_main(int, char* [])
 {
- std::cout << boost::math::edit_distance(1.0, 0.0) << std::endl;
+ std::cout << boost::math::float_distance(1.0, 0.0) << std::endl;
    test_values(1.0f, "float");
    test_values(1.0, "double");
    test_values(1.0L, "long double");


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