Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53557 - in sandbox/numeric_adaptor: boost/numeric_adaptor libs/numeric_adaptor/test
From: bruno.lalande_at_[hidden]
Date: 2009-06-01 18:41:32


Author: bruno.lalande
Date: 2009-06-01 18:41:32 EDT (Mon, 01 Jun 2009)
New Revision: 53557
URL: http://svn.boost.org/trac/boost/changeset/53557

Log:
Added some forgotten value_type's, and added HAVE_GMP and HAVE_CLN to the tests jamfile.
Text files modified:
   sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp | 16 ++++++------
   sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp | 46 ++++++++++++++++++++--------------------
   sandbox/numeric_adaptor/libs/numeric_adaptor/test/Jamroot | 6 ++++
   3 files changed, 36 insertions(+), 32 deletions(-)

Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/cln_policy.hpp 2009-06-01 18:41:32 EDT (Mon, 01 Jun 2009)
@@ -33,14 +33,14 @@
     typedef cln::cl_F value_type;
 
     template <typename FromType>
- static inline void set(type& value, FromType const& v)
+ static inline void set(value_type& value, FromType const& v)
     {
         // Conversions from the C built-in type `double' are provided for the
         // classes cl_DF, cl_F, cl_R, cl_N and cl_number
         value = cln::cl_float(v, cln::float_format(256));
     }
 
- static inline void set(type& value, std::string const& v)
+ static inline void set(value_type& value, std::string const& v)
     {
         // CLN documentation 4.1.3 + 5.1 ("A precision specifier of the form prec may be appended")
         std::string copy(v);
@@ -49,35 +49,35 @@
         //value = cln::cl_float(atof(v.c_str()), cln::float_format(256));
     }
 
- static inline void abs(type& r, type const& a)
+ static inline void abs(value_type& r, value_type const& a)
     {
         r = cln::abs(a);
     }
 
 
- static inline void sqrt(type& r, type const& a)
+ static inline void sqrt(value_type& r, value_type const& a)
     {
         r = cln::sqrt(a);
     }
 
- static inline void cos(type& r, type const& a)
+ static inline void cos(value_type& r, value_type const& a)
     {
         r = cln::cos(a);
     }
 
- static inline void sin(type& r, type const& a)
+ static inline void sin(value_type& r, value_type const& a)
     {
         r = cln::sin(a);
     }
 
- static inline void hypot(type& r, type const& a, type const& b)
+ static inline void hypot(value_type& r, value_type const& a, value_type const& b)
     {
         r = cln::sqrt(a * a + b * b);
     }
 
 
     template <typename ToType>
- static inline ToType big_numeric_cast(type const& b)
+ static inline ToType big_numeric_cast(value_type const& b)
     {
         /*
             Conversions from the classes cl_I, cl_RA, cl_SF, cl_FF,

Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_policy.hpp 2009-06-01 18:41:32 EDT (Mon, 01 Jun 2009)
@@ -24,108 +24,108 @@
 {
     typedef mpf_t value_type;
 
- static inline void init(type& value)
+ static inline void init(value_type& value)
     {
         mpf_init(value);
     }
 
- static inline void destruct(type& value)
+ static inline void destruct(value_type& value)
     {
         mpf_clear(value);
     }
 
     template <typename OtherType>
- static inline void set(type& value, const OtherType& v)
+ static inline void set(value_type& value, const OtherType& v)
     {
         mpf_set_d(value, v);
     }
 
- static inline void set(type& value, const std::string& v)
+ static inline void set(value_type& value, const std::string& v)
     {
         mpf_set_str(value, v.c_str(), 10);
     }
 
 
- static inline void copy(type const& source, type& dest)
+ static inline void copy(value_type const& source, value_type& dest)
     {
         mpf_set(dest, source);
     }
 
     // TODO should we add specific overloads for function like mpf_add_ui?
 
- static inline void add(type& r, type const& a, type const& b)
+ static inline void add(value_type& r, value_type const& a, value_type const& b)
     {
         mpf_add(r, a, b);
     }
 
- static inline void add(type& a, type const& b)
+ static inline void add(value_type& a, value_type const& b)
     {
         mpf_add(a, a, b);
     }
 
- static inline void subtract(type& r, type const& a, type const& b)
+ static inline void subtract(value_type& r, value_type const& a, value_type const& b)
     {
         mpf_sub(r, a, b);
     }
 
- static inline void subtract(type& a, type const& b)
+ static inline void subtract(value_type& a, value_type const& b)
     {
         mpf_sub(a, a, b);
     }
 
- static inline void multiply(type& r, type const& a, type const& b)
+ static inline void multiply(value_type& r, value_type const& a, value_type const& b)
     {
         mpf_mul(r, a, b);
     }
 
- static inline void multiply(type& a, type const& b)
+ static inline void multiply(value_type& a, value_type const& b)
     {
         mpf_mul(a, a, b);
     }
 
- static inline void divide(type& r, type const& a, type const& b)
+ static inline void divide(value_type& r, value_type const& a, value_type const& b)
     {
         mpf_div(r, a, b);
     }
 
- static inline void divide(type& a, type const& b)
+ static inline void divide(value_type& a, value_type const& b)
     {
         mpf_div(a, a, b);
     }
 
- static inline void neg(type& r, type const& n)
+ static inline void neg(value_type& r, value_type const& n)
     {
         mpf_neg(r, n);
     }
 
- static inline void abs(type& r, type const& a)
+ static inline void abs(value_type& r, value_type const& a)
     {
         mpf_abs(r, a);
     }
 
- static inline void sqrt(type& r, type const& a)
+ static inline void sqrt(value_type& r, value_type const& a)
     {
         mpf_sqrt(r, a);
     }
 
- static inline void cos(type& r, type const& a)
+ static inline void cos(value_type& r, value_type const& a)
     {
         // COS is not available in GMP
         long double d = mpf_get_d(a);
         mpf_set_d(r, std::cos(d));
     }
 
- static inline void sin(type& r, type const& a)
+ static inline void sin(value_type& r, value_type const& a)
     {
         // SIN is not available in GMP
         long double d = mpf_get_d(a);
         mpf_set_d(r, std::sin(d));
     }
 
- static inline void hypot(type& r, type const& a, type const& b)
+ static inline void hypot(value_type& r, value_type const& a, value_type const& b)
     {
         mpf_mul(r, a, a);
- type t;
+ value_type t;
         mpf_init(t);
         mpf_mul(t, b, b);
         mpf_add(t, r, t);
@@ -135,13 +135,13 @@
 
 
     template <typename OtherType>
- static inline OtherType big_numeric_cast(type const& b)
+ static inline OtherType big_numeric_cast(value_type const& b)
     {
         return mpf_get_d(b);
     }
 
 
- static inline std::string as_string(type const& a)
+ static inline std::string as_string(value_type const& a)
     {
         mp_exp_t exponent;
         static char s[1024];
@@ -165,7 +165,7 @@
     }
 
 
- static inline int compare(type const& a, type const& b)
+ static inline int compare(value_type const& a, value_type const& b)
     {
         return mpf_cmp(a, b);
     }

Modified: sandbox/numeric_adaptor/libs/numeric_adaptor/test/Jamroot
==============================================================================
--- sandbox/numeric_adaptor/libs/numeric_adaptor/test/Jamroot (original)
+++ sandbox/numeric_adaptor/libs/numeric_adaptor/test/Jamroot 2009-06-01 18:41:32 EDT (Mon, 01 Jun 2009)
@@ -10,7 +10,11 @@
 lib gmp : : <name>gmp ;
 lib cln : : <name>cln ;
 
-project : requirements <include>../../.. <library>gmp <library>cln ;
+project : requirements
+ <include>../../..
+ <library>gmp <define>HAVE_GMP
+ <library>cln <define>HAVE_CLN
+;
 
 import testing ;
 


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