Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73529 - sandbox/e_float/boost/e_float
From: e_float_at_[hidden]
Date: 2011-08-04 12:27:09


Author: christopher_kormanyos
Date: 2011-08-04 12:27:07 EDT (Thu, 04 Aug 2011)
New Revision: 73529
URL: http://svn.boost.org/trac/boost/changeset/73529

Log:
- The e_float (and ef_complex) interface to operations with POD is nearly complete.
Text files modified:
   sandbox/e_float/boost/e_float/e_float_complex.hpp | 140 ++++++++++++++++++++++++---
   sandbox/e_float/boost/e_float/e_float_elementary_complex.hpp | 203 ++++++++++++++++++++++++++++++++++++---
   2 files changed, 311 insertions(+), 32 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-04 12:27:07 EDT (Thu, 04 Aug 2011)
@@ -24,10 +24,65 @@
 
   class ef_complex;
 
- inline ef_complex& operator+=(ef_complex&, const INT32);
- inline ef_complex& operator-=(ef_complex&, const INT32);
- inline ef_complex& operator*=(ef_complex&, const INT32);
- inline ef_complex& operator/=(ef_complex&, const INT32);
+ inline ef_complex& operator+=(ef_complex&, const signed char);
+ inline ef_complex& operator+=(ef_complex&, const signed short);
+ inline ef_complex& operator+=(ef_complex&, const signed int);
+ inline ef_complex& operator+=(ef_complex&, const signed long);
+ inline ef_complex& operator+=(ef_complex&, const signed long long);
+ inline ef_complex& operator+=(ef_complex&, const unsigned char);
+ inline ef_complex& operator+=(ef_complex&, const wchar_t);
+ inline ef_complex& operator+=(ef_complex&, const unsigned short);
+ inline ef_complex& operator+=(ef_complex&, const unsigned int);
+ inline ef_complex& operator+=(ef_complex&, const unsigned long);
+ inline ef_complex& operator+=(ef_complex&, const unsigned long long);
+ inline ef_complex& operator+=(ef_complex&, const float);
+ inline ef_complex& operator+=(ef_complex&, const double);
+ inline ef_complex& operator+=(ef_complex&, const long double);
+
+ inline ef_complex& operator-=(ef_complex&, const signed char);
+ inline ef_complex& operator-=(ef_complex&, const signed short);
+ inline ef_complex& operator-=(ef_complex&, const signed int);
+ inline ef_complex& operator-=(ef_complex&, const signed long);
+ inline ef_complex& operator-=(ef_complex&, const signed long long);
+ inline ef_complex& operator-=(ef_complex&, const unsigned char);
+ inline ef_complex& operator-=(ef_complex&, const wchar_t);
+ inline ef_complex& operator-=(ef_complex&, const unsigned short);
+ inline ef_complex& operator-=(ef_complex&, const unsigned int);
+ inline ef_complex& operator-=(ef_complex&, const unsigned long);
+ inline ef_complex& operator-=(ef_complex&, const unsigned long long);
+ inline ef_complex& operator-=(ef_complex&, const float);
+ inline ef_complex& operator-=(ef_complex&, const double);
+ inline ef_complex& operator-=(ef_complex&, const long double);
+
+ inline ef_complex& operator*=(ef_complex&, const signed char);
+ inline ef_complex& operator*=(ef_complex&, const signed short);
+ inline ef_complex& operator*=(ef_complex&, const signed int);
+ inline ef_complex& operator*=(ef_complex&, const signed long);
+ inline ef_complex& operator*=(ef_complex&, const signed long long);
+ inline ef_complex& operator*=(ef_complex&, const unsigned char);
+ inline ef_complex& operator*=(ef_complex&, const wchar_t);
+ inline ef_complex& operator*=(ef_complex&, const unsigned short);
+ inline ef_complex& operator*=(ef_complex&, const unsigned int);
+ inline ef_complex& operator*=(ef_complex&, const unsigned long);
+ inline ef_complex& operator*=(ef_complex&, const unsigned long long);
+ inline ef_complex& operator*=(ef_complex&, const float);
+ inline ef_complex& operator*=(ef_complex&, const double);
+ inline ef_complex& operator*=(ef_complex&, const long double);
+
+ inline ef_complex& operator/=(ef_complex&, const signed char);
+ inline ef_complex& operator/=(ef_complex&, const signed short);
+ inline ef_complex& operator/=(ef_complex&, const signed int);
+ inline ef_complex& operator/=(ef_complex&, const signed long);
+ inline ef_complex& operator/=(ef_complex&, const signed long long);
+ inline ef_complex& operator/=(ef_complex&, const unsigned char);
+ inline ef_complex& operator/=(ef_complex&, const wchar_t);
+ inline ef_complex& operator/=(ef_complex&, const unsigned short);
+ inline ef_complex& operator/=(ef_complex&, const unsigned int);
+ inline ef_complex& operator/=(ef_complex&, const unsigned long);
+ inline ef_complex& operator/=(ef_complex&, const unsigned long long);
+ inline ef_complex& operator/=(ef_complex&, const float);
+ inline ef_complex& operator/=(ef_complex&, const double);
+ inline ef_complex& operator/=(ef_complex&, const long double);
 
   inline ef_complex& operator+=(ef_complex&, const e_float&);
   inline ef_complex& operator-=(ef_complex&, const e_float&);
@@ -99,18 +154,6 @@
       return *this;
     }
 
- // Operators with integer.
- friend inline ef_complex& ::operator+=(ef_complex&, const INT32);
- friend inline ef_complex& ::operator-=(ef_complex&, const INT32);
- friend inline ef_complex& ::operator*=(ef_complex&, const INT32);
- friend inline ef_complex& ::operator/=(ef_complex&, const INT32);
-
- // Operators with e_float.
- friend inline ef_complex& ::operator+=(ef_complex&, const e_float&);
- friend inline ef_complex& ::operator-=(ef_complex&, const e_float&);
- friend inline ef_complex& ::operator*=(ef_complex&, const e_float&);
- friend inline ef_complex& ::operator/=(ef_complex&, const e_float&);
-
     // Operators pre-increment and pre-decrement
     const ef_complex& operator++(void) { ++Re; return *this; }
     const ef_complex& operator--(void) { --Re; return *this; }
@@ -123,6 +166,71 @@
     bool isint (void) const { return Re.isint() && Im.iszero(); }
     bool isone (void) const { return Re.isone() && Im.iszero(); }
     bool iszero (void) const { return Re.iszero() && Im.iszero(); }
+
+ friend inline ef_complex& ::operator+=(ef_complex&, const signed char);
+ friend inline ef_complex& ::operator+=(ef_complex&, const signed short);
+ friend inline ef_complex& ::operator+=(ef_complex&, const signed int);
+ friend inline ef_complex& ::operator+=(ef_complex&, const signed long);
+ friend inline ef_complex& ::operator+=(ef_complex&, const signed long long);
+ friend inline ef_complex& ::operator+=(ef_complex&, const unsigned char);
+ friend inline ef_complex& ::operator+=(ef_complex&, const wchar_t);
+ friend inline ef_complex& ::operator+=(ef_complex&, const unsigned short);
+ friend inline ef_complex& ::operator+=(ef_complex&, const unsigned int);
+ friend inline ef_complex& ::operator+=(ef_complex&, const unsigned long);
+ friend inline ef_complex& ::operator+=(ef_complex&, const unsigned long long);
+ friend inline ef_complex& ::operator+=(ef_complex&, const float);
+ friend inline ef_complex& ::operator+=(ef_complex&, const double);
+ friend inline ef_complex& ::operator+=(ef_complex&, const long double);
+
+ friend inline ef_complex& ::operator-=(ef_complex&, const signed char);
+ friend inline ef_complex& ::operator-=(ef_complex&, const signed short);
+ friend inline ef_complex& ::operator-=(ef_complex&, const signed int);
+ friend inline ef_complex& ::operator-=(ef_complex&, const signed long);
+ friend inline ef_complex& ::operator-=(ef_complex&, const signed long long);
+ friend inline ef_complex& ::operator-=(ef_complex&, const unsigned char);
+ friend inline ef_complex& ::operator-=(ef_complex&, const wchar_t);
+ friend inline ef_complex& ::operator-=(ef_complex&, const unsigned short);
+ friend inline ef_complex& ::operator-=(ef_complex&, const unsigned int);
+ friend inline ef_complex& ::operator-=(ef_complex&, const unsigned long);
+ friend inline ef_complex& ::operator-=(ef_complex&, const unsigned long long);
+ friend inline ef_complex& ::operator-=(ef_complex&, const float);
+ friend inline ef_complex& ::operator-=(ef_complex&, const double);
+ friend inline ef_complex& ::operator-=(ef_complex&, const long double);
+
+ friend inline ef_complex& ::operator*=(ef_complex&, const signed char);
+ friend inline ef_complex& ::operator*=(ef_complex&, const signed short);
+ friend inline ef_complex& ::operator*=(ef_complex&, const signed int);
+ friend inline ef_complex& ::operator*=(ef_complex&, const signed long);
+ friend inline ef_complex& ::operator*=(ef_complex&, const signed long long);
+ friend inline ef_complex& ::operator*=(ef_complex&, const unsigned char);
+ friend inline ef_complex& ::operator*=(ef_complex&, const wchar_t);
+ friend inline ef_complex& ::operator*=(ef_complex&, const unsigned short);
+ friend inline ef_complex& ::operator*=(ef_complex&, const unsigned int);
+ friend inline ef_complex& ::operator*=(ef_complex&, const unsigned long);
+ friend inline ef_complex& ::operator*=(ef_complex&, const unsigned long long);
+ friend inline ef_complex& ::operator*=(ef_complex&, const float);
+ friend inline ef_complex& ::operator*=(ef_complex&, const double);
+ friend inline ef_complex& ::operator*=(ef_complex&, const long double);
+
+ friend inline ef_complex& ::operator/=(ef_complex&, const signed char);
+ friend inline ef_complex& ::operator/=(ef_complex&, const signed short);
+ friend inline ef_complex& ::operator/=(ef_complex&, const signed int);
+ friend inline ef_complex& ::operator/=(ef_complex&, const signed long);
+ friend inline ef_complex& ::operator/=(ef_complex&, const signed long long);
+ friend inline ef_complex& ::operator/=(ef_complex&, const unsigned char);
+ friend inline ef_complex& ::operator/=(ef_complex&, const wchar_t);
+ friend inline ef_complex& ::operator/=(ef_complex&, const unsigned short);
+ friend inline ef_complex& ::operator/=(ef_complex&, const unsigned int);
+ friend inline ef_complex& ::operator/=(ef_complex&, const unsigned long);
+ friend inline ef_complex& ::operator/=(ef_complex&, const unsigned long long);
+ friend inline ef_complex& ::operator/=(ef_complex&, const float);
+ friend inline ef_complex& ::operator/=(ef_complex&, const double);
+ friend inline ef_complex& ::operator/=(ef_complex&, const long double);
+
+ friend inline ef_complex& ::operator+=(ef_complex&, const e_float&);
+ friend inline ef_complex& ::operator-=(ef_complex&, const e_float&);
+ friend inline ef_complex& ::operator*=(ef_complex&, const e_float&);
+ friend inline ef_complex& ::operator/=(ef_complex&, const e_float&);
   };
 
   inline std::ostream& operator<<(std::ostream& os, const ef_complex& z) { return os << '(' << z.real() << ',' << z.imag() << ')'; }

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-04 12:27:07 EDT (Thu, 04 Aug 2011)
@@ -70,37 +70,208 @@
   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()); }
 
- // Global arithmetic operators with const ef_complex&, const e_float& and INT32
+ // Global arithmetic operators with const ef_complex& and const ef_complex&.
   inline ef_complex operator+(const ef_complex& u, const ef_complex& v) { return ef_complex(u) += v; }
   inline ef_complex operator-(const ef_complex& u, const ef_complex& v) { return ef_complex(u) -= v; }
   inline ef_complex operator*(const ef_complex& u, const ef_complex& v) { return ef_complex(u) *= v; }
   inline ef_complex operator/(const ef_complex& u, const ef_complex& v) { return ef_complex(u) /= v; }
 
+ // Global arithmetic operators with const ef_complex& and const e_float&.
   inline ef_complex operator+(const ef_complex& u, const e_float& v) { return ef_complex(u.real() + v, u.imag()); }
   inline ef_complex operator-(const ef_complex& u, const e_float& v) { return ef_complex(u.real() - v, u.imag()); }
   inline ef_complex operator*(const ef_complex& u, const e_float& v) { return ef_complex(u.real() * v, u.imag() * v); }
   inline ef_complex operator/(const ef_complex& u, const e_float& v) { return ef_complex(u.real() / v, u.imag() / v); }
 
+ // Global arithmetic operators with const e_float& and const ef_complex&.
   inline ef_complex operator+(const e_float& u, const ef_complex& v) { return ef_complex(u + v.real(), v.imag()); }
   inline ef_complex operator-(const e_float& u, const ef_complex& v) { return ef_complex(u - v.real(), -v.imag()); }
   inline ef_complex operator*(const e_float& u, const ef_complex& v) { return ef_complex(u * v.real(), u * v.imag()); }
- inline ef_complex operator/(const e_float& u, const ef_complex& v) { const e_float norm = (v.real() * v.real()) + (v.imag() * v.imag()); return ef_complex((u * v.real()) / norm, (-u * v.imag()) / norm); }
+ inline ef_complex operator/(const e_float& u, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((u * v.real()) / v_norm, (-u * v.imag()) / v_norm); }
 
- inline ef_complex operator+(const INT32 n, const ef_complex& v) { return ef_complex(e_float(n)) += v; }
- inline ef_complex operator-(const INT32 n, const ef_complex& v) { return ef_complex(e_float(n)) -= v; }
- inline ef_complex operator*(const INT32 n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
- inline ef_complex operator/(const INT32 n, const ef_complex& v) { const e_float norm = (v.real() * v.real()) + (v.imag() * v.imag()); return ef_complex((n * v.real()) / norm, (-n * v.imag()) / norm); }
-
- inline ef_complex operator+(const ef_complex& z, const INT32 n) { return ef_complex(z.real() + n, z.imag()); }
- inline ef_complex operator-(const ef_complex& z, const INT32 n) { return ef_complex(z.real() - n, z.imag()); }
- inline ef_complex operator*(const ef_complex& z, const INT32 n) { return ef_complex(z.real() * n, z.imag() * n); }
- inline ef_complex operator/(const ef_complex& z, const INT32 n) { return ef_complex(z.real() / n, z.imag() / n); }
-
- inline ef_complex& operator+=(ef_complex& z, const INT32 n) { z.Re += n; return z; }
- inline ef_complex& operator-=(ef_complex& z, const INT32 n) { z.Re -= n; return z; }
- inline ef_complex& operator*=(ef_complex& z, const INT32 n) { z.Re *= n; z.Im *= n; return z; }
- inline ef_complex& operator/=(ef_complex& z, const INT32 n) { z.Re /= n; z.Im /= n; return z; }
+ // Global add/sub/mul/div of const ef_complex& with all built-in types.
+ inline ef_complex operator+(const ef_complex& z, const signed char n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const signed short n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const signed int n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const signed long n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const signed long long n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const unsigned char n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const wchar_t n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const unsigned short n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const unsigned int n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const unsigned long n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const unsigned long long n) { return ef_complex(z.real() + n, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const float f) { return ef_complex(z.real() + f, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const double d) { return ef_complex(z.real() + d, z.imag()); }
+ inline ef_complex operator+(const ef_complex& z, const long double ld) { return ef_complex(z.real() + ld, z.imag()); }
+
+ inline ef_complex operator-(const ef_complex& z, const signed char n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const signed short n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const signed int n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const signed long n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const signed long long n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const unsigned char n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const wchar_t n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const unsigned short n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const unsigned int n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const unsigned long n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const unsigned long long n) { return ef_complex(z.real() - n, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const float f) { return ef_complex(z.real() - f, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const double d) { return ef_complex(z.real() - d, z.imag()); }
+ inline ef_complex operator-(const ef_complex& z, const long double ld) { return ef_complex(z.real() - ld, z.imag()); }
+
+ inline ef_complex operator*(const ef_complex& z, const signed char n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const signed short n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const signed int n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const signed long n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const signed long long n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const unsigned char n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const wchar_t n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const unsigned short n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const unsigned int n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const unsigned long n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const unsigned long long n) { return ef_complex(z.real() * n, z.imag() * n); }
+ inline ef_complex operator*(const ef_complex& z, const float f) { return ef_complex(z.real() * f, z.imag() * f); }
+ inline ef_complex operator*(const ef_complex& z, const double d) { return ef_complex(z.real() * d, z.imag() * d); }
+ inline ef_complex operator*(const ef_complex& z, const long double ld) { return ef_complex(z.real() * ld, z.imag() * ld); }
+
+ inline ef_complex operator/(const ef_complex& z, const signed char n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const signed short n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const signed int n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const signed long n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const signed long long n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const unsigned char n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const wchar_t n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const unsigned short n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const unsigned int n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const unsigned long n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const unsigned long long n) { return ef_complex(z.real() / n, z.imag() / n); }
+ inline ef_complex operator/(const ef_complex& z, const float f) { return ef_complex(z.real() / f, z.imag() / f); }
+ inline ef_complex operator/(const ef_complex& z, const double d) { return ef_complex(z.real() / d, z.imag() / d); }
+ inline ef_complex operator/(const ef_complex& z, const long double ld) { return ef_complex(z.real() / ld, z.imag() / ld); }
+
+ // Global add/sub/mul/div of all built-in types with const ef_complex&.
+ inline ef_complex operator+(const signed char n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const signed short n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const signed int n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const signed long n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const signed long long n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const unsigned char n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const wchar_t n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const unsigned short n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const unsigned int n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const unsigned long n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const unsigned long long n, const ef_complex& v) { return ef_complex(v.real() + n, v.imag()); }
+ inline ef_complex operator+(const float f, const ef_complex& v) { return ef_complex(v.real() + f, v.imag() + f); }
+ inline ef_complex operator+(const double d, const ef_complex& v) { return ef_complex(v.real() + d, v.imag() + d); }
+ inline ef_complex operator+(const long double ld, const ef_complex& v) { return ef_complex(v.real() + ld, v.imag() + ld); }
+
+ inline ef_complex operator-(const signed char n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const signed short n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const signed int n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const signed long n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const signed long long n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const unsigned char n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const wchar_t n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const unsigned short n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const unsigned int n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const unsigned long n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const unsigned long long n, const ef_complex& v) { return ef_complex(n - v.real(), -v.imag()); }
+ inline ef_complex operator-(const float f, const ef_complex& v) { return ef_complex(f - v.real(), -v.imag()); }
+ inline ef_complex operator-(const double d, const ef_complex& v) { return ef_complex(d - v.real(), -v.imag()); }
+ inline ef_complex operator-(const long double ld, const ef_complex& v) { return ef_complex(ld - v.real(), -v.imag()); }
+
+ inline ef_complex operator*(const signed char n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const signed short n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const signed int n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const signed long n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const signed long long n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const unsigned char n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const wchar_t n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const unsigned short n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const unsigned int n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const unsigned long n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const unsigned long long n, const ef_complex& v) { return ef_complex(v.real() * n, v.imag() * n); }
+ inline ef_complex operator*(const float f, const ef_complex& v) { return ef_complex(v.real() * f, v.imag() * f); }
+ inline ef_complex operator*(const double d, const ef_complex& v) { return ef_complex(v.real() * d, v.imag() * d); }
+ inline ef_complex operator*(const long double ld, const ef_complex& v) { return ef_complex(v.real() * ld, v.imag() * ld); }
+
+ inline ef_complex operator/(const signed char n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const signed short n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const signed int n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const signed long n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const signed long long n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const unsigned char n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const wchar_t n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const unsigned short n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const unsigned int n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const unsigned long n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const unsigned long long n, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
+ inline ef_complex operator/(const float f, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((f * v.real()) / v_norm, -(f * v.imag()) / v_norm); }
+ inline ef_complex operator/(const double d, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((d * v.real()) / v_norm, -(d * v.imag()) / v_norm); }
+ inline ef_complex operator/(const long double ld, const ef_complex& v) { const e_float v_norm = v.norm(); return ef_complex((ld * v.real()) / v_norm, -(ld * v.imag()) / v_norm); }
+
+ // Global self add/sub/mul/div of ef_complex& with all built-in types.
+ inline ef_complex& operator+=(ef_complex& z, const signed char n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const signed short n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const signed int n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const signed long n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const signed long long n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const unsigned char n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const wchar_t n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const unsigned short n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const unsigned int n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const unsigned long n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const unsigned long long n) { z.Re += n; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const float f) { z.Re += f; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const double d) { z.Re += d; return z; }
+ inline ef_complex& operator+=(ef_complex& z, const long double ld) { z.Re += ld; return z; }
+
+ inline ef_complex& operator-=(ef_complex& z, const signed char n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const signed short n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const signed int n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const signed long n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const signed long long n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const unsigned char n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const wchar_t n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const unsigned short n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const unsigned int n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const unsigned long n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const unsigned long long n) { z.Re -= n; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const float f) { z.Re -= f; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const double d) { z.Re -= d; return z; }
+ inline ef_complex& operator-=(ef_complex& z, const long double ld) { z.Re -= ld; return z; }
+
+ inline ef_complex& operator*=(ef_complex& z, const signed char n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const signed short n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const signed int n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const signed long n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const signed long long n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const unsigned char n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const wchar_t n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const unsigned short n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const unsigned int n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const unsigned long n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const unsigned long long n) { z.Re *= n; z.Im *= n; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const float f) { z.Re *= f; z.Im *= f; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const double d) { z.Re *= d; z.Im *= d; return z; }
+ inline ef_complex& operator*=(ef_complex& z, const long double ld) { z.Re *= ld; z.Im *= ld; return z; }
+
+ inline ef_complex& operator/=(ef_complex& z, const signed char n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const signed short n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const signed int n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const signed long n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const signed long long n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const unsigned char n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const wchar_t n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const unsigned short n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const unsigned int n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const unsigned long n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const unsigned long long n) { z.Re /= n; z.Im /= n; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const float f) { z.Re /= f; z.Im /= f; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const double d) { z.Re /= d; z.Im /= d; return z; }
+ inline ef_complex& operator/=(ef_complex& z, const long double ld) { z.Re /= ld; z.Im /= ld; return z; }
 
+ // Global self add/sub/mul/div of ef_complex& with const e_float&.
   inline ef_complex& operator+=(ef_complex& z, const e_float& v) { z.Re += v; return z; }
   inline ef_complex& operator-=(ef_complex& z, const e_float& v) { z.Re -= v; return z; }
   inline ef_complex& operator*=(ef_complex& z, const e_float& v) { z.Re *= v; z.Im *= v; return z; }


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