/////////////////////////////////////////////////////////////////////////////// // Copyright 2013 John Maddock. 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) #ifndef BOOST_MP_UBLAS_HPP #define BOOST_MP_UBLAS_HPP namespace boost { namespace numeric { namespace ublas { template class sparse_vector_element; template inline bool operator==(const sparse_vector_element& a, const ::boost::multiprecision::number& b) { using ref_type = typename sparse_vector_element::const_reference; return static_cast(a) == b; } template struct promote_traits; template struct promote_traits, boost::multiprecision::number > { using number1_t = boost::multiprecision::number; using number2_t = boost::multiprecision::number; using promote_type = typename std::conditional< std::is_convertible::value && !std::is_convertible::value, number2_t, number1_t>::type; }; template struct promote_traits, Arithmetic> { using promote_type = boost::multiprecision::number; }; template struct promote_traits > { using promote_type = boost::multiprecision::number; }; template struct promote_traits, boost::multiprecision::detail::expression > { using number1_t = boost::multiprecision::number ; using expression_type = boost::multiprecision::detail::expression; using number2_t = typename expression_type::result_type ; using promote_type = typename promote_traits::promote_type ; }; template struct promote_traits, boost::multiprecision::number > { using number1_t = boost::multiprecision::number ; using expression_type = boost::multiprecision::detail::expression; using number2_t = typename expression_type::result_type ; using promote_type = typename promote_traits::promote_type ; }; template struct promote_traits, boost::multiprecision::detail::expression > { using expression1_t = boost::multiprecision::detail::expression ; using number1_t = typename expression1_t::result_type ; using expression2_t = boost::multiprecision::detail::expression; using number2_t = typename expression2_t::result_type ; }; }}} // namespace boost::numeric::ublas #endif