Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73507 - in sandbox/e_float: boost/e_float libs/e_float/src/e_float/efx
From: e_float_at_[hidden]
Date: 2011-08-03 08:37:48


Author: christopher_kormanyos
Date: 2011-08-03 08:37:46 EDT (Wed, 03 Aug 2011)
New Revision: 73507
URL: http://svn.boost.org/trac/boost/changeset/73507

Log:
- Removed the explicitness of all e_float ctors (preparing for compatibility with Boost.Math).
Text files modified:
   sandbox/e_float/boost/e_float/e_float_complex.hpp | 19 ++++----------
   sandbox/e_float/boost/e_float/e_float_efx.hpp | 50 ++++++++++++++++++++--------------------
   sandbox/e_float/boost/e_float/e_float_elementary_complex.hpp | 16 ++++--------
   sandbox/e_float/boost/e_float/e_float_gmp.hpp | 14 +++++-----
   sandbox/e_float/boost/e_float/e_float_mpfr.hpp | 14 +++++-----
   sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp | 2
   6 files changed, 52 insertions(+), 63 deletions(-)

Modified: sandbox/e_float/boost/e_float/e_float_complex.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_complex.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_complex.hpp 2011-08-03 08:37:46 EDT (Wed, 03 Aug 2011)
@@ -25,20 +25,17 @@
   class ef_complex
   {
   private:
-
     e_float Re;
     e_float Im;
 
   public:
+ ef_complex(const INT32 n) : Re(n), Im(ef::zero()) { }
+ ef_complex(const INT64 n) : Re(n), Im(ef::zero()) { }
+ ef_complex(const UINT32 u) : Re(u), Im(ef::zero()) { }
+ ef_complex(const UINT64 u) : Re(u), Im(ef::zero()) { }
+ ef_complex(const double d) : Re(d), Im(ef::zero()) { }
 
- explicit ef_complex(const INT32 n) : Re(n), Im(ef::zero()) { }
- explicit ef_complex(const INT64 n) : Re(n), Im(ef::zero()) { }
- explicit ef_complex(const UINT32 u) : Re(u), Im(ef::zero()) { }
- explicit ef_complex(const UINT64 u) : Re(u), Im(ef::zero()) { }
- explicit ef_complex(const double d) : Re(d), Im(ef::zero()) { }
-
- ef_complex(const e_float& re = ef::zero(), const e_float& im = ef::zero()) : Re(re), Im(im) { }
-
+ ef_complex(const e_float& re = e_float(), const e_float& im = e_float()) : Re(re), Im(im) { }
     ef_complex(const ef_complex& z) : Re(z.Re), Im(z.Im) { }
 
     e_float real(void) const { return Re; }
@@ -92,10 +89,6 @@
     const ef_complex& operator--(void) { --Re; return *this; }
           ef_complex operator--(int) { const ef_complex w(*this); --Re; return w; }
 
- // Unary operators.
- ef_complex operator-(void) const { return ef_complex(-Re, -Im); }
- ef_complex& operator+(void) { return *this; }
-
     // Operators with integer.
     ef_complex& operator+=(const INT32 n) { Re += n; return *this; }
     ef_complex& operator-=(const INT32 n) { Re -= n; return *this; }

Modified: sandbox/e_float/boost/e_float/e_float_efx.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_efx.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_efx.hpp 2011-08-03 08:37:46 EDT (Wed, 03 Aug 2011)
@@ -65,45 +65,45 @@
                   fpclass (ef_finite),
                   prec_elem(ef_elem_number) { }
 
- explicit e_float(const INT32 n) : data (),
- exp (static_cast<INT64>(0)),
- neg (n < static_cast<INT32>(0)),
- fpclass (ef_finite),
- prec_elem(ef_elem_number)
+ e_float(const INT32 n) : data (),
+ exp (static_cast<INT64>(0)),
+ neg (n < static_cast<INT32>(0)),
+ fpclass (ef_finite),
+ prec_elem(ef_elem_number)
       {
- from_uint32(static_cast<UINT32>(neg ? -n : n));
+ from_uint32((!neg) ? static_cast<UINT32>(n) : static_cast<UINT32>(-n));
       }
 
- explicit e_float(const INT64 n) : data (),
- exp (static_cast<INT64>(0)),
- neg (n < static_cast<INT64>(0)),
- fpclass (ef_finite),
- prec_elem(ef_elem_number)
+ e_float(const INT64 n) : data (),
+ exp (static_cast<INT64>(0)),
+ neg (n < static_cast<INT64>(0)),
+ fpclass (ef_finite),
+ prec_elem(ef_elem_number)
       {
- from_uint64(static_cast<UINT64>(neg ? -n : n));
+ from_uint64((!neg) ? static_cast<UINT64>(n) : static_cast<UINT64>(-n));
       }
 
- explicit e_float(const UINT32 u) : data (),
- exp (static_cast<INT64>(0)),
- neg (false),
- fpclass (ef_finite),
- prec_elem(ef_elem_number)
+ e_float(const UINT32 u) : data (),
+ exp (static_cast<INT64>(0)),
+ neg (false),
+ fpclass (ef_finite),
+ prec_elem(ef_elem_number)
       {
         from_uint32(u);
       }
 
- explicit e_float(const UINT64 u) : data (),
- exp (static_cast<INT64>(0)),
- neg (false),
- fpclass (ef_finite),
- prec_elem(ef_elem_number)
+ e_float(const UINT64 u) : data (),
+ exp (static_cast<INT64>(0)),
+ neg (false),
+ fpclass (ef_finite),
+ prec_elem(ef_elem_number)
       {
         from_uint64(u);
       }
 
- explicit e_float(const double d);
- explicit e_float(const char* const s);
- explicit e_float(const std::string& str);
+ e_float(const double d);
+ e_float(const char* const s);
+ e_float(const std::string& str);
 
       e_float(const e_float& f) : data (f.data),
                                   exp (f.exp),

Modified: sandbox/e_float/boost/e_float/e_float_elementary_complex.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_elementary_complex.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_elementary_complex.hpp 2011-08-03 08:37:46 EDT (Wed, 03 Aug 2011)
@@ -57,16 +57,12 @@
     ef_complex atanh (const ef_complex& z);
   }
 
- // Overwrite global template ef_complex operator functions, some of which are overloaded.
- // These operator functions are:
- // operator!=
- // operator==
- // operator*
- // operator+
- // operator-
- // operator/
- // operator<<
- // TBD: operator>>
+
+ // Global unary operators of e_float reference.
+ inline ef_complex operator-(const ef_complex& u) { return ef_complex(-u.real(), -u.imag()); }
+ inline ef_complex& operator+( ef_complex& u) { return u; }
+ inline const ef_complex& operator+(const ef_complex& u) { return u; }
+
   inline bool operator==(const ef_complex& u, const ef_complex& v) { return (u.real() == v.real()) && (u.imag() == v.imag()); }
   inline bool operator!=(const ef_complex& u, const ef_complex& v) { return (u.real() != v.real()) || (u.imag() != v.imag()); }
 

Modified: sandbox/e_float/boost/e_float/e_float_gmp.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_gmp.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_gmp.hpp 2011-08-03 08:37:46 EDT (Wed, 03 Aug 2011)
@@ -87,13 +87,13 @@
       // Constructors
       e_float(void);
 
- explicit e_float(const INT32 n);
- explicit e_float(const INT64 n);
- explicit e_float(const UINT32 u);
- explicit e_float(const UINT64 u);
- explicit e_float(const double d);
- explicit e_float(const char* const s);
- explicit e_float(const std::string& str);
+ e_float(const INT32 n);
+ e_float(const INT64 n);
+ e_float(const UINT32 u);
+ e_float(const UINT64 u);
+ e_float(const double d);
+ e_float(const char* const s);
+ e_float(const std::string& str);
 
       e_float(const e_float& f);
 

Modified: sandbox/e_float/boost/e_float/e_float_mpfr.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_mpfr.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_mpfr.hpp 2011-08-03 08:37:46 EDT (Wed, 03 Aug 2011)
@@ -85,13 +85,13 @@
     public:
 
       e_float();
- explicit e_float(const INT32 n);
- explicit e_float(const INT64 n);
- explicit e_float(const UINT32 u);
- explicit e_float(const UINT64 u);
- explicit e_float(const double d);
- explicit e_float(const char* s);
- explicit e_float(const std::string& str);
+ e_float(const INT32 n);
+ e_float(const INT64 n);
+ e_float(const UINT32 u);
+ e_float(const UINT64 u);
+ e_float(const double d);
+ e_float(const char* s);
+ e_float(const std::string& str);
 
       e_float(const e_float& f);
 

Modified: sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp (original)
+++ sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp 2011-08-03 08:37:46 EDT (Wed, 03 Aug 2011)
@@ -1236,7 +1236,7 @@
 
   std::stringstream ss;
 
- ss << std::setprecision(static_cast<std::streamsize>(std::numeric_limits<double>::max_digits10 + 1))
+ ss << std::setprecision(static_cast<std::streamsize>(std::numeric_limits<double>::digits10 + (2 + 1)))
      << std::scientific
      << *this;
 


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