diff --git a/include/boost/multiprecision/concepts/mp_number_architypes.hpp b/include/boost/multiprecision/concepts/mp_number_architypes.hpp index fbec67b3..032f78f7 100644 --- a/include/boost/multiprecision/concepts/mp_number_architypes.hpp +++ b/include/boost/multiprecision/concepts/mp_number_architypes.hpp @@ -23,52 +23,52 @@ namespace concepts{ #pragma warning(disable:4244) #endif -struct big_number_backend_real_architype +struct mp_number_backend_real_architype { typedef mpl::list signed_types; typedef mpl::list unsigned_types; typedef mpl::list real_types; - big_number_backend_real_architype() + mp_number_backend_real_architype() { std::cout << "Default construct" << std::endl; } - big_number_backend_real_architype(const big_number_backend_real_architype& o) + mp_number_backend_real_architype(const mp_number_backend_real_architype& o) { std::cout << "Copy construct" << std::endl; m_value = o.m_value; } - big_number_backend_real_architype& operator = (const big_number_backend_real_architype& o) + mp_number_backend_real_architype& operator = (const mp_number_backend_real_architype& o) { m_value = o.m_value; std::cout << "Assignment (" << m_value << ")" << std::endl; return *this; } - big_number_backend_real_architype& operator = (boost::uintmax_t i) + mp_number_backend_real_architype& operator = (boost::uintmax_t i) { m_value = i; std::cout << "UInt Assignment (" << i << ")" << std::endl; return *this; } - big_number_backend_real_architype& operator = (boost::intmax_t i) + mp_number_backend_real_architype& operator = (boost::intmax_t i) { m_value = i; std::cout << "Int Assignment (" << i << ")" << std::endl; return *this; } - big_number_backend_real_architype& operator = (long double d) + mp_number_backend_real_architype& operator = (long double d) { m_value = d; std::cout << "long double Assignment (" << d << ")" << std::endl; return *this; } - big_number_backend_real_architype& operator = (const char* s) + mp_number_backend_real_architype& operator = (const char* s) { m_value = boost::lexical_cast(s); std::cout << "const char* Assignment (" << s << ")" << std::endl; return *this; } - void swap(big_number_backend_real_architype& o) + void swap(mp_number_backend_real_architype& o) { std::cout << "Swapping (" << m_value << " with " << o.m_value << ")" << std::endl; std::swap(m_value, o.m_value); @@ -99,7 +99,7 @@ struct big_number_backend_real_architype std::cout << "Negating (" << m_value << ")" << std::endl; m_value = -m_value; } - int compare(const big_number_backend_real_architype& o)const + int compare(const mp_number_backend_real_architype& o)const { std::cout << "Comparison" << std::endl; return m_value > o.m_value ? 1 : (m_value < o.m_value ? -1 : 0); @@ -122,151 +122,151 @@ struct big_number_backend_real_architype long double m_value; }; -inline void add(big_number_backend_real_architype& result, const big_number_backend_real_architype& o) +inline void add(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& o) { std::cout << "Addition (" << result.m_value << " += " << o.m_value << ")" << std::endl; result.m_value += o.m_value; } -inline void subtract(big_number_backend_real_architype& result, const big_number_backend_real_architype& o) +inline void subtract(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& o) { std::cout << "Subtraction (" << result.m_value << " -= " << o.m_value << ")" << std::endl; result.m_value -= o.m_value; } -inline void multiply(big_number_backend_real_architype& result, const big_number_backend_real_architype& o) +inline void multiply(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& o) { std::cout << "Multiplication (" << result.m_value << " *= " << o.m_value << ")" << std::endl; result.m_value *= o.m_value; } -inline void divide(big_number_backend_real_architype& result, const big_number_backend_real_architype& o) +inline void divide(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& o) { std::cout << "Division (" << result.m_value << " /= " << o.m_value << ")" << std::endl; result.m_value /= o.m_value; } -inline void convert_to(boost::uintmax_t* result, const big_number_backend_real_architype& val) +inline void convert_to(boost::uintmax_t* result, const mp_number_backend_real_architype& val) { *result = static_cast(val.m_value); } -inline void convert_to(boost::intmax_t* result, const big_number_backend_real_architype& val) +inline void convert_to(boost::intmax_t* result, const mp_number_backend_real_architype& val) { *result = static_cast(val.m_value); } -inline void convert_to(long double* result, big_number_backend_real_architype& val) +inline void convert_to(long double* result, mp_number_backend_real_architype& val) { *result = val.m_value; } -inline void eval_frexp(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg, int* exp) +inline void eval_frexp(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg, int* exp) { result = std::frexp(arg.m_value, exp); } -inline void eval_ldexp(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg, int exp) +inline void eval_ldexp(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg, int exp) { result = std::ldexp(arg.m_value, exp); } -inline void eval_floor(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_floor(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::floor(arg.m_value); } -inline void eval_ceil(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_ceil(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::ceil(arg.m_value); } -inline void eval_trunc(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_trunc(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = boost::math::trunc(arg.m_value); } -inline void eval_sqrt(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_sqrt(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::sqrt(arg.m_value); } -inline void eval_abs(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_abs(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::abs(arg.m_value); } -inline void eval_fabs(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_fabs(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::fabs(arg.m_value); } -inline int eval_fpclassify(const big_number_backend_real_architype& arg) +inline int eval_fpclassify(const mp_number_backend_real_architype& arg) { return boost::math::fpclassify(arg.m_value); } -inline void eval_pow(big_number_backend_real_architype& result, const big_number_backend_real_architype& b, const big_number_backend_real_architype& e) +inline void eval_pow(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& b, const mp_number_backend_real_architype& e) { result = std::pow(b.m_value, e.m_value); } -inline void eval_pow(big_number_backend_real_architype& result, const big_number_backend_real_architype& b, int e) +inline void eval_pow(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& b, int e) { result = std::pow(b.m_value, e); } -inline void eval_exp(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_exp(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::exp(arg.m_value); } -inline void eval_log(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_log(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::log(arg.m_value); } -inline void eval_sin(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_sin(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::sin(arg.m_value); } -inline void eval_cos(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_cos(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::cos(arg.m_value); } -inline void eval_tan(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_tan(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::tan(arg.m_value); } -inline void eval_asin(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_asin(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::asin(arg.m_value); } -inline void eval_acos(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_acos(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::acos(arg.m_value); } -inline void eval_atan(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_atan(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::atan(arg.m_value); } -inline void eval_sinh(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_sinh(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::sinh(arg.m_value); } -inline void eval_cosh(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_cosh(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::cosh(arg.m_value); } -inline void eval_tanh(big_number_backend_real_architype& result, const big_number_backend_real_architype& arg) +inline void eval_tanh(mp_number_backend_real_architype& result, const mp_number_backend_real_architype& arg) { result = std::tanh(arg.m_value); } -typedef boost::multiprecision::mp_number big_number_real_architype; +typedef boost::multiprecision::mp_number mp_number_real_architype; }}} // namespaces @@ -277,10 +277,10 @@ namespace std{ #endif template <> -class numeric_limits : public std::numeric_limits +class numeric_limits : public std::numeric_limits { typedef std::numeric_limits base_type; - typedef boost::multiprecision::concepts::big_number_real_architype number_type; + typedef boost::multiprecision::concepts::mp_number_real_architype number_type; public: BOOST_STATIC_CONSTEXPR number_type (min)() noexcept { return (base_type::min)(); } BOOST_STATIC_CONSTEXPR number_type (max)() noexcept { return (base_type::max)(); } diff --git a/include/boost/multiprecision/detail/mp_number_base.hpp b/include/boost/multiprecision/detail/mp_number_base.hpp index 6b85d7d4..39fd8500 100644 --- a/include/boost/multiprecision/detail/mp_number_base.hpp +++ b/include/boost/multiprecision/detail/mp_number_base.hpp @@ -137,13 +137,13 @@ struct backend_type > template -struct is_big_number : public mpl::false_{}; +struct is_mp_number : public mpl::false_{}; template -struct is_big_number > : public mpl::true_{}; +struct is_mp_number > : public mpl::true_{}; template -struct is_big_number_exp : public mpl::false_{}; +struct is_mp_number_exp : public mpl::false_{}; template -struct is_big_number_exp > : public mpl::true_{}; +struct is_mp_number_exp > : public mpl::true_{}; template struct combine_expression; @@ -187,25 +187,25 @@ struct unmentionable typedef void (*unmentionable_type)(); template -struct big_number_exp_storage +struct mp_exp_storage { typedef const T& type; }; template -struct big_number_exp_storage +struct mp_exp_storage { typedef T* type; }; template -struct big_number_exp_storage +struct mp_exp_storage { typedef const T* type; }; template -struct big_number_exp_storage > +struct mp_exp_storage > { typedef mp_exp type; }; @@ -233,7 +233,7 @@ struct mp_exp } private: - typename big_number_exp_storage::type arg; + typename mp_exp_storage::type arg; }; template @@ -255,7 +255,7 @@ struct mp_exp } private: - typename big_number_exp_storage::type arg; + typename mp_exp_storage::type arg; }; template @@ -286,8 +286,8 @@ struct mp_exp static const unsigned right_depth = right_type::depth + 1; static const unsigned depth = left_depth > right_depth ? left_depth : right_depth; private: - typename big_number_exp_storage::type arg1; - typename big_number_exp_storage::type arg2; + typename mp_exp_storage::type arg1; + typename mp_exp_storage::type arg2; }; template @@ -326,9 +326,9 @@ struct mp_exp static const unsigned right_depth = right_type::depth + 1; static const unsigned depth = left_depth > right_depth ? (left_depth > middle_depth ? left_depth : middle_depth) : (right_depth > middle_depth ? right_depth : middle_depth); private: - typename big_number_exp_storage::type arg1; - typename big_number_exp_storage::type arg2; - typename big_number_exp_storage::type arg3; + typename mp_exp_storage::type arg1; + typename mp_exp_storage::type arg2; + typename mp_exp_storage::type arg3; }; } // namespace detail diff --git a/include/boost/multiprecision/mp_number.hpp b/include/boost/multiprecision/mp_number.hpp index 053d45a6..e54c85cb 100644 --- a/include/boost/multiprecision/mp_number.hpp +++ b/include/boost/multiprecision/mp_number.hpp @@ -1384,37 +1384,37 @@ namespace detail { template -inline int big_number_compare(const mp_number& a, const mp_number& b) +inline int mp_number_compare(const mp_number& a, const mp_number& b) { return a.compare(b); } template -inline int big_number_compare(const mp_number& a, const mp_exp& b) +inline int mp_number_compare(const mp_number& a, const mp_exp& b) { return a.compare(mp_number(b)); } template -inline int big_number_compare(const mp_exp& a, const mp_number& b) +inline int mp_number_compare(const mp_exp& a, const mp_number& b) { return -b.compare(mp_number(a)); } template -inline int big_number_compare(const mp_number& a, const Val b) +inline int mp_number_compare(const mp_number& a, const Val b) { return a.compare(b); } template -inline int big_number_compare(const Val a, const mp_number& b) +inline int mp_number_compare(const Val a, const mp_number& b) { return -b.compare(a); } template -inline int big_number_compare(const mp_exp& a, const mp_exp& b) +inline int mp_number_compare(const mp_exp& a, const mp_exp& b) { typedef typename mp_exp::result_type real1; typedef typename mp_exp::result_type real2; @@ -1422,7 +1422,7 @@ inline int big_number_compare(const mp_exp& a, const mp_exp -inline typename enable_if, int>::type big_number_compare(const mp_exp& a, const Val b) +inline typename enable_if, int>::type mp_number_compare(const mp_exp& a, const Val b) { typedef typename mp_exp::result_type real; real t(a); @@ -1430,7 +1430,7 @@ inline typename enable_if, int>::type big_number_compare(cons } template -inline typename enable_if, int>::type big_number_compare(const Val a, const mp_exp& b) +inline typename enable_if, int>::type mp_number_compare(const Val a, const mp_exp& b) { typedef typename mp_exp::result_type real; return -real(b).compare(a); @@ -1440,12 +1440,12 @@ template struct is_valid_comparison_imp { typedef typename mpl::or_< - is_big_number, - is_big_number_exp + is_mp_number, + is_mp_number_exp >::type is1; typedef typename mpl::or_< - is_big_number, - is_big_number_exp + is_mp_number, + is_mp_number_exp >::type is2; typedef typename mpl::or_< mpl::and_< @@ -1475,42 +1475,42 @@ template inline typename boost::enable_if, bool>::type operator == (const Exp1& a, const Exp2& b) { - return 0 == detail::big_number_compare(a, b); + return 0 == detail::mp_number_compare(a, b); } template inline typename boost::enable_if, bool>::type operator != (const Exp1& a, const Exp2& b) { - return 0 != detail::big_number_compare(a, b); + return 0 != detail::mp_number_compare(a, b); } template inline typename boost::enable_if, bool>::type operator <= (const Exp1& a, const Exp2& b) { - return 0 >= detail::big_number_compare(a, b); + return 0 >= detail::mp_number_compare(a, b); } template inline typename boost::enable_if, bool>::type operator < (const Exp1& a, const Exp2& b) { - return 0 > detail::big_number_compare(a, b); + return 0 > detail::mp_number_compare(a, b); } template inline typename boost::enable_if, bool>::type operator >= (const Exp1& a, const Exp2& b) { - return 0 <= detail::big_number_compare(a, b); + return 0 <= detail::mp_number_compare(a, b); } template inline typename boost::enable_if, bool>::type operator > (const Exp1& a, const Exp2& b) { - return 0 < detail::big_number_compare(a, b); + return 0 < detail::mp_number_compare(a, b); } template diff --git a/test/mp_number_concept_check.cpp b/test/mp_number_concept_check.cpp index 635e5de0..cc814372 100644 --- a/test/mp_number_concept_check.cpp +++ b/test/mp_number_concept_check.cpp @@ -57,7 +57,7 @@ void foo() { #ifdef TEST_BACKEND - instantiate(boost::multiprecision::big_number_real_architype()); + instantiate(boost::multiprecision::mp_number_real_architype()); #endif #ifdef TEST_MPF_50 instantiate(boost::multiprecision::mpf_real_50()); @@ -79,7 +79,7 @@ void foo() int main() { #ifdef TEST_BACKEND - BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept)); + BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept)); #endif #ifdef TEST_MPF_50 BOOST_CONCEPT_ASSERT((boost::math::concepts::RealTypeConcept)); diff --git a/test/test_arithmetic.cpp b/test/test_arithmetic.cpp index d9eebcec..2c837f26 100644 --- a/test/test_arithmetic.cpp +++ b/test/test_arithmetic.cpp @@ -859,7 +859,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF50 test(); diff --git a/test/test_exp.cpp b/test/test_exp.cpp index 5415448a..592ae720 100644 --- a/test/test_exp.cpp +++ b/test/test_exp.cpp @@ -113,7 +113,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF50 test(); diff --git a/test/test_numeric_limits.cpp b/test/test_numeric_limits.cpp index d378becd..28c354c9 100644 --- a/test/test_numeric_limits.cpp +++ b/test/test_numeric_limits.cpp @@ -138,7 +138,7 @@ void test() int main() { #ifdef TEST_BACKEND - test >(); + test >(); #endif #ifdef TEST_MPF50 test();