Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor promotion.hpp (no policy promotion changes) #1022

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/boost/math/ccmath/copysign.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ constexpr auto copysign(T1 mag, T2 sgn) noexcept
{
if (BOOST_MATH_IS_CONSTANT_EVALUATED(mag))
{
using promoted_type = boost::math::tools::promote_args_2_t<T1, T2>;
using promoted_type = boost::math::tools::promote_args_t<T1, T2>;
return boost::math::ccmath::copysign(static_cast<promoted_type>(mag), static_cast<promoted_type>(sgn));
}
else
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/ccmath/fdim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ constexpr auto fdim(T1 x, T2 y) noexcept
{
if (BOOST_MATH_IS_CONSTANT_EVALUATED(x))
{
using promoted_type = boost::math::tools::promote_args_2_t<T1, T2>;
using promoted_type = boost::math::tools::promote_args_t<T1, T2>;
return boost::math::ccmath::fdim(promoted_type(x), promoted_type(y));
}
else
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/ccmath/fmax.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ constexpr auto fmax(T1 x, T2 y) noexcept
{
if (BOOST_MATH_IS_CONSTANT_EVALUATED(x))
{
using promoted_type = boost::math::tools::promote_args_2_t<T1, T2>;
using promoted_type = boost::math::tools::promote_args_t<T1, T2>;
return boost::math::ccmath::fmax(static_cast<promoted_type>(x), static_cast<promoted_type>(y));
}
else
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/ccmath/fmin.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ constexpr auto fmin(T1 x, T2 y) noexcept
{
if (BOOST_MATH_IS_CONSTANT_EVALUATED(x))
{
using promoted_type = boost::math::tools::promote_args_2_t<T1, T2>;
using promoted_type = boost::math::tools::promote_args_t<T1, T2>;
return boost::math::ccmath::fmin(static_cast<promoted_type>(x), static_cast<promoted_type>(y));
}
else
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/ccmath/hypot.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ constexpr auto hypot(T1 x, T2 y) noexcept
{
if(BOOST_MATH_IS_CONSTANT_EVALUATED(x))
{
using promoted_type = boost::math::tools::promote_args_2_t<T1, T2>;
using promoted_type = boost::math::tools::promote_args_t<T1, T2>;
return boost::math::ccmath::hypot(static_cast<promoted_type>(x), static_cast<promoted_type>(y));
}
else
Expand Down
14 changes: 7 additions & 7 deletions include/boost/math/differentiation/autodiff.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace detail {

template <typename RealType, typename... RealTypes>
struct promote_args_n {
using type = typename tools::promote_args_2<RealType, typename promote_args_n<RealTypes...>::type>::type;
using type = typename tools::promote_args<RealType, typename promote_args_n<RealTypes...>::type>::type;
};

template <typename RealType>
Expand Down Expand Up @@ -2002,9 +2002,9 @@ using autodiff_root_type = typename autodiff_fvar_type<RealType, Order>::root_ty

// See boost/math/tools/promotion.hpp
template <typename RealType0, size_t Order0, typename RealType1, size_t Order1>
struct promote_args_2<detail::autodiff_fvar_type<RealType0, Order0>,
struct promote_args<detail::autodiff_fvar_type<RealType0, Order0>,
detail::autodiff_fvar_type<RealType1, Order1>> {
using type = detail::autodiff_fvar_type<typename promote_args_2<RealType0, RealType1>::type,
using type = detail::autodiff_fvar_type<typename promote_args<RealType0, RealType1>::type,
#ifndef BOOST_NO_CXX14_CONSTEXPR
(std::max)(Order0, Order1)>;
#else
Expand All @@ -2018,13 +2018,13 @@ struct promote_args<detail::autodiff_fvar_type<RealType, Order>> {
};

template <typename RealType0, size_t Order0, typename RealType1>
struct promote_args_2<detail::autodiff_fvar_type<RealType0, Order0>, RealType1> {
using type = detail::autodiff_fvar_type<typename promote_args_2<RealType0, RealType1>::type, Order0>;
struct promote_args<detail::autodiff_fvar_type<RealType0, Order0>, RealType1> {
using type = detail::autodiff_fvar_type<typename promote_args<RealType0, RealType1>::type, Order0>;
};

template <typename RealType0, typename RealType1, size_t Order1>
struct promote_args_2<RealType0, detail::autodiff_fvar_type<RealType1, Order1>> {
using type = detail::autodiff_fvar_type<typename promote_args_2<RealType0, RealType1>::type, Order1>;
struct promote_args<RealType0, detail::autodiff_fvar_type<RealType1, Order1>> {
using type = detail::autodiff_fvar_type<typename promote_args<RealType0, RealType1>::type, Order1>;
};

template <typename destination_t, typename RealType, std::size_t Order>
Expand Down
Loading
Loading