/*============================================================================= Copyright (c) 2011-2016 Bolero MURAKAMI https://github.com/bolero-MURAKAMI/Sprout 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 SPROUT_MATH_QUATERNION_DETAIL_ABS_MAX_HPP #define SPROUT_MATH_QUATERNION_DETAIL_ABS_MAX_HPP #include #include #include #include #include namespace sprout { namespace math { namespace detail { template class abs_less { public: SPROUT_CONSTEXPR T operator()(T const& lhs, T const& rhs) const { return sprout::math::abs(lhs) < sprout::math::abs(rhs); } }; template SPROUT_CONSTEXPR T abs_max(sprout::array const& c) { return sprout::math::abs(*sprout::range::max_element(c, sprout::math::detail::abs_less())); } } // namespace detail } // namespace math } // namespace sprout #endif // #ifndef SPROUT_MATH_QUATERNION_DETAIL_ABS_MAX_HPP