add boost on mac

This commit is contained in:
Bassem Girgis
2019-08-10 16:38:17 -05:00
parent 861b918727
commit be945cb63b
14105 changed files with 2714968 additions and 0 deletions

View File

@@ -0,0 +1,99 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Vicente J. Botet Escriba 2009-2011
// Copyright 2012 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_EXPLICIT_CONVERTIBLE_HPP
#define BOOST_MP_EXPLICIT_CONVERTIBLE_HPP
#include <boost/config.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/declval.hpp>
#include <boost/multiprecision/detail/number_base.hpp> // number_category
namespace boost {
namespace multiprecision {
namespace detail {
template <unsigned int N>
struct dummy_size {};
template<typename S, typename T>
struct has_generic_interconversion
{
typedef typename boost::conditional <
is_number<S>::value && is_number<T>::value,
typename boost::conditional <
number_category<S>::value == number_kind_integer,
typename boost::conditional<
number_category<T>::value == number_kind_integer
|| number_category<T>::value == number_kind_floating_point
|| number_category<T>::value == number_kind_rational
|| number_category<T>::value == number_kind_fixed_point,
boost::true_type,
boost::false_type
>::type,
typename boost::conditional<
number_category<S>::value == number_kind_rational,
typename boost::conditional<
number_category<T>::value == number_kind_rational
|| number_category<T>::value == number_kind_rational,
boost::true_type,
boost::false_type
>::type,
typename boost::conditional<
number_category<T>::value == number_kind_floating_point,
boost::true_type,
boost::false_type
>::type
>::type
> ::type,
boost::false_type
> ::type type;
};
template<typename S, typename T>
struct is_explicitly_convertible_imp
{
#ifndef BOOST_NO_SFINAE_EXPR
template<typename S1, typename T1>
static type_traits::yes_type selector(dummy_size<sizeof(new T1(boost::declval<
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
S1
#else
S1 const&
#endif
>()))>*);
template<typename S1, typename T1>
static type_traits::no_type selector(...);
static const bool value = sizeof(selector<S, T>(0)) == sizeof(type_traits::yes_type);
typedef boost::integral_constant<bool, value> type;
#else
typedef typename has_generic_interconversion<S, T>::type gen_type;
typedef boost::integral_constant<bool, boost::is_convertible<S, T>::value || gen_type::value> type;
#endif
};
template<typename From, typename To>
struct is_explicitly_convertible : public is_explicitly_convertible_imp<From, To>::type
{
};
#ifdef BOOST_NO_SFINAE_EXPR
template<class Backend1, expression_template_option ExpressionTemplates1, class Backend2, expression_template_option ExpressionTemplates2>
struct is_explicitly_convertible<number<Backend1, ExpressionTemplates1>, number<Backend2, ExpressionTemplates2> >
: public is_explicitly_convertible<Backend1, Backend2>
{
};
#endif
}}} // namespaces
#endif

View File

@@ -0,0 +1,28 @@
///////////////////////////////////////////////////////////////
// Copyright 2012 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_
#ifndef BOOST_MATH_EXTRACT_EXPONENT_HPP
#define BOOST_MATH_EXTRACT_EXPONENT_HPP
#include <boost/multiprecision/number.hpp>
namespace boost{
namespace multiprecision{
namespace backends{
template <class Backend, int cat>
struct extract_exponent_type
{
typedef int type;
};
template <class Backend>
struct extract_exponent_type<Backend, number_kind_floating_point>
{
typedef typename Backend::exponent_type type;
};
}}} // namespaces
#endif

View File

@@ -0,0 +1,63 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright 2015 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_IS_BACKEND_HPP
#define BOOST_MP_IS_BACKEND_HPP
#include <boost/mpl/has_xxx.hpp>
#include <boost/type_traits/conditional.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/multiprecision/detail/number_base.hpp>
namespace boost{ namespace multiprecision{ namespace detail{
BOOST_MPL_HAS_XXX_TRAIT_DEF(signed_types)
BOOST_MPL_HAS_XXX_TRAIT_DEF(unsigned_types)
BOOST_MPL_HAS_XXX_TRAIT_DEF(float_types)
template <class T>
struct is_backend
{
static const bool value = has_signed_types<T>::value && has_unsigned_types<T>::value && has_float_types<T>::value;
};
template <class Backend>
struct other_backend
{
typedef typename boost::conditional<
boost::is_same<number<Backend>, number<Backend, et_on> >::value,
number<Backend, et_off>, number<Backend, et_on> >::type type;
};
template <class B, class V>
struct number_from_backend
{
typedef typename boost::conditional <
boost::is_convertible<V, number<B> >::value,
number<B>,
typename other_backend<B>::type > ::type type;
};
template <bool b, class T, class U>
struct is_first_backend_imp{ static const bool value = false; };
template <class T, class U>
struct is_first_backend_imp<true, T, U>{ static const bool value = is_convertible<U, number<T, et_on> >::value || is_convertible<U, number<T, et_off> >::value; };
template <class T, class U>
struct is_first_backend : is_first_backend_imp<is_backend<T>::value, T, U> {};
template <bool b, class T, class U>
struct is_second_backend_imp{ static const bool value = false; };
template <class T, class U>
struct is_second_backend_imp<true, T, U>{ static const bool value = (is_convertible<T, number<U, et_on> >::value || is_convertible<T, number<U, et_off> >::value) && !is_first_backend<T, U>::value; };
template <class T, class U>
struct is_second_backend : is_second_backend_imp<is_backend<U>::value, T, U> {};
}
}
}
#endif // BOOST_MP_IS_BACKEND_HPP

View File

@@ -0,0 +1,36 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright 2015 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_IS_BYTE_CONTAINER_HPP
#define BOOST_IS_BYTE_CONTAINER_HPP
#include <iterator>
#include <boost/mpl/has_xxx.hpp>
#include <boost/type_traits/is_integral.hpp>
#include <boost/type_traits/remove_cv.hpp>
namespace boost{ namespace multiprecision{ namespace detail{
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(has_member_const_iterator, const_iterator, false)
template <class C, bool b>
struct is_byte_container_imp
{
// Note: Don't use C::value_type as this is a rather widespread typedef, even for non-range types
typedef typename boost::remove_cv<typename std::iterator_traits<typename C::const_iterator>::value_type>::type container_value_type;
static const bool value = boost::is_integral<container_value_type>::value && (sizeof(container_value_type) == 1);
};
template <class C>
struct is_byte_container_imp<C, false> : public boost::false_type {};
template <class C>
struct is_byte_container : public is_byte_container_imp<C, has_member_const_iterator<C>::value> {};
}}} // namespaces
#endif // BOOST_IS_BYTE_CONTAINER_HPP

View File

@@ -0,0 +1,48 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Vicente J. Botet Escriba 2009-2011
// Copyright 2012 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_RESTRICTED_CONVERSION_HPP
#define BOOST_MP_RESTRICTED_CONVERSION_HPP
#include <boost/multiprecision/traits/explicit_conversion.hpp>
#include <boost/mpl/if.hpp>
#include <boost/multiprecision/detail/number_base.hpp>
namespace boost{ namespace multiprecision{ namespace detail{
template <class From, class To>
struct is_lossy_conversion
{
typedef typename mpl::if_c<
((number_category<From>::value == number_kind_floating_point) && (number_category<To>::value == number_kind_integer))
/* || ((number_category<From>::value == number_kind_floating_point) && (number_category<To>::value == number_kind_rational))*/
|| ((number_category<From>::value == number_kind_rational) && (number_category<To>::value == number_kind_integer))
|| ((number_category<From>::value == number_kind_fixed_point) && (number_category<To>::value == number_kind_integer))
|| (number_category<From>::value == number_kind_unknown)
|| (number_category<To>::value == number_kind_unknown),
mpl::true_,
mpl::false_
>::type type;
static const bool value = type::value;
};
template<typename From, typename To>
struct is_restricted_conversion
{
typedef typename mpl::if_c<
((is_explicitly_convertible<From, To>::value && !is_convertible<From, To>::value)
|| is_lossy_conversion<From, To>::value),
mpl::true_,
mpl::false_
>::type type;
static const bool value = type::value;
};
}}} // namespaces
#endif // BOOST_MP_RESTRICTED_CONVERSION_HPP

View File

@@ -0,0 +1,24 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright 2018 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_IS_VARIABLE_PRECISION_HPP
#define BOOST_MP_IS_VARIABLE_PRECISION_HPP
#include <boost/type_traits/integral_constant.hpp>
#include <boost/multiprecision/detail/number_base.hpp>
namespace boost{ namespace multiprecision{ namespace detail{
template <class Backend>
struct is_variable_precision : public false_type{};
template <class Backend, expression_template_option ExpressionTemplates>
struct is_variable_precision<number<Backend, ExpressionTemplates> > : public is_variable_precision<Backend> {};
}
}
}
#endif // BOOST_MP_IS_BACKEND_HPP