Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55214 - sandbox/numeric_adaptor/boost/numeric_adaptor
From: bruno.lalande_at_[hidden]
Date: 2009-07-30 14:43:37


Author: bruno.lalande
Date: 2009-07-27 17:07:03 EDT (Mon, 27 Jul 2009)
New Revision: 55214
URL: http://svn.boost.org/trac/boost/changeset/55214

Log:
Added negation operators.
Text files modified:
   sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp | 5 +++++
   sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp | 7 +++++++
   2 files changed, 12 insertions(+), 0 deletions(-)

Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/cln_value_type.hpp 2009-07-27 17:07:03 EDT (Mon, 27 Jul 2009)
@@ -98,6 +98,11 @@
         return *this;
     }
 
+ friend inline cln_value_type operator-(cln_value_type const& v)
+ {
+ return cln_value_type(-v.m_value);
+ }
+
     cln::cl_F m_value;
 };
 

Modified: sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp
==============================================================================
--- sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp (original)
+++ sandbox/numeric_adaptor/boost/numeric_adaptor/gmp_value_type.hpp 2009-07-27 17:07:03 EDT (Mon, 27 Jul 2009)
@@ -112,6 +112,13 @@
         return *this;
     }
 
+ friend inline gmp_value_type operator-(gmp_value_type const& v)
+ {
+ gmp_value_type r;
+ mpf_neg(r.m_value, v.m_value);
+ return r;
+ }
+
     mpf_t m_value;
 };
 


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