Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74516 - in sandbox/multiprecision/boost: . multiprecision
From: e_float_at_[hidden]
Date: 2011-09-22 13:43:24


Author: christopher_kormanyos
Date: 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
New Revision: 74516
URL: http://svn.boost.org/trac/boost/changeset/74516

Log:
- Correcting the directory structure.
Added:
   sandbox/multiprecision/boost/multiprecision/mp_complex.hpp
      - copied unchanged from r74515, /sandbox/multiprecision/boost/mp_complex.hpp
   sandbox/multiprecision/boost/multiprecision/mp_float.hpp
      - copied unchanged from r74515, /sandbox/multiprecision/boost/mp_float.hpp
   sandbox/multiprecision/boost/multiprecision/mp_float_base.hpp
      - copied unchanged from r74515, /sandbox/multiprecision/boost/mp_float_base.hpp
   sandbox/multiprecision/boost/multiprecision/mp_float_efx.hpp
      - copied unchanged from r74515, /sandbox/multiprecision/boost/mp_float_efx.hpp
   sandbox/multiprecision/boost/multiprecision/mp_float_functions.hpp
      - copied unchanged from r74515, /sandbox/multiprecision/boost/mp_float_functions.hpp
   sandbox/multiprecision/boost/multiprecision/mp_float_gmp.hpp
      - copied unchanged from r74515, /sandbox/multiprecision/boost/mp_float_gmp.hpp
   sandbox/multiprecision/boost/multiprecision/mp_float_mpfr.hpp
      - copied unchanged from r74515, /sandbox/multiprecision/boost/mp_float_mpfr.hpp
Removed:
   sandbox/multiprecision/boost/mp_complex.hpp
   sandbox/multiprecision/boost/mp_float.hpp
   sandbox/multiprecision/boost/mp_float_base.hpp
   sandbox/multiprecision/boost/mp_float_efx.hpp
   sandbox/multiprecision/boost/mp_float_functions.hpp
   sandbox/multiprecision/boost/mp_float_gmp.hpp
   sandbox/multiprecision/boost/mp_float_mpfr.hpp

Deleted: sandbox/multiprecision/boost/mp_complex.hpp
==============================================================================
--- sandbox/multiprecision/boost/mp_complex.hpp 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
+++ (empty file)
@@ -1,499 +0,0 @@
-
-// Copyright Christopher Kormanyos 2002 - 2011.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This work is based on an earlier work:
-// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
-// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
-
-#ifndef _MP_COMPLEX_HPP_
- #define _MP_COMPLEX_HPP_
-
- #include <complex>
-
- #include <boost/multiprecision/mp_float.hpp>
-
- // A separate complex class for mp_float has been created. Even though
- // a generic template class std::complex<T> exists, the C++ specification
- // ISO7IEC 14882:2003 paragraph 26.2/2 indicates that: "The effect of
- // instantiating the template complex<T> for any type other than float,
- // double or long double is unspecified". The strict interpretation thereof
- // disallows both using the template class std::complex<T> with mp_float
- // as well as creating a template specialization for mp_float.
- // Therefore the separate class mp_complex is needed.
-
- namespace boost
- {
- namespace multiprecision
- {
- class mp_complex;
-
- inline mp_complex& operator+=(mp_complex&, const char);
- inline mp_complex& operator+=(mp_complex&, const signed char);
- inline mp_complex& operator+=(mp_complex&, const signed short);
- inline mp_complex& operator+=(mp_complex&, const signed int);
- inline mp_complex& operator+=(mp_complex&, const signed long);
- inline mp_complex& operator+=(mp_complex&, const signed long long);
- inline mp_complex& operator+=(mp_complex&, const unsigned char);
- inline mp_complex& operator+=(mp_complex&, const wchar_t);
- inline mp_complex& operator+=(mp_complex&, const unsigned short);
- inline mp_complex& operator+=(mp_complex&, const unsigned int);
- inline mp_complex& operator+=(mp_complex&, const unsigned long);
- inline mp_complex& operator+=(mp_complex&, const unsigned long long);
- inline mp_complex& operator+=(mp_complex&, const float);
- inline mp_complex& operator+=(mp_complex&, const double);
- inline mp_complex& operator+=(mp_complex&, const long double);
-
- inline mp_complex& operator-=(mp_complex&, const char);
- inline mp_complex& operator-=(mp_complex&, const signed char);
- inline mp_complex& operator-=(mp_complex&, const signed short);
- inline mp_complex& operator-=(mp_complex&, const signed int);
- inline mp_complex& operator-=(mp_complex&, const signed long);
- inline mp_complex& operator-=(mp_complex&, const signed long long);
- inline mp_complex& operator-=(mp_complex&, const unsigned char);
- inline mp_complex& operator-=(mp_complex&, const wchar_t);
- inline mp_complex& operator-=(mp_complex&, const unsigned short);
- inline mp_complex& operator-=(mp_complex&, const unsigned int);
- inline mp_complex& operator-=(mp_complex&, const unsigned long);
- inline mp_complex& operator-=(mp_complex&, const unsigned long long);
- inline mp_complex& operator-=(mp_complex&, const float);
- inline mp_complex& operator-=(mp_complex&, const double);
- inline mp_complex& operator-=(mp_complex&, const long double);
-
- inline mp_complex& operator*=(mp_complex&, const char);
- inline mp_complex& operator*=(mp_complex&, const signed char);
- inline mp_complex& operator*=(mp_complex&, const signed short);
- inline mp_complex& operator*=(mp_complex&, const signed int);
- inline mp_complex& operator*=(mp_complex&, const signed long);
- inline mp_complex& operator*=(mp_complex&, const signed long long);
- inline mp_complex& operator*=(mp_complex&, const unsigned char);
- inline mp_complex& operator*=(mp_complex&, const wchar_t);
- inline mp_complex& operator*=(mp_complex&, const unsigned short);
- inline mp_complex& operator*=(mp_complex&, const unsigned int);
- inline mp_complex& operator*=(mp_complex&, const unsigned long);
- inline mp_complex& operator*=(mp_complex&, const unsigned long long);
- inline mp_complex& operator*=(mp_complex&, const float);
- inline mp_complex& operator*=(mp_complex&, const double);
- inline mp_complex& operator*=(mp_complex&, const long double);
-
- inline mp_complex& operator/=(mp_complex&, const char);
- inline mp_complex& operator/=(mp_complex&, const signed char);
- inline mp_complex& operator/=(mp_complex&, const signed short);
- inline mp_complex& operator/=(mp_complex&, const signed int);
- inline mp_complex& operator/=(mp_complex&, const signed long);
- inline mp_complex& operator/=(mp_complex&, const signed long long);
- inline mp_complex& operator/=(mp_complex&, const unsigned char);
- inline mp_complex& operator/=(mp_complex&, const wchar_t);
- inline mp_complex& operator/=(mp_complex&, const unsigned short);
- inline mp_complex& operator/=(mp_complex&, const unsigned int);
- inline mp_complex& operator/=(mp_complex&, const unsigned long);
- inline mp_complex& operator/=(mp_complex&, const unsigned long long);
- inline mp_complex& operator/=(mp_complex&, const float);
- inline mp_complex& operator/=(mp_complex&, const double);
- inline mp_complex& operator/=(mp_complex&, const long double);
-
- inline mp_complex& operator+=(mp_complex&, const mp_float&);
- inline mp_complex& operator-=(mp_complex&, const mp_float&);
- inline mp_complex& operator*=(mp_complex&, const mp_float&);
- inline mp_complex& operator/=(mp_complex&, const mp_float&);
- }
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- class mp_complex
- {
- private:
- mp_float Re;
- mp_float Im;
-
- public:
- mp_complex(const char n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const signed char n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const unsigned char n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const wchar_t n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const signed short n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const unsigned short n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const signed int n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const unsigned int n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const signed long n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const unsigned long n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const signed long long n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const unsigned long long n) : Re(n), Im(boost::multiprecision::zero()) { }
- mp_complex(const float f) : Re(f), Im(boost::multiprecision::zero()) { }
- mp_complex(const double d) : Re(d), Im(boost::multiprecision::zero()) { }
- mp_complex(const long double ld) : Re(ld), Im(boost::multiprecision::zero()) { }
-
- explicit mp_complex(const char* const s) : Re(s), Im(boost::multiprecision::zero()) { }
- explicit mp_complex(const std::string& str) : Re(str), Im(boost::multiprecision::zero()) { }
-
- mp_complex() : Re(boost::multiprecision::zero()), Im(boost::multiprecision::zero()) { }
- mp_complex(const mp_float& re) : Re(re), Im(boost::multiprecision::zero()) { }
- mp_complex(const mp_float& re, const mp_float& im) : Re(re), Im(im) { }
- mp_complex(const mp_complex& z) : Re(z.Re), Im(z.Im) { }
-
- mp_float real(void) const { return Re; }
- mp_float imag(void) const { return Im; }
-
- static mp_float real(const mp_complex& z) { return z.Re; }
- static mp_float imag(const mp_complex& z) { return z.Im; }
-
- mp_float norm(void) const { return (Re * Re) + (Im * Im); }
-
- mp_complex& operator=(const mp_complex& v) { Re = v.Re; Im = v.Im; return *this; }
- mp_complex& operator=(const mp_float& v) { Re = v; Im = boost::multiprecision::zero(); return *this; }
-
- mp_complex& operator+=(const mp_complex& v) { Re += v.Re; Im += v.Im; return *this; }
- mp_complex& operator-=(const mp_complex& v) { Re -= v.Re; Im -= v.Im; return *this; }
-
- mp_complex& operator*=(const mp_complex& v)
- {
- const mp_float tmp_re = (Re * v.Re) - (Im * v.Im);
- const mp_float tmp_im = (Re * v.Im) + (Im * v.Re);
- Re = tmp_re;
- Im = tmp_im;
- return *this;
- }
-
- mp_complex& operator/=(const mp_complex& v)
- {
- const mp_float one_over_denom = boost::multiprecision::one() / v.norm();
- const mp_float tmp_re = ((Re * v.Re) + (Im * v.Im)) * one_over_denom;
- const mp_float tmp_im = ((Im * v.Re) - (Re * v.Im)) * one_over_denom;
- Re = tmp_re;
- Im = tmp_im;
- return *this;
- }
-
- // Operators pre-increment and pre-decrement
- const mp_complex& operator++(void) { ++Re; return *this; }
- const mp_complex& operator--(void) { --Re; return *this; }
-
- bool isnan (void) const { return Re.isnan() || Im.isnan(); }
- bool isinf (void) const { return Re.isinf() || Im.isinf(); }
- bool isfinite(void) const { return Re.isfinite() && Im.isfinite(); }
- bool isneg (void) const { return Re.isneg(); }
- bool ispos (void) const { return Re.ispos(); }
- 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 mp_complex& operator+=(mp_complex&, const char);
- friend inline mp_complex& operator+=(mp_complex&, const signed char);
- friend inline mp_complex& operator+=(mp_complex&, const signed short);
- friend inline mp_complex& operator+=(mp_complex&, const signed int);
- friend inline mp_complex& operator+=(mp_complex&, const signed long);
- friend inline mp_complex& operator+=(mp_complex&, const signed long long);
- friend inline mp_complex& operator+=(mp_complex&, const unsigned char);
- friend inline mp_complex& operator+=(mp_complex&, const wchar_t);
- friend inline mp_complex& operator+=(mp_complex&, const unsigned short);
- friend inline mp_complex& operator+=(mp_complex&, const unsigned int);
- friend inline mp_complex& operator+=(mp_complex&, const unsigned long);
- friend inline mp_complex& operator+=(mp_complex&, const unsigned long long);
- friend inline mp_complex& operator+=(mp_complex&, const float);
- friend inline mp_complex& operator+=(mp_complex&, const double);
- friend inline mp_complex& operator+=(mp_complex&, const long double);
-
- friend inline mp_complex& operator-=(mp_complex&, const char);
- friend inline mp_complex& operator-=(mp_complex&, const signed char);
- friend inline mp_complex& operator-=(mp_complex&, const signed short);
- friend inline mp_complex& operator-=(mp_complex&, const signed int);
- friend inline mp_complex& operator-=(mp_complex&, const signed long);
- friend inline mp_complex& operator-=(mp_complex&, const signed long long);
- friend inline mp_complex& operator-=(mp_complex&, const unsigned char);
- friend inline mp_complex& operator-=(mp_complex&, const wchar_t);
- friend inline mp_complex& operator-=(mp_complex&, const unsigned short);
- friend inline mp_complex& operator-=(mp_complex&, const unsigned int);
- friend inline mp_complex& operator-=(mp_complex&, const unsigned long);
- friend inline mp_complex& operator-=(mp_complex&, const unsigned long long);
- friend inline mp_complex& operator-=(mp_complex&, const float);
- friend inline mp_complex& operator-=(mp_complex&, const double);
- friend inline mp_complex& operator-=(mp_complex&, const long double);
-
- friend inline mp_complex& operator*=(mp_complex&, const char);
- friend inline mp_complex& operator*=(mp_complex&, const signed char);
- friend inline mp_complex& operator*=(mp_complex&, const signed short);
- friend inline mp_complex& operator*=(mp_complex&, const signed int);
- friend inline mp_complex& operator*=(mp_complex&, const signed long);
- friend inline mp_complex& operator*=(mp_complex&, const signed long long);
- friend inline mp_complex& operator*=(mp_complex&, const unsigned char);
- friend inline mp_complex& operator*=(mp_complex&, const wchar_t);
- friend inline mp_complex& operator*=(mp_complex&, const unsigned short);
- friend inline mp_complex& operator*=(mp_complex&, const unsigned int);
- friend inline mp_complex& operator*=(mp_complex&, const unsigned long);
- friend inline mp_complex& operator*=(mp_complex&, const unsigned long long);
- friend inline mp_complex& operator*=(mp_complex&, const float);
- friend inline mp_complex& operator*=(mp_complex&, const double);
- friend inline mp_complex& operator*=(mp_complex&, const long double);
-
- friend inline mp_complex& operator/=(mp_complex&, const char);
- friend inline mp_complex& operator/=(mp_complex&, const signed char);
- friend inline mp_complex& operator/=(mp_complex&, const signed short);
- friend inline mp_complex& operator/=(mp_complex&, const signed int);
- friend inline mp_complex& operator/=(mp_complex&, const signed long);
- friend inline mp_complex& operator/=(mp_complex&, const signed long long);
- friend inline mp_complex& operator/=(mp_complex&, const unsigned char);
- friend inline mp_complex& operator/=(mp_complex&, const wchar_t);
- friend inline mp_complex& operator/=(mp_complex&, const unsigned short);
- friend inline mp_complex& operator/=(mp_complex&, const unsigned int);
- friend inline mp_complex& operator/=(mp_complex&, const unsigned long);
- friend inline mp_complex& operator/=(mp_complex&, const unsigned long long);
- friend inline mp_complex& operator/=(mp_complex&, const float);
- friend inline mp_complex& operator/=(mp_complex&, const double);
- friend inline mp_complex& operator/=(mp_complex&, const long double);
-
- friend inline mp_complex& operator+=(mp_complex&, const mp_float&);
- friend inline mp_complex& operator-=(mp_complex&, const mp_float&);
- friend inline mp_complex& operator*=(mp_complex&, const mp_float&);
- friend inline mp_complex& operator/=(mp_complex&, const mp_float&);
- };
- }
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- // Operations with I/O streams.
- std::basic_ostream<char, std::char_traits<char> >& operator<<(std::basic_ostream<char, std::char_traits<char> >&, const mp_complex&);
- std::basic_istream<char, std::char_traits<char> >& operator>>(std::basic_istream<char, std::char_traits<char> >&, mp_complex&);
-
- // Global unary operators of mp_float reference.
- inline mp_complex operator-(const mp_complex& u) { return mp_complex(-u.real(), -u.imag()); }
- inline mp_complex& operator+( mp_complex& u) { return u; }
- inline const mp_complex& operator+(const mp_complex& u) { return u; }
-
- // Global operators post-increment and post-decrement
- inline mp_complex operator++(mp_complex& u, int) { const mp_complex v(u); ++u; return v; }
- inline mp_complex operator--(mp_complex& u, int) { const mp_complex v(u); --u; return v; }
-
- // Global comparison operators
- inline bool operator==(const mp_complex& u, const mp_complex& v) { return (u.real() == v.real()) && (u.imag() == v.imag()); }
- inline bool operator!=(const mp_complex& u, const mp_complex& v) { return (u.real() != v.real()) || (u.imag() != v.imag()); }
-
- // Global arithmetic operators with const mp_complex& and const mp_complex&.
- inline mp_complex operator+(const mp_complex& u, const mp_complex& v) { return mp_complex(u) += v; }
- inline mp_complex operator-(const mp_complex& u, const mp_complex& v) { return mp_complex(u) -= v; }
- inline mp_complex operator*(const mp_complex& u, const mp_complex& v) { return mp_complex(u) *= v; }
- inline mp_complex operator/(const mp_complex& u, const mp_complex& v) { return mp_complex(u) /= v; }
-
- // Global arithmetic operators with const mp_complex& and const mp_float&.
- inline mp_complex operator+(const mp_complex& u, const mp_float& v) { return mp_complex(u.real() + v, u.imag()); }
- inline mp_complex operator-(const mp_complex& u, const mp_float& v) { return mp_complex(u.real() - v, u.imag()); }
- inline mp_complex operator*(const mp_complex& u, const mp_float& v) { return mp_complex(u.real() * v, u.imag() * v); }
- inline mp_complex operator/(const mp_complex& u, const mp_float& v) { return mp_complex(u.real() / v, u.imag() / v); }
-
- // Global arithmetic operators with const mp_float& and const mp_complex&.
- inline mp_complex operator+(const mp_float& u, const mp_complex& v) { return mp_complex(u + v.real(), v.imag()); }
- inline mp_complex operator-(const mp_float& u, const mp_complex& v) { return mp_complex(u - v.real(), -v.imag()); }
- inline mp_complex operator*(const mp_float& u, const mp_complex& v) { return mp_complex(u * v.real(), u * v.imag()); }
- inline mp_complex operator/(const mp_float& u, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((u * v.real()) / v_norm, (-u * v.imag()) / v_norm); }
-
- // Global add/sub/mul/div of const mp_complex& with all built-in types.
- inline mp_complex operator+(const mp_complex& z, const char n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const signed char n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const signed short n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const signed int n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const signed long n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const signed long long n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const unsigned char n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const wchar_t n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const unsigned short n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const unsigned int n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const unsigned long n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const unsigned long long n) { return mp_complex(z.real() + n, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const float f) { return mp_complex(z.real() + f, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const double d) { return mp_complex(z.real() + d, z.imag()); }
- inline mp_complex operator+(const mp_complex& z, const long double ld) { return mp_complex(z.real() + ld, z.imag()); }
-
- inline mp_complex operator-(const mp_complex& z, const char n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const signed char n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const signed short n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const signed int n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const signed long n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const signed long long n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const unsigned char n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const wchar_t n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const unsigned short n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const unsigned int n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const unsigned long n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const unsigned long long n) { return mp_complex(z.real() - n, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const float f) { return mp_complex(z.real() - f, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const double d) { return mp_complex(z.real() - d, z.imag()); }
- inline mp_complex operator-(const mp_complex& z, const long double ld) { return mp_complex(z.real() - ld, z.imag()); }
-
- inline mp_complex operator*(const mp_complex& z, const char n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const signed char n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const signed short n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const signed int n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const signed long n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const signed long long n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const unsigned char n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const wchar_t n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const unsigned short n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const unsigned int n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const unsigned long n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const unsigned long long n) { return mp_complex(z.real() * n, z.imag() * n); }
- inline mp_complex operator*(const mp_complex& z, const float f) { return mp_complex(z.real() * f, z.imag() * f); }
- inline mp_complex operator*(const mp_complex& z, const double d) { return mp_complex(z.real() * d, z.imag() * d); }
- inline mp_complex operator*(const mp_complex& z, const long double ld) { return mp_complex(z.real() * ld, z.imag() * ld); }
-
- inline mp_complex operator/(const mp_complex& z, const char n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const signed char n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const signed short n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const signed int n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const signed long n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const signed long long n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const unsigned char n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const wchar_t n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const unsigned short n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const unsigned int n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const unsigned long n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const unsigned long long n) { return mp_complex(z.real() / n, z.imag() / n); }
- inline mp_complex operator/(const mp_complex& z, const float f) { return mp_complex(z.real() / f, z.imag() / f); }
- inline mp_complex operator/(const mp_complex& z, const double d) { return mp_complex(z.real() / d, z.imag() / d); }
- inline mp_complex operator/(const mp_complex& z, const long double ld) { return mp_complex(z.real() / ld, z.imag() / ld); }
-
- // Global add/sub/mul/div of all built-in types with const mp_complex&.
- inline mp_complex operator+(const char n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const signed char n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const signed short n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const signed int n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const signed long n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const signed long long n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const unsigned char n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const wchar_t n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const unsigned short n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const unsigned int n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const unsigned long n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const unsigned long long n, const mp_complex& v) { return mp_complex(v.real() + n, v.imag()); }
- inline mp_complex operator+(const float f, const mp_complex& v) { return mp_complex(v.real() + f, v.imag() + f); }
- inline mp_complex operator+(const double d, const mp_complex& v) { return mp_complex(v.real() + d, v.imag() + d); }
- inline mp_complex operator+(const long double ld, const mp_complex& v) { return mp_complex(v.real() + ld, v.imag() + ld); }
-
- inline mp_complex operator-(const char n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const signed char n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const signed short n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const signed int n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const signed long n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const signed long long n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const unsigned char n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const wchar_t n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const unsigned short n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const unsigned int n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const unsigned long n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const unsigned long long n, const mp_complex& v) { return mp_complex(n - v.real(), -v.imag()); }
- inline mp_complex operator-(const float f, const mp_complex& v) { return mp_complex(f - v.real(), -v.imag()); }
- inline mp_complex operator-(const double d, const mp_complex& v) { return mp_complex(d - v.real(), -v.imag()); }
- inline mp_complex operator-(const long double ld, const mp_complex& v) { return mp_complex(ld - v.real(), -v.imag()); }
-
- inline mp_complex operator*(const char n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const signed char n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const signed short n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const signed int n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const signed long n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const signed long long n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const unsigned char n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const wchar_t n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const unsigned short n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const unsigned int n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const unsigned long n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const unsigned long long n, const mp_complex& v) { return mp_complex(v.real() * n, v.imag() * n); }
- inline mp_complex operator*(const float f, const mp_complex& v) { return mp_complex(v.real() * f, v.imag() * f); }
- inline mp_complex operator*(const double d, const mp_complex& v) { return mp_complex(v.real() * d, v.imag() * d); }
- inline mp_complex operator*(const long double ld, const mp_complex& v) { return mp_complex(v.real() * ld, v.imag() * ld); }
-
- inline mp_complex operator/(const char n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const signed char n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const signed short n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const signed int n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const signed long n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const signed long long n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const unsigned char n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const wchar_t n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const unsigned short n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const unsigned int n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const unsigned long n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const unsigned long long n, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((n * v.real()) / v_norm, -(n * v.imag()) / v_norm); }
- inline mp_complex operator/(const float f, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((f * v.real()) / v_norm, -(f * v.imag()) / v_norm); }
- inline mp_complex operator/(const double d, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((d * v.real()) / v_norm, -(d * v.imag()) / v_norm); }
- inline mp_complex operator/(const long double ld, const mp_complex& v) { const mp_float v_norm = v.norm(); return mp_complex((ld * v.real()) / v_norm, -(ld * v.imag()) / v_norm); }
-
- // Global self add/sub/mul/div of mp_complex& with all built-in types.
- inline mp_complex& operator+=(mp_complex& z, const char n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const signed char n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const signed short n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const signed int n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const signed long n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const signed long long n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const unsigned char n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const wchar_t n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const unsigned short n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const unsigned int n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const unsigned long n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const unsigned long long n) { z.Re += n; return z; }
- inline mp_complex& operator+=(mp_complex& z, const float f) { z.Re += f; return z; }
- inline mp_complex& operator+=(mp_complex& z, const double d) { z.Re += d; return z; }
- inline mp_complex& operator+=(mp_complex& z, const long double ld) { z.Re += ld; return z; }
-
- inline mp_complex& operator-=(mp_complex& z, const char n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const signed char n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const signed short n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const signed int n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const signed long n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const signed long long n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const unsigned char n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const wchar_t n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const unsigned short n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const unsigned int n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const unsigned long n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const unsigned long long n) { z.Re -= n; return z; }
- inline mp_complex& operator-=(mp_complex& z, const float f) { z.Re -= f; return z; }
- inline mp_complex& operator-=(mp_complex& z, const double d) { z.Re -= d; return z; }
- inline mp_complex& operator-=(mp_complex& z, const long double ld) { z.Re -= ld; return z; }
-
- inline mp_complex& operator*=(mp_complex& z, const char n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const signed char n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const signed short n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const signed int n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const signed long n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const signed long long n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const unsigned char n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const wchar_t n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const unsigned short n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const unsigned int n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const unsigned long n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const unsigned long long n) { z.Re *= n; z.Im *= n; return z; }
- inline mp_complex& operator*=(mp_complex& z, const float f) { z.Re *= f; z.Im *= f; return z; }
- inline mp_complex& operator*=(mp_complex& z, const double d) { z.Re *= d; z.Im *= d; return z; }
- inline mp_complex& operator*=(mp_complex& z, const long double ld) { z.Re *= ld; z.Im *= ld; return z; }
-
- inline mp_complex& operator/=(mp_complex& z, const char n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const signed char n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const signed short n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const signed int n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const signed long n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const signed long long n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const unsigned char n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const wchar_t n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const unsigned short n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const unsigned int n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const unsigned long n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const unsigned long long n) { z.Re /= n; z.Im /= n; return z; }
- inline mp_complex& operator/=(mp_complex& z, const float f) { z.Re /= f; z.Im /= f; return z; }
- inline mp_complex& operator/=(mp_complex& z, const double d) { z.Re /= d; z.Im /= d; return z; }
- inline mp_complex& operator/=(mp_complex& z, const long double ld) { z.Re /= ld; z.Im /= ld; return z; }
-
- // Global self add/sub/mul/div of mp_complex& with const mp_float&.
- inline mp_complex& operator+=(mp_complex& z, const mp_float& v) { z.Re += v; return z; }
- inline mp_complex& operator-=(mp_complex& z, const mp_float& v) { z.Re -= v; return z; }
- inline mp_complex& operator*=(mp_complex& z, const mp_float& v) { z.Re *= v; z.Im *= v; return z; }
- inline mp_complex& operator/=(mp_complex& z, const mp_float& v) { z.Re /= v; z.Im /= v; return z; }
- }
- }
-
-#endif // _MP_COMPLEX_HPP_

Deleted: sandbox/multiprecision/boost/mp_float.hpp
==============================================================================
--- sandbox/multiprecision/boost/mp_float.hpp 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
+++ (empty file)
@@ -1,522 +0,0 @@
-
-// Copyright Christopher Kormanyos 2002 - 2011.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This work is based on an earlier work:
-// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
-// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
-
-#ifndef _MP_FLOAT_2004_02_08_HPP_
- #define _MP_FLOAT_2004_02_08_HPP_
-
- #include <limits>
-
- // Select the mp_float back-end big-number type
- // by defining BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_TYPE_xxx, for example,
- // as a compiler defined preprocessor macro.
-
- #if defined(BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_TYPE_EFX)
- #include <boost/multiprecision/mp_float_efx.hpp>
- #elif defined(BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_TYPE_GMP)
- #include <boost/multiprecision/mp_float_gmp.hpp>
- #elif defined(BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_TYPE_MPFR)
- #include <boost/multiprecision/mp_float_mpfr.hpp>
- #else
- #error mp_float type undefined!
- #endif
-
- namespace boost
- {
- namespace multiprecision
- {
- const mp_float& zero (void);
- const mp_float& one (void);
- const mp_float& half (void);
- const mp_float& value_min(void);
- const mp_float& value_max(void);
- const mp_float& value_eps(void);
- const mp_float& value_inf(void);
- const mp_float& value_nan(void);
- }
- }
-
- // Specialization of std::numeric_limits<mp_float>.
- namespace std
- {
- template <> class numeric_limits<boost::multiprecision::mp_float>
- {
- public:
- static const bool is_specialized = true;
- static const bool is_signed = true;
- static const bool is_integer = false;
- static const bool is_exact = false;
- static const bool is_bounded = true;
- static const bool is_modulo = false;
- static const bool is_iec559 = false;
- static const int digits = boost::multiprecision::mp_float::mp_float_digits;
- static const int digits10 = boost::multiprecision::mp_float::mp_float_digits10;
- static const int max_digits10 = boost::multiprecision::mp_float::mp_float_max_digits10;
- static const boost::int64_t min_exponent = boost::multiprecision::mp_float::mp_float_min_exp; // Type differs from int.
- static const boost::int64_t min_exponent10 = boost::multiprecision::mp_float::mp_float_min_exp10; // Type differs from int.
- static const boost::int64_t max_exponent = boost::multiprecision::mp_float::mp_float_max_exp; // Type differs from int.
- static const boost::int64_t max_exponent10 = boost::multiprecision::mp_float::mp_float_max_exp10; // Type differs from int.
- static const int radix = boost::multiprecision::mp_float::mp_radix;
- static const std::float_round_style round_style = std::round_to_nearest;
- static const bool has_infinity = true;
- static const bool has_quiet_NaN = true;
- static const bool has_signaling_NaN = false;
- static const std::float_denorm_style has_denorm = std::denorm_absent;
- static const bool has_denorm_loss = false;
- static const bool traps = false;
- static const bool tinyness_before = false;
-
- static const boost::multiprecision::mp_float& (min) (void) throw() { return boost::multiprecision::value_min(); }
- static const boost::multiprecision::mp_float& (max) (void) throw() { return boost::multiprecision::value_max(); }
- static const boost::multiprecision::mp_float& lowest (void) throw() { return boost::multiprecision::zero(); }
- static const boost::multiprecision::mp_float& epsilon (void) throw() { return boost::multiprecision::value_eps(); }
- static const boost::multiprecision::mp_float& round_error (void) throw() { return boost::multiprecision::half(); }
- static const boost::multiprecision::mp_float& infinity (void) throw() { return boost::multiprecision::value_inf(); }
- static const boost::multiprecision::mp_float& quiet_NaN (void) throw() { return boost::multiprecision::value_nan(); }
- static const boost::multiprecision::mp_float& signaling_NaN(void) throw() { return boost::multiprecision::zero(); }
- static const boost::multiprecision::mp_float& denorm_min (void) throw() { return boost::multiprecision::zero(); }
- };
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- // Global operators post-increment and post-decrement.
- inline mp_float operator++(mp_float& u, int) { const mp_float v(u); ++u; return v; }
- inline mp_float operator--(mp_float& u, int) { const mp_float v(u); --u; return v; }
-
- // Global unary operators of mp_float reference.
- inline mp_float operator-(const mp_float& u) { return mp_float(u).negate(); }
- inline mp_float& operator+( mp_float& u) { return u; }
- inline const mp_float& operator+(const mp_float& u) { return u; }
-
- // Global add/sub/mul/div of const mp_float& with const mp_float&.
- inline mp_float operator+(const mp_float& u, const mp_float& v) { return mp_float(u) += v; }
- inline mp_float operator-(const mp_float& u, const mp_float& v) { return mp_float(u) -= v; }
- inline mp_float operator*(const mp_float& u, const mp_float& v) { return mp_float(u) *= v; }
- inline mp_float operator/(const mp_float& u, const mp_float& v) { return mp_float(u) /= v; }
-
- // Global add/sub/mul/div of const mp_float& with all built-in types.
- inline mp_float operator+(const mp_float& u, const char n) { return ((!std::numeric_limits<char>::is_signed) ? mp_float(u).add_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).add_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator+(const mp_float& u, const signed char n) { return mp_float(u).add_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator+(const mp_float& u, const signed short n) { return mp_float(u).add_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator+(const mp_float& u, const signed int n) { return mp_float(u).add_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator+(const mp_float& u, const signed long n) { return mp_float(u).add_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator+(const mp_float& u, const signed long long n) { return mp_float(u).add_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator+(const mp_float& u, const unsigned char n) { return mp_float(u).add_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator+(const mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? mp_float(u).add_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).add_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator+(const mp_float& u, const unsigned short n) { return mp_float(u).add_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator+(const mp_float& u, const unsigned int n) { return mp_float(u).add_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator+(const mp_float& u, const unsigned long n) { return mp_float(u).add_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator+(const mp_float& u, const unsigned long long n) { return mp_float(u).add_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator+(const mp_float& u, const float f) { return mp_float(u) += mp_float(f); }
- inline mp_float operator+(const mp_float& u, const double d) { return mp_float(u) += mp_float(d); }
- inline mp_float operator+(const mp_float& u, const long double ld) { return mp_float(u) += mp_float(ld); }
-
- inline mp_float operator-(const mp_float& u, const char n) { return ((!std::numeric_limits<char>::is_signed) ? mp_float(u).sub_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).sub_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator-(const mp_float& u, const signed char n) { return mp_float(u).sub_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator-(const mp_float& u, const signed short n) { return mp_float(u).sub_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator-(const mp_float& u, const signed int n) { return mp_float(u).sub_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator-(const mp_float& u, const signed long n) { return mp_float(u).sub_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator-(const mp_float& u, const signed long long n) { return mp_float(u).sub_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator-(const mp_float& u, const unsigned char n) { return mp_float(u).sub_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator-(const mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? mp_float(u).sub_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).sub_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator-(const mp_float& u, const unsigned short n) { return mp_float(u).sub_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator-(const mp_float& u, const unsigned int n) { return mp_float(u).sub_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator-(const mp_float& u, const unsigned long n) { return mp_float(u).sub_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator-(const mp_float& u, const unsigned long long n) { return mp_float(u).sub_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator-(const mp_float& u, const float f) { return mp_float(u) -= mp_float(f); }
- inline mp_float operator-(const mp_float& u, const double d) { return mp_float(u) -= mp_float(d); }
- inline mp_float operator-(const mp_float& u, const long double ld) { return mp_float(u) -= mp_float(ld); }
-
- inline mp_float operator*(const mp_float& u, const char n) { return ((!std::numeric_limits<char>::is_signed) ? mp_float(u).mul_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).mul_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator*(const mp_float& u, const signed char n) { return mp_float(u).mul_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator*(const mp_float& u, const signed short n) { return mp_float(u).mul_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator*(const mp_float& u, const signed int n) { return mp_float(u).mul_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator*(const mp_float& u, const signed long n) { return mp_float(u).mul_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator*(const mp_float& u, const signed long long n) { return mp_float(u).mul_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator*(const mp_float& u, const unsigned char n) { return mp_float(u).mul_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator*(const mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? mp_float(u).mul_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).mul_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator*(const mp_float& u, const unsigned short n) { return mp_float(u).mul_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator*(const mp_float& u, const unsigned int n) { return mp_float(u).mul_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator*(const mp_float& u, const unsigned long n) { return mp_float(u).mul_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator*(const mp_float& u, const unsigned long long n) { return mp_float(u).mul_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator*(const mp_float& u, const float f) { return mp_float(u) *= mp_float(f); }
- inline mp_float operator*(const mp_float& u, const double d) { return mp_float(u) *= mp_float(d); }
- inline mp_float operator*(const mp_float& u, const long double ld) { return mp_float(u) *= mp_float(ld); }
-
- inline mp_float operator/(const mp_float& u, const char n) { return ((!std::numeric_limits<char>::is_signed) ? mp_float(u).div_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).div_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator/(const mp_float& u, const signed char n) { return mp_float(u).div_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator/(const mp_float& u, const signed short n) { return mp_float(u).div_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator/(const mp_float& u, const signed int n) { return mp_float(u).div_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator/(const mp_float& u, const signed long n) { return mp_float(u).div_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator/(const mp_float& u, const signed long long n) { return mp_float(u).div_signed_long_long(static_cast<signed long long>(n)); }
- inline mp_float operator/(const mp_float& u, const unsigned char n) { return mp_float(u).div_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator/(const mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? mp_float(u).div_unsigned_long_long(static_cast<unsigned long long>(n)) : mp_float(u).div_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float operator/(const mp_float& u, const unsigned short n) { return mp_float(u).div_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator/(const mp_float& u, const unsigned int n) { return mp_float(u).div_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator/(const mp_float& u, const unsigned long n) { return mp_float(u).div_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator/(const mp_float& u, const unsigned long long n) { return mp_float(u).div_unsigned_long_long(static_cast<unsigned long long>(n)); }
- inline mp_float operator/(const mp_float& u, const float f) { return mp_float(u) /= mp_float(f); }
- inline mp_float operator/(const mp_float& u, const double d) { return mp_float(u) /= mp_float(d); }
- inline mp_float operator/(const mp_float& u, const long double ld) { return mp_float(u) /= mp_float(ld); }
-
- // Global add/sub/mul/div of all built-in types with const mp_float&.
- inline mp_float operator+(const char n, const mp_float& u) { return ((!std::numeric_limits<char>::is_signed) ? mp_float(u).add_unsigned_long_long(n) : mp_float(u).add_signed_long_long(n)); }
- inline mp_float operator+(const signed char n, const mp_float& u) { return mp_float(u).add_signed_long_long(n); }
- inline mp_float operator+(const signed short n, const mp_float& u) { return mp_float(u).add_signed_long_long(n); }
- inline mp_float operator+(const signed int n, const mp_float& u) { return mp_float(u).add_signed_long_long(n); }
- inline mp_float operator+(const signed long n, const mp_float& u) { return mp_float(u).add_signed_long_long(n); }
- inline mp_float operator+(const signed long long n, const mp_float& u) { return mp_float(u).add_signed_long_long(n); }
- inline mp_float operator+(const unsigned char n, const mp_float& u) { return mp_float(u).add_unsigned_long_long(n); }
- inline mp_float operator+(const wchar_t n, const mp_float& u) { return ((!std::numeric_limits<wchar_t>::is_signed) ? mp_float(u).add_unsigned_long_long(n) : mp_float(u).add_signed_long_long(n)); }
- inline mp_float operator+(const unsigned short n, const mp_float& u) { return mp_float(u).add_unsigned_long_long(n); }
- inline mp_float operator+(const unsigned int n, const mp_float& u) { return mp_float(u).add_unsigned_long_long(n); }
- inline mp_float operator+(const unsigned long n, const mp_float& u) { return mp_float(u).add_unsigned_long_long(n); }
- inline mp_float operator+(const unsigned long long n, const mp_float& u) { return mp_float(u).add_unsigned_long_long(n); }
- inline mp_float operator+(const float f, const mp_float& u) { return mp_float(f) += u; }
- inline mp_float operator+(const double d, const mp_float& u) { return mp_float(d) += u; }
- inline mp_float operator+(const long double ld, const mp_float& u) { return mp_float(ld) += u; }
-
- inline mp_float operator-(const char n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const signed char n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const signed short n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const signed int n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const signed long n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const signed long long n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const unsigned char n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const wchar_t n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const unsigned short n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const unsigned int n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const unsigned long n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const unsigned long long n, const mp_float& u) { return mp_float(n) -= u; }
- inline mp_float operator-(const float f, const mp_float& u) { return mp_float(f) -= u; }
- inline mp_float operator-(const double d, const mp_float& u) { return mp_float(d) -= u; }
- inline mp_float operator-(const long double ld, const mp_float& u) { return mp_float(ld) -= u; }
-
- inline mp_float operator*(const char n, const mp_float& u) { return ((!std::numeric_limits<char>::is_signed) ? mp_float(u).mul_unsigned_long_long(n) : mp_float(u).mul_signed_long_long(n)); }
- inline mp_float operator*(const signed char n, const mp_float& u) { return mp_float(u).mul_signed_long_long(n); }
- inline mp_float operator*(const signed short n, const mp_float& u) { return mp_float(u).mul_signed_long_long(n); }
- inline mp_float operator*(const signed int n, const mp_float& u) { return mp_float(u).mul_signed_long_long(n); }
- inline mp_float operator*(const signed long n, const mp_float& u) { return mp_float(u).mul_signed_long_long(n); }
- inline mp_float operator*(const signed long long n, const mp_float& u) { return mp_float(u).mul_signed_long_long(n); }
- inline mp_float operator*(const unsigned char n, const mp_float& u) { return mp_float(u).mul_unsigned_long_long(n); }
- inline mp_float operator*(const wchar_t n, const mp_float& u) { return ((!std::numeric_limits<wchar_t>::is_signed) ? mp_float(u).mul_unsigned_long_long(n) : mp_float(u).mul_signed_long_long(n)); }
- inline mp_float operator*(const unsigned short n, const mp_float& u) { return mp_float(u).mul_unsigned_long_long(n); }
- inline mp_float operator*(const unsigned int n, const mp_float& u) { return mp_float(u).mul_unsigned_long_long(n); }
- inline mp_float operator*(const unsigned long n, const mp_float& u) { return mp_float(u).mul_unsigned_long_long(n); }
- inline mp_float operator*(const unsigned long long n, const mp_float& u) { return mp_float(u).mul_unsigned_long_long(n); }
- inline mp_float operator*(const float f, const mp_float& u) { return mp_float(f) *= u; }
- inline mp_float operator*(const double d, const mp_float& u) { return mp_float(d) *= u; }
- inline mp_float operator*(const long double ld, const mp_float& u) { return mp_float(ld) *= u; }
-
- inline mp_float operator/(const char n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const signed char n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const signed short n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const signed int n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const signed long n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const signed long long n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const unsigned char n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const wchar_t n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const unsigned short n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const unsigned int n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const unsigned long n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const unsigned long long n, const mp_float& u) { return mp_float(n) /= u; }
- inline mp_float operator/(const float f, const mp_float& u) { return mp_float(f) /= u; }
- inline mp_float operator/(const double d, const mp_float& u) { return mp_float(d) /= u; }
- inline mp_float operator/(const long double ld, const mp_float& u) { return mp_float(ld) /= u; }
-
- // Global self add/sub/mul/div of mp_float& with all built-in types.
- inline mp_float& operator+=(mp_float& u, const char n) { return ((!std::numeric_limits<char>::is_signed) ? u.add_unsigned_long_long(static_cast<unsigned long long>(n)) : u.add_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator+=(mp_float& u, const signed char n) { return u.add_signed_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const signed short n) { return u.add_signed_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const signed int n) { return u.add_signed_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const signed long n) { return u.add_signed_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const signed long long n) { return u.add_signed_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const unsigned char n) { return u.add_unsigned_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? u.add_unsigned_long_long(static_cast<unsigned long long>(n)) : u.add_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator+=(mp_float& u, const unsigned short n) { return u.add_unsigned_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const unsigned int n) { return u.add_unsigned_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const unsigned long n) { return u.add_unsigned_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const unsigned long long n) { return u.add_unsigned_long_long(n); }
- inline mp_float& operator+=(mp_float& u, const float f) { return u += mp_float(f); }
- inline mp_float& operator+=(mp_float& u, const double d) { return u += mp_float(d); }
- inline mp_float& operator+=(mp_float& u, const long double ld) { return u += mp_float(ld); }
-
- inline mp_float& operator-=(mp_float& u, const signed char n) { return ((!std::numeric_limits<char>::is_signed) ? u.sub_unsigned_long_long(static_cast<unsigned long long>(n)) : u.sub_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator-=(mp_float& u, const signed short n) { return u.sub_signed_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const signed int n) { return u.sub_signed_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const signed long n) { return u.sub_signed_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const signed long long n) { return u.sub_signed_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const unsigned char n) { return u.sub_unsigned_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? u.sub_unsigned_long_long(static_cast<unsigned long long>(n)) : u.sub_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator-=(mp_float& u, const unsigned short n) { return u.sub_unsigned_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const unsigned int n) { return u.sub_unsigned_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const unsigned long n) { return u.sub_unsigned_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const unsigned long long n) { return u.sub_unsigned_long_long(n); }
- inline mp_float& operator-=(mp_float& u, const float f) { return u -= mp_float(f); }
- inline mp_float& operator-=(mp_float& u, const double d) { return u -= mp_float(d); }
- inline mp_float& operator-=(mp_float& u, const long double ld) { return u -= mp_float(ld); }
-
- inline mp_float& operator*=(mp_float& u, const char n) { return ((!std::numeric_limits<char>::is_signed) ? u.mul_unsigned_long_long(static_cast<unsigned long long>(n)) : u.mul_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator*=(mp_float& u, const signed char n) { return u.mul_signed_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const signed short n) { return u.mul_signed_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const signed int n) { return u.mul_signed_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const signed long n) { return u.mul_signed_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const signed long long n) { return u.mul_signed_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const unsigned char n) { return u.mul_unsigned_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? u.mul_unsigned_long_long(static_cast<unsigned long long>(n)) : u.mul_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator*=(mp_float& u, const unsigned short n) { return u.mul_unsigned_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const unsigned int n) { return u.mul_unsigned_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const unsigned long n) { return u.mul_unsigned_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const unsigned long long n) { return u.mul_unsigned_long_long(n); }
- inline mp_float& operator*=(mp_float& u, const float f) { return u *= mp_float(f); }
- inline mp_float& operator*=(mp_float& u, const double d) { return u *= mp_float(d); }
- inline mp_float& operator*=(mp_float& u, const long double ld) { return u *= mp_float(ld); }
-
- inline mp_float& operator/=(mp_float& u, const char n) { return ((!std::numeric_limits<char>::is_signed) ? u.div_unsigned_long_long(static_cast<unsigned long long>(n)) : u.div_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator/=(mp_float& u, const signed char n) { return u.div_signed_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const signed short n) { return u.div_signed_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const signed int n) { return u.div_signed_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const signed long n) { return u.div_signed_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const signed long long n) { return u.div_signed_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const unsigned char n) { return u.div_unsigned_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const wchar_t n) { return ((!std::numeric_limits<wchar_t>::is_signed) ? u.div_unsigned_long_long(static_cast<unsigned long long>(n)) : u.div_signed_long_long(static_cast<signed long long>(n))); }
- inline mp_float& operator/=(mp_float& u, const unsigned short n) { return u.div_unsigned_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const unsigned int n) { return u.div_unsigned_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const unsigned long n) { return u.div_unsigned_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const unsigned long long n) { return u.div_unsigned_long_long(n); }
- inline mp_float& operator/=(mp_float& u, const float f) { return u /= mp_float(f); }
- inline mp_float& operator/=(mp_float& u, const double d) { return u /= mp_float(d); }
- inline mp_float& operator/=(mp_float& u, const long double ld) { return u /= mp_float(ld); }
-
- // Global comparison operators of const mp_float& with const mp_float&.
- inline bool operator< (const mp_float& u, const mp_float& v) { return (u.cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const mp_float& v) { return (u.cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const mp_float& v) { return (u.cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const mp_float& v) { return (u.cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const mp_float& v) { return (u.cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const mp_float& v) { return (u.cmp(v) > static_cast<boost::int32_t>(0)); }
-
- // Global comparison operators of const mp_float& with all built-in types.
- inline bool operator< (const mp_float& u, const char v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const char v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const char v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const char v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const char v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const char v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const wchar_t v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const wchar_t v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const wchar_t v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const wchar_t v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const wchar_t v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const wchar_t v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const signed char v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const signed char v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const signed char v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const signed char v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const signed char v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const signed char v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const signed short v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const signed short v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const signed short v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const signed short v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const signed short v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const signed short v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const signed int v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const signed int v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const signed int v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const signed int v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const signed int v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const signed int v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const signed long v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const signed long v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const signed long v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const signed long v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const signed long v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const signed long v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const signed long long v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const signed long long v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const signed long long v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const signed long long v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const signed long long v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const signed long long v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const unsigned char v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const unsigned char v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const unsigned char v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const unsigned char v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const unsigned char v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const unsigned char v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const unsigned short v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const unsigned short v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const unsigned short v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const unsigned short v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const unsigned short v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const unsigned short v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const unsigned int v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const unsigned int v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const unsigned int v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const unsigned int v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const unsigned int v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const unsigned int v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const unsigned long v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const unsigned long v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const unsigned long v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const unsigned long v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const unsigned long v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const unsigned long v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const unsigned long long v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const unsigned long long v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const unsigned long long v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const unsigned long long v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const unsigned long long v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const unsigned long long v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const float v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const float v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const float v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const float v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const float v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const float v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const double v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const double v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const double v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const double v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const double v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const double v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const mp_float& u, const long double v) { return (u.cmp(mp_float(v)) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const mp_float& u, const long double v) { return (u.cmp(mp_float(v)) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const mp_float& u, const long double v) { return (u.cmp(mp_float(v)) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const mp_float& u, const long double v) { return (u.cmp(mp_float(v)) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const mp_float& u, const long double v) { return (u.cmp(mp_float(v)) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const mp_float& u, const long double v) { return (u.cmp(mp_float(v)) > static_cast<boost::int32_t>(0)); }
-
- // Global comparison operators of all built-in types with const mp_float&.
- inline bool operator< (const char u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const char u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const char u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const char u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const char u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const char u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const wchar_t u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const wchar_t u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const wchar_t u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const wchar_t u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const wchar_t u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const wchar_t u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const signed char u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const signed char u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const signed char u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const signed char u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const signed char u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const signed char u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const signed short u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const signed short u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const signed short u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const signed short u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const signed short u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const signed short u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const signed int u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const signed int u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const signed int u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const signed int u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const signed int u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const signed int u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const signed long u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const signed long u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const signed long u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const signed long u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const signed long u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const signed long u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const signed long long u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const signed long long u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const signed long long u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const signed long long u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const signed long long u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const signed long long u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const unsigned char u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const unsigned char u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const unsigned char u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const unsigned char u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const unsigned char u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const unsigned char u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const unsigned short u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const unsigned short u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const unsigned short u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const unsigned short u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const unsigned short u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const unsigned short u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const unsigned int u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const unsigned int u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const unsigned int u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const unsigned int u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const unsigned int u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const unsigned int u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const unsigned long u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const unsigned long u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const unsigned long u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const unsigned long u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const unsigned long u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const unsigned long u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const unsigned long long u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const unsigned long long u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const unsigned long long u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const unsigned long long u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const unsigned long long u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const unsigned long long u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const float u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const float u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const float u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const float u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const float u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const float u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const double u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const double u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const double u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const double u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const double u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const double u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
-
- inline bool operator< (const long double u, const mp_float& v) { return (mp_float(u).cmp(v) < static_cast<boost::int32_t>(0)); }
- inline bool operator<=(const long double u, const mp_float& v) { return (mp_float(u).cmp(v) <= static_cast<boost::int32_t>(0)); }
- inline bool operator==(const long double u, const mp_float& v) { return (mp_float(u).cmp(v) == static_cast<boost::int32_t>(0)); }
- inline bool operator!=(const long double u, const mp_float& v) { return (mp_float(u).cmp(v) != static_cast<boost::int32_t>(0)); }
- inline bool operator>=(const long double u, const mp_float& v) { return (mp_float(u).cmp(v) >= static_cast<boost::int32_t>(0)); }
- inline bool operator> (const long double u, const mp_float& v) { return (mp_float(u).cmp(v) > static_cast<boost::int32_t>(0)); }
- }
- }
-
-#endif // _MP_FLOAT_2004_02_08_HPP_

Deleted: sandbox/multiprecision/boost/mp_float_base.hpp
==============================================================================
--- sandbox/multiprecision/boost/mp_float_base.hpp 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
+++ (empty file)
@@ -1,297 +0,0 @@
-
-// Copyright Christopher Kormanyos 2002 - 2011.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This work is based on an earlier work:
-// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
-// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
-
-#ifndef _MP_FLOAT_BASE_2004_02_08_HPP_
- #define _MP_FLOAT_BASE_2004_02_08_HPP_
-
- #include <limits>
- #include <string>
- #include <cmath>
-
- #include <boost/cstdint.hpp>
-
- // Forward declaration of I/O streams to avoid #include <iostream>.
- namespace std
- {
- template<class Elem> struct char_traits;
- template<class Elem, class Traits> class basic_ostream;
- template<class Elem, class Traits> class basic_istream;
- }
-
- // Select the number of decimal digits in mp_float
- // by setting the value of BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_DIGITS10.
- // The supported range is 30-300.
- // Note: This is a compile-time constant.
-
- #if !defined(BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_DIGITS10)
- #define BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_DIGITS10 50
- #endif
- #define BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_DIGITS10_LIMIT 300
-
- namespace boost
- {
- namespace multiprecision
- {
- #if defined(BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_TYPE_EFX)
- class mp_float_efx;
- typedef mp_float_efx mp_float;
- #elif defined(BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_TYPE_GMP)
- class mp_float_gmp;
- typedef mp_float_gmp mp_float;
- #elif defined(BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_TYPE_MPFR)
- class mp_float_mpfr;
- typedef mp_float_mpfr mp_float;
- #else
- #error The MP float type is undefined! Define the mp_float type!
- #endif
- }
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- class mp_float_base
- {
- public:
- static const boost::int32_t mp_float_digits10_setting = BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_DIGITS10;
- static const boost::int32_t mp_float_digits10_limit = BOOST_MULTIPRECISION_BACKEND_MP_FLOAT_DIGITS10_LIMIT;
- static const boost::int32_t mp_float_digits10 = ((mp_float_digits10_setting < static_cast<boost::int32_t>(30)) ? static_cast<boost::int32_t>(30) : ((mp_float_digits10_setting > mp_float_digits10_limit) ? mp_float_digits10_limit : mp_float_digits10_setting));
- static const boost::int32_t mp_float_digits10_extra = static_cast<boost::int32_t>(((static_cast<boost::int64_t>(mp_float_digits10) * 15LL) + 50LL) / 100LL);
- static const boost::int32_t mp_float_max_digits10 = static_cast<boost::int32_t>(mp_float_digits10 + ((mp_float_digits10_extra < static_cast<boost::int32_t>(5)) ? static_cast<boost::int32_t>(5) : ((mp_float_digits10_extra > static_cast<boost::int32_t>(30)) ? static_cast<boost::int32_t>(30) : mp_float_digits10_extra)));
-
- virtual ~mp_float_base() { }
-
- // Specific special values.
- virtual const mp_float& my_value_nan(void) const = 0;
- virtual const mp_float& my_value_inf(void) const = 0;
- const mp_float& my_value_max(void) const;
- const mp_float& my_value_min(void) const;
-
- virtual void precision(const boost::int32_t) = 0;
-
- // Basic operations.
- virtual mp_float& operator= (const mp_float&) = 0;
- virtual mp_float& operator+=(const mp_float&) = 0;
- virtual mp_float& operator-=(const mp_float&) = 0;
- virtual mp_float& operator*=(const mp_float&) = 0;
- virtual mp_float& operator/=(const mp_float&) = 0;
- virtual mp_float& add_unsigned_long_long(const unsigned long long) = 0;
- virtual mp_float& sub_unsigned_long_long(const unsigned long long) = 0;
- virtual mp_float& mul_unsigned_long_long(const unsigned long long) = 0;
- virtual mp_float& div_unsigned_long_long(const unsigned long long) = 0;
-
- mp_float& add_signed_long_long(const signed long long);
- mp_float& sub_signed_long_long(const signed long long);
- mp_float& mul_signed_long_long(const signed long long);
- mp_float& div_signed_long_long(const signed long long);
-
- // Elementary primitives.
- virtual mp_float& calculate_inv (void) = 0;
- virtual mp_float& calculate_sqrt(void) = 0;
- virtual mp_float& negate(void) = 0;
-
- // Comparison functions.
- virtual boost::int32_t cmp(const mp_float&) const = 0;
-
- virtual bool isnan (void) const = 0;
- virtual bool isinf (void) const = 0;
- virtual bool isfinite(void) const = 0;
-
- virtual bool iszero(void) const = 0;
- virtual bool isone (void) const = 0;
- virtual bool isint (void) const = 0;
- virtual bool isneg (void) const = 0;
- bool ispos (void) const { return (isneg() == false); }
-
- // Operators pre-increment and pre-decrement.
- virtual mp_float_base& operator++(void) = 0;
- virtual mp_float_base& operator--(void) = 0;
-
- // Fast order-10 range check.
- boost::int64_t order(void) const { return get_order_fast(); }
-
- // Conversion routines.
- virtual void extract_parts (double&, boost::int64_t&) const = 0;
- virtual double extract_double (void) const = 0;
- virtual long double extract_long_double (void) const = 0;
- virtual signed long long extract_signed_long_long (void) const = 0;
- virtual unsigned long long extract_unsigned_long_long(void) const = 0;
- virtual mp_float extract_integer_part (void) const = 0;
- virtual mp_float extract_decimal_part (void) const = 0;
-
- // Formated Output routine.
- void wr_string(std::string& str, std::ostream& os) const;
- virtual bool rd_string(const char* const) = 0;
-
- // Cast operators with all built-in types.
- operator char() const { return (std::numeric_limits<char>::is_signed ? static_cast<char> (extract_signed_long_long()) : static_cast<char> (extract_unsigned_long_long())); }
- operator wchar_t() const { return (std::numeric_limits<char>::is_signed ? static_cast<wchar_t>(extract_signed_long_long()) : static_cast<wchar_t>(extract_unsigned_long_long())); }
- operator signed char() const { return static_cast<signed char> (extract_signed_long_long()); }
- operator signed short() const { return static_cast<signed short> (extract_signed_long_long()); }
- operator signed int() const { return static_cast<signed int> (extract_signed_long_long()); }
- operator signed long() const { return static_cast<signed long> (extract_signed_long_long()); }
- operator signed long long() const { return static_cast<signed long long> (extract_signed_long_long()); }
- operator unsigned char() const { return static_cast<unsigned char> (extract_unsigned_long_long()); }
- operator unsigned short() const { return static_cast<unsigned short> (extract_unsigned_long_long()); }
- operator unsigned int() const { return static_cast<unsigned int> (extract_unsigned_long_long()); }
- operator unsigned long() const { return static_cast<unsigned long> (extract_unsigned_long_long()); }
- operator unsigned long long() const { return static_cast<unsigned long long>(extract_unsigned_long_long()); }
- operator float() const { return static_cast<float>(extract_double()); }
- operator double() const { return extract_double(); }
- operator long double() const { return extract_long_double(); }
-
- // Specific higher functions which might be present in the MP implementation.
- virtual bool has_its_own_ldexp (void) const { return false; }
- virtual bool has_its_own_frexp (void) const { return false; }
- virtual bool has_its_own_fmod (void) const { return false; }
- virtual bool has_its_own_cbrt (void) const { return false; }
- virtual bool has_its_own_rootn (void) const { return false; }
- virtual bool has_its_own_exp (void) const { return false; }
- virtual bool has_its_own_log (void) const { return false; }
- virtual bool has_its_own_sin (void) const { return false; }
- virtual bool has_its_own_cos (void) const { return false; }
- virtual bool has_its_own_tan (void) const { return false; }
- virtual bool has_its_own_asin (void) const { return false; }
- virtual bool has_its_own_acos (void) const { return false; }
- virtual bool has_its_own_atan (void) const { return false; }
- virtual bool has_its_own_sinh (void) const { return false; }
- virtual bool has_its_own_cosh (void) const { return false; }
- virtual bool has_its_own_tanh (void) const { return false; }
- virtual bool has_its_own_asinh (void) const { return false; }
- virtual bool has_its_own_acosh (void) const { return false; }
- virtual bool has_its_own_atanh (void) const { return false; }
- virtual bool has_its_own_gamma (void) const { return false; }
- virtual bool has_its_own_riemann_zeta (void) const { return false; }
- virtual bool has_its_own_cyl_bessel_jn(void) const { return false; }
- virtual bool has_its_own_cyl_bessel_yn(void) const { return false; }
-
- static mp_float my_ldexp (const mp_float&, int);
- static mp_float my_frexp (const mp_float&, int*);
- static mp_float my_fmod (const mp_float&, const mp_float&);
- static mp_float my_cbrt (const mp_float&);
- static mp_float my_rootn (const mp_float&, const boost::uint32_t);
- static mp_float my_exp (const mp_float&);
- static mp_float my_log (const mp_float&);
- static mp_float my_sin (const mp_float&);
- static mp_float my_cos (const mp_float&);
- static mp_float my_tan (const mp_float&);
- static mp_float my_asin (const mp_float&);
- static mp_float my_acos (const mp_float&);
- static mp_float my_atan (const mp_float&);
- static mp_float my_sinh (const mp_float&);
- static mp_float my_cosh (const mp_float&);
- static mp_float my_tanh (const mp_float&);
- static mp_float my_asinh (const mp_float&);
- static mp_float my_acosh (const mp_float&);
- static mp_float my_atanh (const mp_float&);
- static mp_float my_gamma (const mp_float&);
- static mp_float my_riemann_zeta (const mp_float&);
- static mp_float my_cyl_bessel_jn(const boost::int32_t, const mp_float&);
- static mp_float my_cyl_bessel_yn(const boost::int32_t, const mp_float&);
-
- static bool char_is_nonzero_predicate(const char& c) { return (c != static_cast<char>('0')); }
-
- protected:
- inline mp_float_base();
-
- // Emphasize: This template can be used with built-in
- // floating-point types like float, double and long double.
- // Note: For long double, ensure that the mantissa fits in
- // unsigned long long.
- template<typename built_in_float_type>
- class built_in_float_parts
- {
- public:
- built_in_float_parts(const built_in_float_type f) : u(0uLL), e(0) { make_parts(f); }
-
- const unsigned long long& get_mantissa(void) const { return u; }
- const int& get_exponent(void) const { return e; }
-
- private:
- built_in_float_parts();
- built_in_float_parts(const built_in_float_parts&);
- const built_in_float_parts& operator=(const built_in_float_parts&);
-
- unsigned long long u;
- int e;
-
- void make_parts(const built_in_float_type f)
- {
- if(f == static_cast<built_in_float_type>(0.0)) { return; }
-
- // Get the fraction and base-2 exponent.
- built_in_float_type man = ::frexp(f, &e);
-
- boost::uint32_t n2 = 0u;
-
- for(boost::uint32_t i = static_cast<boost::uint32_t>(0u); i < static_cast<boost::uint32_t>(std::numeric_limits<built_in_float_type>::digits); i++)
- {
- // Extract the mantissa of the floating-point type in base-2
- // (yes, one bit at a time) and store it in an unsigned long long.
- // TBD: Is this really portable?
- man *= 2;
-
- n2 = static_cast<boost::uint32_t>(man);
- man -= static_cast<built_in_float_type>(n2);
-
- if(n2 != static_cast<boost::uint32_t>(0u))
- {
- u |= 1u;
- }
-
- if(i < static_cast<boost::uint32_t>(std::numeric_limits<built_in_float_type>::digits - 1))
- {
- u <<= 1u;
- }
- }
-
- // Ensure that the value is normalized and adjust the exponent.
- u |= static_cast<unsigned long long>(1uLL << (std::numeric_limits<built_in_float_type>::digits - 1));
- e -= 1;
- }
- };
-
- private:
- static bool my_mp_float_digits10_do_match_those_of_lib_dll;
-
- virtual boost::int64_t get_order_exact(void) const = 0;
- virtual boost::int64_t get_order_fast (void) const = 0;
- virtual void get_output_string(std::string& str, boost::int64_t& my_exp, const std::size_t number_of_digits) const = 0;
- };
- }
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- // Operations with I/O streams.
- std::basic_ostream<char, std::char_traits<char> >& operator<<(std::basic_ostream<char, std::char_traits<char> >&, const mp_float_base&);
- std::basic_istream<char, std::char_traits<char> >& operator>>(std::basic_istream<char, std::char_traits<char> >&, mp_float_base&);
-
- // Use a template function to create a loud link error if the digits
- // in the mp_float headers mismatch those in a linked-to Lib or DLL.
- template<const boost::int32_t my_mp_float_digits10>
- boost::int_fast32_t template_mp_float_digits10_match_those_of_lib_dll(void);
-
- // This is a specialization of the digit10-match template.
- // There's no function body here, because it's in mp_float_base.cpp.
- template<>
- boost::int_fast32_t template_mp_float_digits10_match_those_of_lib_dll<mp_float_base::mp_float_digits10>(void);
-
- inline mp_float_base::mp_float_base()
- {
- my_mp_float_digits10_do_match_those_of_lib_dll = (template_mp_float_digits10_match_those_of_lib_dll<mp_float_digits10>() == static_cast<boost::int_fast32_t>(mp_float_digits10));
- }
- }
- }
-
-#endif // _MP_FLOAT_BASE_2004_02_08_HPP_

Deleted: sandbox/multiprecision/boost/mp_float_efx.hpp
==============================================================================
--- sandbox/multiprecision/boost/mp_float_efx.hpp 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
+++ (empty file)
@@ -1,170 +0,0 @@
-
-// Copyright Christopher Kormanyos 2002 - 2011.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This work is based on an earlier work:
-// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
-// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
-
-#ifndef _MP_FLOAT_EFX_2004_02_08_HPP_
- #define _MP_FLOAT_EFX_2004_02_08_HPP_
-
- #if defined(__INTEL_COMPILER)
- #pragma warning (disable:981)
- #endif
-
- #include <cmath>
- #include <string>
-
- #include <boost/array.hpp>
- #include <boost/multiprecision/mp_float_base.hpp>
-
- namespace boost
- {
- namespace multiprecision
- {
- class mp_float_efx : public mp_float_base
- {
- public:
- static const boost::int32_t mp_radix = static_cast<boost::int32_t>(10);
- static const boost::int32_t mp_float_digits = mp_float_digits10;
-
- static const boost::int64_t mp_float_max_exp = static_cast<boost::int64_t>(+9223372036854775795LL);
- static const boost::int64_t mp_float_min_exp = static_cast<boost::int64_t>(-9223372036854775795LL);
- static const boost::int64_t mp_float_max_exp10 = static_cast<boost::int64_t>(+3063937869882635616LL); // Approx. [mp_float_max_exp / log10(2)], also an even multiple of 8
- static const boost::int64_t mp_float_min_exp10 = static_cast<boost::int64_t>(-3063937869882635616LL);
-
- static const boost::int32_t mp_elem_digits10 = static_cast<boost::int32_t>(8);
-
- private:
- static const boost::int32_t mp_float_digits10_num_base = static_cast<boost::int32_t>((mp_float_max_digits10 / mp_elem_digits10) + (((mp_float_max_digits10 % mp_elem_digits10) != 0) ? 1 : 0));
- static const boost::int32_t mp_elem_number = static_cast<boost::int32_t>(mp_float_digits10_num_base + 2);
-
- typedef enum enum_fpclass
- {
- mp_finite,
- mp_inf,
- mp_NaN
- }
- t_fpclass;
-
- static const boost::int32_t mp_elem_mask = static_cast<boost::int32_t>(100000000);
-
- typedef boost::array<boost::uint32_t, static_cast<std::size_t>(mp_elem_number)> array_type;
-
- array_type data;
- boost::int64_t exp;
- bool neg;
- t_fpclass fpclass;
- boost::int32_t prec_elem;
-
- public:
- // Constructors
- mp_float_efx() : data (),
- exp (static_cast<boost::int64_t>(0)),
- neg (false),
- fpclass (mp_finite),
- prec_elem(mp_elem_number) { }
-
- mp_float_efx(const char n);
- mp_float_efx(const signed char n);
- mp_float_efx(const unsigned char n);
- mp_float_efx(const wchar_t n);
- mp_float_efx(const signed short n);
- mp_float_efx(const unsigned short n);
- mp_float_efx(const signed int n);
- mp_float_efx(const unsigned int n);
- mp_float_efx(const signed long n);
- mp_float_efx(const unsigned long n);
- mp_float_efx(const signed long long n);
- mp_float_efx(const unsigned long long n);
- mp_float_efx(const float f);
- mp_float_efx(const double d);
- mp_float_efx(const long double ld);
- mp_float_efx(const char* const s);
- mp_float_efx(const std::string& str);
-
- mp_float_efx(const mp_float_efx& f) : data (f.data),
- exp (f.exp),
- neg (f.neg),
- fpclass (f.fpclass),
- prec_elem(f.prec_elem) { }
-
- // Constructor from mantissa and exponent.
- mp_float_efx(const double mantissa, const boost::int64_t exponent);
-
- virtual ~mp_float_efx() { }
-
- public:
- virtual boost::int32_t cmp(const mp_float_efx& v) const;
-
- // Specific special values.
- virtual const mp_float_efx& my_value_nan(void) const;
- virtual const mp_float_efx& my_value_inf(void) const;
-
- virtual void precision(const boost::int32_t prec_digits);
-
- // Basic operations.
- virtual mp_float_efx& operator= (const mp_float_efx& v);
- virtual mp_float_efx& operator+=(const mp_float_efx& v);
- virtual mp_float_efx& operator-=(const mp_float_efx& v);
- virtual mp_float_efx& operator*=(const mp_float_efx& v);
- virtual mp_float_efx& operator/=(const mp_float_efx& v);
- virtual mp_float_efx& add_unsigned_long_long(const unsigned long long n);
- virtual mp_float_efx& sub_unsigned_long_long(const unsigned long long n);
- virtual mp_float_efx& mul_unsigned_long_long(const unsigned long long n);
- virtual mp_float_efx& div_unsigned_long_long(const unsigned long long n);
-
- // Elementary primitives.
- virtual mp_float_efx& calculate_inv (void);
- virtual mp_float_efx& calculate_sqrt(void);
- virtual mp_float_efx& negate(void) { if(!iszero()) { neg = (!neg); } return *this; }
-
- // Comparison functions
- virtual bool isnan (void) const { return (fpclass == mp_NaN); }
- virtual bool isinf (void) const { return (fpclass == mp_inf); }
- virtual bool isfinite(void) const { return (fpclass == mp_finite); }
-
- virtual bool iszero (void) const;
- virtual bool isone (void) const;
- virtual bool isint (void) const;
- virtual bool isneg (void) const { return neg; }
-
- // Operators pre-increment and pre-decrement
- virtual mp_float_efx& operator++(void);
- virtual mp_float_efx& operator--(void);
-
- // Conversion routines
- virtual void extract_parts (double& mantissa, boost::int64_t& exponent) const;
- virtual double extract_double (void) const;
- virtual long double extract_long_double (void) const;
- virtual signed long long extract_signed_long_long (void) const;
- virtual unsigned long long extract_unsigned_long_long(void) const;
- virtual mp_float_efx extract_integer_part (void) const;
- virtual mp_float_efx extract_decimal_part (void) const;
-
- private:
- static bool data_elem_is_non_zero_predicate(const boost::uint32_t& d) { return (d != static_cast<boost::uint32_t>(0u)); }
- static bool data_elem_is_non_nine_predicate(const boost::uint32_t& d) { return (d != static_cast<boost::uint32_t>(mp_float_efx::mp_elem_mask - 1)); }
-
- void from_unsigned_long_long(const unsigned long long u);
- void from_unsigned_long(const unsigned long u);
-
- boost::int32_t cmp_data(const array_type& vd) const;
-
- static void mul_loop_uv(const boost::uint32_t* const u, const boost::uint32_t* const v, boost::uint32_t* const w, const boost::int32_t p);
- static boost::uint32_t mul_loop_n(boost::uint32_t* const u, boost::uint32_t n, const boost::int32_t p);
- static boost::uint32_t div_loop_n(boost::uint32_t* const u, boost::uint32_t n, const boost::int32_t p);
-
- virtual boost::int64_t get_order_exact(void) const { return get_order_fast(); }
- virtual boost::int64_t get_order_fast (void) const;
- virtual void get_output_string(std::string& str, boost::int64_t& my_exp, const std::size_t number_of_digits) const;
-
- virtual bool rd_string(const char* const s);
- };
- }
- }
-
-#endif // _MP_FLOAT_EFX_2004_02_08_HPP_

Deleted: sandbox/multiprecision/boost/mp_float_functions.hpp
==============================================================================
--- sandbox/multiprecision/boost/mp_float_functions.hpp 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
+++ (empty file)
@@ -1,294 +0,0 @@
-
-// Copyright Christopher Kormanyos 2002 - 2011.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This work is based on an earlier work:
-// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
-// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
-
-#ifndef _MP_FLOAT_FUNCTIONS_HPP_
- #define _MP_FLOAT_FUNCTIONS_HPP_
-
- #include <vector>
- #include <deque>
-
- #include <boost/multiprecision/mp_float.hpp>
- #include <boost/multiprecision/mp_complex.hpp>
-
- namespace boost
- {
- namespace multiprecision
- {
- inline boost::int32_t max_iteration(void) { return static_cast<boost::int32_t>(10000); }
- inline boost::int64_t tol (void) { return static_cast<boost::int64_t>(boost::multiprecision::mp_float::mp_float_max_digits10); }
-
- inline boost::multiprecision::mp_float fabs(const boost::multiprecision::mp_float& x) { return (x.isneg() ? boost::multiprecision::mp_float(x).negate() : x); }
-
- boost::multiprecision::mp_float floor(const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float ceil (const boost::multiprecision::mp_float& x);
- boost::int32_t sgn (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float ldexp(const boost::multiprecision::mp_float& v, int e);
- boost::multiprecision::mp_float frexp(const boost::multiprecision::mp_float& v, int* expon);
- boost::multiprecision::mp_float fmod (const boost::multiprecision::mp_float& v1, const boost::multiprecision::mp_float& v2);
-
- bool isnan(const double x);
- inline bool isnan(const boost::multiprecision::mp_float& x) { return x.isnan(); }
- inline bool isnan(const boost::multiprecision::mp_complex& z) { return z.isnan(); }
-
- bool isfinite(const double x);
- inline bool isfinite(const boost::multiprecision::mp_float& x) { return x.isfinite(); }
- inline bool isfinite(const boost::multiprecision::mp_complex& z) { return z.isfinite(); }
-
- bool isinf(const double x);
- inline bool isinf(const boost::multiprecision::mp_float& x) { return x.isinf(); }
- inline bool isinf(const boost::multiprecision::mp_complex& z) { return z.isinf(); }
-
- inline bool isneg(const double x) { return (x < 0.0); }
- inline bool isneg(const boost::multiprecision::mp_float& x) { return x.isneg(); }
- inline bool isneg(const boost::multiprecision::mp_complex& z) { return z.isneg(); }
-
- inline boost::multiprecision::mp_float abs (const boost::multiprecision::mp_float& x) { return boost::multiprecision::fabs(x); }
- inline boost::multiprecision::mp_float real(const boost::multiprecision::mp_float& x) { return x; }
- inline boost::multiprecision::mp_float imag(const boost::multiprecision::mp_float&) { return boost::multiprecision::zero(); }
-
- inline bool ispos(const double x) { return !isneg(x); }
- inline bool ispos(const boost::multiprecision::mp_float& x) { return !x.isneg(); }
- inline bool ispos(const boost::multiprecision::mp_complex& z) { return !z.isneg(); }
-
- bool isint(const double x);
- inline bool isint(const boost::multiprecision::mp_float& x) { return x.isint(); }
- inline bool isint(const boost::multiprecision::mp_complex& z) { return z.isint(); }
-
- inline bool isone(const double x) { return (::fabs(1.0 - x) < (std::numeric_limits<double>::min)() * 2); }
- inline bool isone(const boost::multiprecision::mp_float& x) { return x.isone(); }
- inline bool isone(const boost::multiprecision::mp_complex& z) { return z.isone(); }
-
- inline bool iszero(const double x) { return (::fabs(x) < (std::numeric_limits<double>::min)() * 2); }
- inline bool iszero(const boost::multiprecision::mp_float& x) { return x.iszero(); }
- inline bool iszero(const boost::multiprecision::mp_complex& z) { return z.iszero(); }
-
- boost::multiprecision::mp_float integer_part(const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float decimal_part(const boost::multiprecision::mp_float& x);
-
- void to_parts(const boost::multiprecision::mp_float& x, double& mantissa, boost::int64_t& exponent);
-
- inline double to_double(const double& x) { return x; }
- double to_double(const boost::multiprecision::mp_float& x);
- double to_double(const boost::multiprecision::mp_complex& z);
-
- inline boost::int64_t order_of(const double x) { return static_cast<boost::int64_t>(static_cast<boost::int32_t>(::log10(x))); }
- inline boost::int64_t order_of(const boost::multiprecision::mp_float& x) { return x.order(); }
-
- boost::int64_t to_int64(const double x);
- boost::int64_t to_int64(const boost::multiprecision::mp_float& x);
- boost::int64_t to_int64(const boost::multiprecision::mp_complex& z);
-
- boost::int32_t to_int32(const double x);
- boost::int32_t to_int32(const boost::multiprecision::mp_float& x);
- boost::int32_t to_int32(const boost::multiprecision::mp_complex& z);
-
- bool small_arg(const double x);
- bool small_arg(const boost::multiprecision::mp_float& x);
- bool small_arg(const boost::multiprecision::mp_complex& z);
-
- bool large_arg(const double x);
- bool large_arg(const boost::multiprecision::mp_float& x);
- bool large_arg(const boost::multiprecision::mp_complex& z);
-
- bool near_one(const double x);
- bool near_one(const boost::multiprecision::mp_float& x);
- bool near_one(const boost::multiprecision::mp_complex& z);
-
- bool near_int(const double x);
- bool near_int(const boost::multiprecision::mp_float& x);
- bool near_int(const boost::multiprecision::mp_complex& z);
-
- const boost::multiprecision::mp_float& two (void);
- const boost::multiprecision::mp_float& three (void);
- const boost::multiprecision::mp_float& four (void);
- const boost::multiprecision::mp_float& five (void);
- const boost::multiprecision::mp_float& six (void);
- const boost::multiprecision::mp_float& seven (void);
- const boost::multiprecision::mp_float& eight (void);
- const boost::multiprecision::mp_float& nine (void);
- const boost::multiprecision::mp_float& ten (void);
- const boost::multiprecision::mp_float& twenty (void);
- const boost::multiprecision::mp_float& thirty (void);
- const boost::multiprecision::mp_float& forty (void);
- const boost::multiprecision::mp_float& fifty (void);
- const boost::multiprecision::mp_float& hundred (void);
- const boost::multiprecision::mp_float& two_hundred (void);
- const boost::multiprecision::mp_float& three_hundred (void);
- const boost::multiprecision::mp_float& four_hundred (void);
- const boost::multiprecision::mp_float& five_hundred (void);
- const boost::multiprecision::mp_float& thousand (void);
- const boost::multiprecision::mp_float& two_k (void);
- const boost::multiprecision::mp_float& three_k (void);
- const boost::multiprecision::mp_float& four_k (void);
- const boost::multiprecision::mp_float& five_k (void);
- const boost::multiprecision::mp_float& ten_k (void);
- const boost::multiprecision::mp_float& twenty_k (void);
- const boost::multiprecision::mp_float& thirty_k (void);
- const boost::multiprecision::mp_float& forty_k (void);
- const boost::multiprecision::mp_float& fifty_k (void);
- const boost::multiprecision::mp_float& hundred_k (void);
- const boost::multiprecision::mp_float& million (void);
- const boost::multiprecision::mp_float& ten_M (void);
- const boost::multiprecision::mp_float& hundred_M (void);
- const boost::multiprecision::mp_float& billion (void);
- const boost::multiprecision::mp_float& trillion (void);
- const boost::multiprecision::mp_float& googol (void);
- const boost::multiprecision::mp_float& int64_min (void);
- const boost::multiprecision::mp_float& int64_max (void);
- const boost::multiprecision::mp_float& int32_min (void);
- const boost::multiprecision::mp_float& int32_max (void);
- const boost::multiprecision::mp_float& unsigned_long_long_max (void);
- const boost::multiprecision::mp_float& signed_long_long_max (void);
- const boost::multiprecision::mp_float& signed_long_long_min (void);
- const boost::multiprecision::mp_float& double_min (void);
- const boost::multiprecision::mp_float& double_max (void);
- const boost::multiprecision::mp_float& long_double_min (void);
- const boost::multiprecision::mp_float& long_double_max (void);
- const boost::multiprecision::mp_float& one_minus (void);
- const boost::multiprecision::mp_float& tenth (void);
- const boost::multiprecision::mp_float& eighth (void);
- const boost::multiprecision::mp_float& sixteenth (void);
- const boost::multiprecision::mp_float& fifth (void);
- const boost::multiprecision::mp_float& quarter (void);
- const boost::multiprecision::mp_float& third (void);
- const boost::multiprecision::mp_float& two_third (void);
- const boost::multiprecision::mp_float& four_third (void);
- const boost::multiprecision::mp_float& three_half (void);
- const boost::multiprecision::mp_float& sqrt2 (void);
- const boost::multiprecision::mp_float& sqrt3 (void);
- const boost::multiprecision::mp_float& pi (void);
- const boost::multiprecision::mp_float& pi_half (void);
- const boost::multiprecision::mp_float& pi_quarter (void);
- const boost::multiprecision::mp_float& pi_squared (void);
- const boost::multiprecision::mp_float& two_pi (void);
- const boost::multiprecision::mp_float& sqrt_pi (void);
- const boost::multiprecision::mp_float& degree (void);
- const boost::multiprecision::mp_float& exp1 (void);
- const boost::multiprecision::mp_float& ln2 (void);
- const boost::multiprecision::mp_float& ln3 (void);
- const boost::multiprecision::mp_float& ln10 (void);
- const boost::multiprecision::mp_float& log10_2 (void);
- const boost::multiprecision::mp_float& golden_ratio (void);
- const boost::multiprecision::mp_float& euler_gamma (void);
- const boost::multiprecision::mp_float& catalan (void);
- const boost::multiprecision::mp_float& khinchin (void);
- const boost::multiprecision::mp_float& glaisher (void);
- const boost::multiprecision::mp_float& extreme_value_skewness (void);
- const boost::multiprecision::mp_float& rayleigh_skewness (void);
- const boost::multiprecision::mp_float& rayleigh_kurtosis (void);
- const boost::multiprecision::mp_float& rayleigh_kurtosis_excess(void);
-
- boost::multiprecision::mp_float pow2 (const boost::int64_t p);
- boost::multiprecision::mp_float pown (const boost::multiprecision::mp_float& x, const boost::int64_t p);
- boost::multiprecision::mp_float inv (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float sqrt (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float cbrt (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float rootn (const boost::multiprecision::mp_float& x, const boost::int32_t p);
- boost::multiprecision::mp_float exp (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float log (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float log10 (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float loga (const boost::multiprecision::mp_float& a, const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float log1p (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float log1p1m2(const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float pow (const boost::multiprecision::mp_float& x, const boost::multiprecision::mp_float& a);
- void sincos (const boost::multiprecision::mp_float& x, boost::multiprecision::mp_float* const p_sin, boost::multiprecision::mp_float* const p_cos);
- boost::multiprecision::mp_float sin (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float cos (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float tan (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float csc (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float sec (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float cot (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float asin (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float acos (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float atan (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float atan2 (const boost::multiprecision::mp_float& y, const boost::multiprecision::mp_float& x);
- void sinhcosh(const boost::multiprecision::mp_float& x, boost::multiprecision::mp_float* const p_sin, boost::multiprecision::mp_float* const p_cos);
- boost::multiprecision::mp_float sinh (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float cosh (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float tanh (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float asinh (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float acosh (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float atanh (const boost::multiprecision::mp_float& x);
-
- boost::multiprecision::mp_float hyp0F0(const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float hyp0F1(const boost::multiprecision::mp_float& b, const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float hyp1F0(const boost::multiprecision::mp_float& a, const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float hyp1F1(const boost::multiprecision::mp_float& a, const boost::multiprecision::mp_float& b, const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float hyp2F0(const boost::multiprecision::mp_float& a, const boost::multiprecision::mp_float& b, const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float hyp2F1(const boost::multiprecision::mp_float& a, const boost::multiprecision::mp_float& b, const boost::multiprecision::mp_float& c, const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float hypPFQ(const std::deque<boost::multiprecision::mp_float>& a, const std::deque<boost::multiprecision::mp_float>& b, const boost::multiprecision::mp_float& x);
-
- boost::multiprecision::mp_float gamma (const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float gamma_near_n (const boost::int32_t n, const boost::multiprecision::mp_float& x);
- boost::multiprecision::mp_float factorial (const boost::uint32_t n);
- boost::multiprecision::mp_float factorial2 (const boost::int32_t n);
- boost::multiprecision::mp_float binomial (const boost::uint32_t n, const boost::uint32_t k);
- boost::multiprecision::mp_float binomial (const boost::uint32_t n, const boost::multiprecision::mp_float& y);
- boost::multiprecision::mp_float binomial (const boost::multiprecision::mp_float& x, const boost::uint32_t k);
- boost::multiprecision::mp_float binomial (const boost::multiprecision::mp_float& x, const boost::multiprecision::mp_float& y);
- boost::multiprecision::mp_float pochhammer (const boost::multiprecision::mp_float& x, const boost::uint32_t n);
- boost::multiprecision::mp_float pochhammer (const boost::multiprecision::mp_float& x, const boost::multiprecision::mp_float& a);
- boost::multiprecision::mp_float bernoulli (const boost::uint32_t n);
- void bernoulli_table(std::vector<boost::multiprecision::mp_float>& bn, const boost::uint32_t n);
- void prime (const boost::uint32_t n, std::deque<boost::uint32_t>& primes);
- boost::multiprecision::mp_float riemann_zeta (const boost::int32_t n);
- boost::multiprecision::mp_float riemann_zeta (const boost::multiprecision::mp_float& s);
- }
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- inline boost::multiprecision::mp_float norm(const boost::multiprecision::mp_complex& z) { return z.norm(); }
- boost::multiprecision::mp_float abs (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_float arg (const boost::multiprecision::mp_complex& z);
- inline boost::multiprecision::mp_float real(const boost::multiprecision::mp_complex& z) { return z.real(); }
- inline boost::multiprecision::mp_float imag(const boost::multiprecision::mp_complex& z) { return z.imag(); }
-
- inline boost::multiprecision::mp_complex conj(const boost::multiprecision::mp_complex& z) { return boost::multiprecision::mp_complex(z.real(), -z.imag()); }
- inline boost::multiprecision::mp_complex iz (const boost::multiprecision::mp_complex& z) { const boost::multiprecision::mp_float tmp(z.real()); return boost::multiprecision::mp_complex(-z.imag(), tmp); }
-
- boost::multiprecision::mp_complex polar (const boost::multiprecision::mp_float& mod, const boost::multiprecision::mp_float& arg);
- boost::multiprecision::mp_complex sin (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex cos (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex tan (const boost::multiprecision::mp_complex& z);
- void sincos (const boost::multiprecision::mp_complex& z, boost::multiprecision::mp_complex* const p_sin, boost::multiprecision::mp_complex* const p_cos);
- boost::multiprecision::mp_complex csc (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex sec (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex cot (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex asin (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex acos (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex atan (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex inv (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex sqrt (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex exp (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex log (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex log10 (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex loga (const boost::multiprecision::mp_complex& a, const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex pown (const boost::multiprecision::mp_complex& z, const boost::int64_t p);
- boost::multiprecision::mp_complex pow (const boost::multiprecision::mp_complex& z, const boost::multiprecision::mp_complex& a);
- boost::multiprecision::mp_complex rootn (const boost::multiprecision::mp_complex& z, const boost::int32_t p);
- boost::multiprecision::mp_complex sinh (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex cosh (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex tanh (const boost::multiprecision::mp_complex& z);
- void sinhcosh(const boost::multiprecision::mp_complex& z, boost::multiprecision::mp_complex* const p_sinh, boost::multiprecision::mp_complex* const p_cosh);
- boost::multiprecision::mp_complex asinh (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex acosh (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex atanh (const boost::multiprecision::mp_complex& z);
-
- boost::multiprecision::mp_complex gamma (const boost::multiprecision::mp_complex& z);
- boost::multiprecision::mp_complex pochhammer (const boost::multiprecision::mp_complex& z, const boost::uint32_t n);
- boost::multiprecision::mp_complex pochhammer (const boost::multiprecision::mp_complex& z, const boost::multiprecision::mp_complex& a);
- boost::multiprecision::mp_complex riemann_zeta(const boost::multiprecision::mp_complex& s);
- }
- }
-
-#endif // _MP_FLOAT_FUNCTIONS_HPP_

Deleted: sandbox/multiprecision/boost/mp_float_gmp.hpp
==============================================================================
--- sandbox/multiprecision/boost/mp_float_gmp.hpp 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
+++ (empty file)
@@ -1,176 +0,0 @@
-
-// Copyright Christopher Kormanyos 2002 - 2011.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This work is based on an earlier work:
-// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
-// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
-
-#ifndef _MP_FLOAT_GMP_HPP_
- #define _MP_FLOAT_GMP_HPP_
-
- #if defined(__INTEL_COMPILER)
- #pragma warning (disable:193)
- #pragma warning (disable:981)
- #endif
-
- #if defined(_MSC_VER)
- #pragma warning (disable:4127)
- #endif
-
- #include <cmath>
- #include <climits>
- #include <string>
-
- #include <boost/multiprecision/mp_float_base.hpp>
-
- // Declare the types of GMP.
- extern "C"
- {
- typedef long int mp_size_t;
- typedef long int mp_exp_t;
- typedef unsigned long int mp_limb_t;
-
- typedef struct struct__mpf_struct
- {
- int _mp_prec;
- int _mp_size;
- mp_exp_t _mp_exp;
- mp_limb_t *_mp_d;
- }
- __mpf_struct;
-
- typedef __mpf_struct mpf_t[1];
- typedef __mpf_struct* mpf_ptr;
- typedef const __mpf_struct* mpf_srcptr;
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- class mp_float_gmp : public mp_float_base
- {
- public:
- static const boost::int32_t mp_float_digits = static_cast<boost::int32_t>((static_cast<signed long long>(mp_float_digits10) * 2136LL) / 643LL);
- static const boost::int32_t mp_radix = static_cast<boost::int32_t>(2);
-
- static const boost::int64_t mp_float_max_exp = static_cast<boost::int64_t>(LONG_MAX - 31LL); // TBD: Ensure that (boost::int64_t >= long)
- static const boost::int64_t mp_float_min_exp = static_cast<boost::int64_t>(LONG_MIN + 31LL); // TBD: Ensure that (boost::int64_t >= long)
- static const boost::int64_t mp_float_max_exp10 = static_cast<boost::int64_t>((static_cast<signed long long>(mp_float_max_exp) * 643LL) / 2136LL);
- static const boost::int64_t mp_float_min_exp10 = static_cast<boost::int64_t>((static_cast<signed long long>(mp_float_min_exp) * 643LL) / 2136LL);
-
- private:
- static const boost::int32_t mp_float_digits2 = static_cast<boost::int32_t>((static_cast<signed long long>(mp_float_max_digits10) * 2136LL) / 643LL);
-
- typedef enum enum_fpclass
- {
- mp_finite,
- mp_inf_pos,
- mp_inf_neg,
- mp_NaN
- }
- t_fpclass;
-
- t_fpclass fpclass;
- boost::int32_t prec_elem;
- ::mpf_t rop;
-
- public:
- // Constructors
- mp_float_gmp();
- mp_float_gmp(const char n);
- mp_float_gmp(const signed char n);
- mp_float_gmp(const unsigned char n);
- mp_float_gmp(const wchar_t n);
- mp_float_gmp(const signed short n);
- mp_float_gmp(const unsigned short n);
- mp_float_gmp(const signed int n);
- mp_float_gmp(const unsigned int n);
- mp_float_gmp(const signed long n);
- mp_float_gmp(const unsigned long n);
- mp_float_gmp(const signed long long n);
- mp_float_gmp(const unsigned long long n);
- mp_float_gmp(const float f);
- mp_float_gmp(const double d);
- mp_float_gmp(const long double ld);
- mp_float_gmp(const char* const s);
- mp_float_gmp(const std::string& str);
-
- mp_float_gmp(const mp_float_gmp& f);
- mp_float_gmp(const double mantissa, const boost::int64_t exponent);
-
- virtual ~mp_float_gmp();
-
- private:
- explicit mp_float_gmp(const ::mpf_t& op);
-
- public:
- virtual boost::int32_t cmp(const mp_float_gmp& v) const;
-
- // Specific special values.
- virtual const mp_float_gmp& my_value_nan(void) const;
- virtual const mp_float_gmp& my_value_inf(void) const;
-
- virtual void precision(const boost::int32_t prec_digits);
-
- // Basic operations.
- virtual mp_float_gmp& operator= (const mp_float_gmp& v);
- virtual mp_float_gmp& operator+=(const mp_float_gmp& v);
- virtual mp_float_gmp& operator-=(const mp_float_gmp& v);
- virtual mp_float_gmp& operator*=(const mp_float_gmp& v);
- virtual mp_float_gmp& operator/=(const mp_float_gmp& v);
- virtual mp_float_gmp& add_unsigned_long_long(const unsigned long long n);
- virtual mp_float_gmp& sub_unsigned_long_long(const unsigned long long n);
- virtual mp_float_gmp& mul_unsigned_long_long(const unsigned long long n);
- virtual mp_float_gmp& div_unsigned_long_long(const unsigned long long n);
-
- // Elementary primitives.
- virtual mp_float_gmp& calculate_inv (void);
- virtual mp_float_gmp& calculate_sqrt(void);
- virtual mp_float_gmp& negate(void);
-
- // Comparison functions
- virtual bool isnan (void) const { return (fpclass == mp_NaN); }
- virtual bool isinf (void) const { return ((fpclass == mp_inf_pos) || (fpclass == mp_inf_neg)); }
- virtual bool isfinite(void) const { return (fpclass == mp_finite); }
-
- virtual bool iszero (void) const;
- virtual bool isone (void) const;
- virtual bool isint (void) const;
- virtual bool isneg (void) const;
-
- // Operators pre-increment and pre-decrement
- virtual mp_float_gmp& operator++(void);
- virtual mp_float_gmp& operator--(void);
-
- // Conversion routines
- virtual void extract_parts (double& mantissa, boost::int64_t& exponent) const;
- virtual double extract_double (void) const;
- virtual long double extract_long_double (void) const;
- virtual signed long long extract_signed_long_long (void) const;
- virtual unsigned long long extract_unsigned_long_long(void) const;
- virtual mp_float_gmp extract_integer_part (void) const;
- virtual mp_float_gmp extract_decimal_part (void) const;
-
- private:
- static const boost::int64_t& max_exp2(void);
- static const boost::int64_t& min_exp2(void);
-
- static void init(void);
-
- void from_unsigned_long_long(const unsigned long long u);
- void from_unsigned_long(const unsigned long u);
-
- virtual bool rd_string(const char* const s);
-
- virtual boost::int64_t get_order_exact(void) const;
- virtual boost::int64_t get_order_fast(void) const;
- virtual void get_output_string(std::string& str, boost::int64_t& my_exp, const std::size_t number_of_digits) const;
- };
- }
- }
-
-#endif // _MP_FLOAT_GMP_HPP_

Deleted: sandbox/multiprecision/boost/mp_float_mpfr.hpp
==============================================================================
--- sandbox/multiprecision/boost/mp_float_mpfr.hpp 2011-09-22 13:43:22 EDT (Thu, 22 Sep 2011)
+++ (empty file)
@@ -1,207 +0,0 @@
-
-// Copyright Christopher Kormanyos 2002 - 2011.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-// This work is based on an earlier work:
-// "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
-// in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
-
-#ifndef _MP_FLOAT_MPFR_HPP_
- #define _MP_FLOAT_MPFR_HPP_
-
- #include <cmath>
- #include <string>
- #include <climits>
-
- #include <boost/multiprecision/mp_float_base.hpp>
-
- // Declare the types of MPFR.
- extern "C"
- {
- typedef unsigned long mpfr_prec_t;
- typedef int mpfr_sign_t;
- typedef long int mp_exp_t;
- typedef unsigned long int mp_limb_t;
-
- #define mp_prec_t mpfr_prec_t
- #define mp_rnd_t mpfr_rnd_t
-
- typedef struct
- {
- mpfr_prec_t _mpfr_prec;
- mpfr_sign_t _mpfr_sign;
- mp_exp_t _mpfr_exp;
- mp_limb_t* _mpfr_d;
- }
- __mpfr_struct;
-
- #define __gmp_const const
-
- typedef __mpfr_struct mpfr_t[1];
- typedef __mpfr_struct* mpfr_ptr;
- typedef __gmp_const __mpfr_struct* mpfr_srcptr;
-
- typedef enum
- {
- GMP_RNDNA = -1,
- GMP_RNDN = 0,
- GMP_RNDZ = 1,
- GMP_RNDU = 2,
- GMP_RNDD = 3,
- GMP_RND_MAX = 4
- }
- mpfr_rnd_t;
- }
-
- namespace boost
- {
- namespace multiprecision
- {
- class mp_float_mpfr : public mp_float_base
- {
- public:
- static const boost::int32_t mp_float_digits = static_cast<boost::int32_t>((static_cast<signed long long>(mp_float_digits10) * 2136LL) / 643LL);
- static const boost::int32_t mp_radix = 2;
-
- static const boost::int64_t mp_float_max_exp = static_cast<boost::int64_t>(LONG_MAX / static_cast<signed long>(2L)); // TBD: Ensure that (boost::int64_t >= long)
- static const boost::int64_t mp_float_min_exp = static_cast<boost::int64_t>(LONG_MIN / static_cast<signed long>(2L)); // TBD: Ensure that (boost::int64_t >= long)
- static const boost::int64_t mp_float_max_exp10 = static_cast<boost::int64_t>((static_cast<signed long long>(mp_float_max_exp) * 643LL) / 2136LL);
- static const boost::int64_t mp_float_min_exp10 = static_cast<boost::int64_t>((static_cast<signed long long>(mp_float_min_exp) * 643LL) / 2136LL);
-
- private:
- static const boost::int32_t mp_float_digits2 = static_cast<boost::int32_t>((static_cast<signed long long>(mp_float_max_digits10) * 2136LL) / 643LL);
- ::mpfr_t rop;
-
- public:
- // Constructors
- mp_float_mpfr();
- mp_float_mpfr(const char n);
- mp_float_mpfr(const signed char n);
- mp_float_mpfr(const unsigned char n);
- mp_float_mpfr(const wchar_t n);
- mp_float_mpfr(const signed short n);
- mp_float_mpfr(const unsigned short n);
- mp_float_mpfr(const signed int n);
- mp_float_mpfr(const unsigned int n);
- mp_float_mpfr(const signed long n);
- mp_float_mpfr(const unsigned long n);
- mp_float_mpfr(const signed long long n);
- mp_float_mpfr(const unsigned long long n);
- mp_float_mpfr(const float f);
- mp_float_mpfr(const double d);
- mp_float_mpfr(const long double ld);
- mp_float_mpfr(const char* const s);
- mp_float_mpfr(const std::string& str);
-
- mp_float_mpfr(const mp_float_mpfr& f);
- mp_float_mpfr(const double mantissa, const boost::int64_t exponent);
-
- virtual ~mp_float_mpfr();
-
- virtual boost::int32_t cmp(const mp_float_mpfr& v) const;
-
- // Specific special values.
- virtual const mp_float_mpfr& my_value_nan(void) const;
- virtual const mp_float_mpfr& my_value_inf(void) const;
-
- virtual void precision(const boost::int32_t) { }
-
- // Basic operations.
- virtual mp_float_mpfr& operator= (const mp_float_mpfr& v);
- virtual mp_float_mpfr& operator+=(const mp_float_mpfr& v);
- virtual mp_float_mpfr& operator-=(const mp_float_mpfr& v);
- virtual mp_float_mpfr& operator*=(const mp_float_mpfr& v);
- virtual mp_float_mpfr& operator/=(const mp_float_mpfr& v);
- virtual mp_float_mpfr& add_unsigned_long_long(const unsigned long long n);
- virtual mp_float_mpfr& sub_unsigned_long_long(const unsigned long long n);
- virtual mp_float_mpfr& mul_unsigned_long_long(const unsigned long long n);
- virtual mp_float_mpfr& div_unsigned_long_long(const unsigned long long n);
-
- // Elementary primitives.
- virtual mp_float_mpfr& calculate_inv (void);
- virtual mp_float_mpfr& calculate_sqrt(void);
- virtual mp_float_mpfr& negate(void);
-
- // Comparison functions
- virtual bool isnan (void) const;
- virtual bool isinf (void) const;
- virtual bool isfinite(void) const;
-
- virtual bool iszero (void) const;
- virtual bool isone (void) const;
- virtual bool isint (void) const;
- virtual bool isneg (void) const;
-
- // Operators pre-increment and pre-decrement.
- virtual mp_float_mpfr& operator++(void);
- virtual mp_float_mpfr& operator--(void);
-
- // Conversion routines.
- virtual void extract_parts (double& mantissa, boost::int64_t& exponent) const;
- virtual double extract_double (void) const;
- virtual long double extract_long_double (void) const;
- virtual signed long long extract_signed_long_long (void) const;
- virtual unsigned long long extract_unsigned_long_long(void) const;
- virtual mp_float_mpfr extract_integer_part (void) const;
- virtual mp_float_mpfr extract_decimal_part (void) const;
-
- static mp_float_mpfr my_cbrt (const mp_float_mpfr& x);
- static mp_float_mpfr my_rootn (const mp_float_mpfr& x, const boost::uint32_t p);
- static mp_float_mpfr my_exp (const mp_float_mpfr& x);
- static mp_float_mpfr my_log (const mp_float_mpfr& x);
- static mp_float_mpfr my_sin (const mp_float_mpfr& x);
- static mp_float_mpfr my_cos (const mp_float_mpfr& x);
- static mp_float_mpfr my_tan (const mp_float_mpfr& x);
- static mp_float_mpfr my_asin (const mp_float_mpfr& x);
- static mp_float_mpfr my_acos (const mp_float_mpfr& x);
- static mp_float_mpfr my_atan (const mp_float_mpfr& x);
- static mp_float_mpfr my_sinh (const mp_float_mpfr& x);
- static mp_float_mpfr my_cosh (const mp_float_mpfr& x);
- static mp_float_mpfr my_tanh (const mp_float_mpfr& x);
- static mp_float_mpfr my_asinh (const mp_float_mpfr& x);
- static mp_float_mpfr my_acosh (const mp_float_mpfr& x);
- static mp_float_mpfr my_atanh (const mp_float_mpfr& x);
- static mp_float_mpfr my_gamma (const mp_float_mpfr& x);
- static mp_float_mpfr my_riemann_zeta (const mp_float_mpfr& x);
- static mp_float_mpfr my_cyl_bessel_jn(const boost::int32_t n, const mp_float_mpfr& x);
- static mp_float_mpfr my_cyl_bessel_yn(const boost::int32_t n, const mp_float_mpfr& x);
-
- virtual bool has_its_own_cbrt (void) const { return true; }
- virtual bool has_its_own_rootn (void) const { return true; }
- virtual bool has_its_own_exp (void) const { return true; }
- virtual bool has_its_own_log (void) const { return true; }
- virtual bool has_its_own_sin (void) const { return true; }
- virtual bool has_its_own_cos (void) const { return true; }
- virtual bool has_its_own_tan (void) const { return true; }
- virtual bool has_its_own_asin (void) const { return true; }
- virtual bool has_its_own_acos (void) const { return true; }
- virtual bool has_its_own_atan (void) const { return true; }
- virtual bool has_its_own_sinh (void) const { return true; }
- virtual bool has_its_own_cosh (void) const { return true; }
- virtual bool has_its_own_tanh (void) const { return true; }
- virtual bool has_its_own_asinh (void) const { return true; }
- virtual bool has_its_own_acosh (void) const { return true; }
- virtual bool has_its_own_atanh (void) const { return true; }
- virtual bool has_its_own_gamma (void) const { return false; }
- virtual bool has_its_own_riemann_zeta (void) const { return false; }
- virtual bool has_its_own_cyl_bessel_jn(void) const { return false; }
- virtual bool has_its_own_cyl_bessel_yn(void) const { return false; }
-
- private:
- static void init(void);
-
- void from_unsigned_long_long(const unsigned long long u);
- void from_unsigned_long(const unsigned long u);
-
- virtual bool rd_string(const char* const s);
-
- virtual boost::int64_t get_order_exact(void) const;
- virtual boost::int64_t get_order_fast(void) const;
- virtual void get_output_string(std::string& str, boost::int64_t& my_exp, const std::size_t number_of_digits) const;
- };
- }
- }
-
-#endif // _MP_FLOAT_MPFR_HPP_


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