fix math implementation.

This commit is contained in:
bolero-MURAKAMI 2012-06-23 13:22:50 +09:00
parent 3500d0d49c
commit 1636398742
49 changed files with 227 additions and 456 deletions

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/partition_copy.hpp> #include <sprout/algorithm/fixed/partition_copy.hpp>
#include <sprout/algorithm/fit/result_of.hpp> #include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp> #include <sprout/sub_array.hpp>
#include <sprout/detail/algorithm_ext.hpp> #include <sprout/detail/count_n_if.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT #include HDR_FUNCTIONAL_SSCRISK_CEL_OR_SPROUT

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/set_difference.hpp> #include <sprout/algorithm/fixed/set_difference.hpp>
#include <sprout/algorithm/fit/result_of.hpp> #include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp> #include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp> #include <sprout/detail/set_overlap_count.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
@ -30,7 +30,7 @@ namespace sprout {
offset, offset,
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
- sprout::detail::overlap_count_2(first1, last1, first2, last2, comp) - sprout::detail::set_overlap_count(first1, last1, first2, last2, comp)
, ,
sprout::size(result) sprout::size(result)
) )
@ -69,7 +69,7 @@ namespace sprout {
offset, offset,
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
- sprout::detail::overlap_count_2(first1, last1, first2, last2) - sprout::detail::set_overlap_count(first1, last1, first2, last2)
, ,
sprout::size(result) sprout::size(result)
) )

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/set_intersection.hpp> #include <sprout/algorithm/fixed/set_intersection.hpp>
#include <sprout/algorithm/fit/result_of.hpp> #include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp> #include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp> #include <sprout/detail/set_overlap_count.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
namespace sprout { namespace sprout {
@ -28,7 +28,7 @@ namespace sprout {
sprout::get_internal(sprout::fixed::set_intersection(first1, last1, first2, last2, result, comp)), sprout::get_internal(sprout::fixed::set_intersection(first1, last1, first2, last2, result, comp)),
offset, offset,
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
sprout::detail::overlap_count_2(first1, last1, first2, last2, comp), sprout::detail::set_overlap_count(first1, last1, first2, last2, comp),
sprout::size(result) sprout::size(result)
) )
); );
@ -65,7 +65,7 @@ namespace sprout {
sprout::get_internal(sprout::fixed::set_intersection(first1, last1, first2, last2, result)), sprout::get_internal(sprout::fixed::set_intersection(first1, last1, first2, last2, result)),
offset, offset,
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
sprout::detail::overlap_count_2(first1, last1, first2, last2), sprout::detail::set_overlap_count(first1, last1, first2, last2),
sprout::size(result) sprout::size(result)
) )
); );

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/set_symmetric_difference.hpp> #include <sprout/algorithm/fixed/set_symmetric_difference.hpp>
#include <sprout/algorithm/fit/result_of.hpp> #include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp> #include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp> #include <sprout/detail/set_overlap_count.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
@ -31,7 +31,7 @@ namespace sprout {
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2) + NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- 2 * sprout::detail::overlap_count_2(first1, last1, first2, last2, comp) - 2 * sprout::detail::set_overlap_count(first1, last1, first2, last2, comp)
, ,
sprout::size(result) sprout::size(result)
) )
@ -71,7 +71,7 @@ namespace sprout {
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2) + NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- 2 * sprout::detail::overlap_count_2(first1, last1, first2, last2) - 2 * sprout::detail::set_overlap_count(first1, last1, first2, last2)
, ,
sprout::size(result) sprout::size(result)
) )

View file

@ -7,7 +7,7 @@
#include <sprout/algorithm/fixed/set_union.hpp> #include <sprout/algorithm/fixed/set_union.hpp>
#include <sprout/algorithm/fit/result_of.hpp> #include <sprout/algorithm/fit/result_of.hpp>
#include <sprout/sub_array.hpp> #include <sprout/sub_array.hpp>
#include <sprout/detail/overlap_count_2.hpp> #include <sprout/detail/set_overlap_count.hpp>
#include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT #include HDR_ALGORITHM_SSCRISK_CEL_OR_SPROUT
#include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT #include HDR_ITERATOR_SSCRISK_CEL_OR_SPROUT
@ -31,7 +31,7 @@ namespace sprout {
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2) + NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- sprout::detail::overlap_count_2(first1, last1, first2, last2, comp) - sprout::detail::set_overlap_count(first1, last1, first2, last2, comp)
, ,
sprout::size(result) sprout::size(result)
) )
@ -71,7 +71,7 @@ namespace sprout {
offset + NS_SSCRISK_CEL_OR_SPROUT::min( offset + NS_SSCRISK_CEL_OR_SPROUT::min(
NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1) NS_SSCRISK_CEL_OR_SPROUT::distance(first1, last1)
+ NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2) + NS_SSCRISK_CEL_OR_SPROUT::distance(first2, last2)
- sprout::detail::overlap_count_2(first1, last1, first2, last2) - sprout::detail::set_overlap_count(first1, last1, first2, last2)
, ,
sprout::size(result) sprout::size(result)
) )

View file

@ -1,44 +0,0 @@
#ifndef SPROUT_DETAIL_ALGORITHM_EXT_HPP
#define SPROUT_DETAIL_ALGORITHM_EXT_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
namespace detail {
//
// count_n
//
template<typename InputIterator, typename Size, typename T>
SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type count_n(
InputIterator first,
Size n,
T const& value
)
{
return n == 0
? 0
: (*first == value ? 1 : 0) + sprout::detail::count_n(sprout::next(first), n - 1, value)
;
}
//
// count_n_if
//
template<typename InputIterator, typename Size, typename Predicate>
SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type count_n_if(
InputIterator first,
Size n,
Predicate pred
)
{
return n == 0
? 0
: (pred(*first) ? 1 : 0) + sprout::detail::count_n_if(sprout::next(first), n - 1, pred)
;
}
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_ALGORITHM_EXT_HPP

27
sprout/detail/count_n.hpp Normal file
View file

@ -0,0 +1,27 @@
#ifndef SPROUT_DETAIL_COUNT_N_HPP
#define SPROUT_DETAIL_COUNT_N_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
namespace detail {
//
// count_n
//
template<typename InputIterator, typename Size, typename T>
SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type count_n(
InputIterator first,
Size n,
T const& value
)
{
return n == 0 ? 0
: (*first == value ? 1 : 0) + sprout::detail::count_n(sprout::next(first), n - 1, value)
;
}
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_COUNT_N_HPP

View file

@ -0,0 +1,27 @@
#ifndef SPROUT_DETAIL_COUNT_N_IF_HPP
#define SPROUT_DETAIL_COUNT_N_IF_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
namespace detail {
//
// count_n_if
//
template<typename InputIterator, typename Size, typename Predicate>
SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type count_n_if(
InputIterator first,
Size n,
Predicate pred
)
{
return n == 0 ? 0
: (pred(*first) ? 1 : 0) + sprout::detail::count_n_if(sprout::next(first), n - 1, pred)
;
}
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_COUNT_N_IF_HPP

View file

@ -1,40 +0,0 @@
#ifndef SPROUT_DETAIL_ITERATOR_EXT_HPP
#define SPROUT_DETAIL_ITERATOR_EXT_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
namespace detail {
template<typename Iterator>
SPROUT_CONSTEXPR typename std::iterator_traits<Iterator>::difference_type bidirectional_distance_impl(
Iterator first1,
Iterator first2,
Iterator last,
typename std::iterator_traits<Iterator>::difference_type current = 1
)
{
return first1 == last ? current
: first2 == last ? -current
: sprout::detail::bidirectional_distance_impl(sprout::next(first1), sprout::prev(first2), last, current + 1)
;
}
//
// bidirectional_distance
//
template<typename Iterator>
SPROUT_CONSTEXPR typename std::iterator_traits<Iterator>::difference_type bidirectional_distance(
Iterator first,
Iterator last
)
{
return first == last ? 0
: sprout::detail::bidirectional_distance_impl(sprout::next(first), sprout::prev(first), last)
;
}
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_ITERATOR_EXT_HPP

View file

@ -7,12 +7,12 @@
namespace sprout { namespace sprout {
namespace detail { namespace detail {
template<typename Iterator> template<typename InputIterator>
inline SPROUT_CONSTEXPR typename std::iterator_traits<Iterator>::difference_type overlap_count_impl( inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type overlap_count_impl(
Iterator first, InputIterator first,
Iterator last, InputIterator last,
typename std::iterator_traits<Iterator>::value_type const& value, typename std::iterator_traits<InputIterator>::value_type const& value,
typename std::iterator_traits<Iterator>::difference_type current = 0 typename std::iterator_traits<InputIterator>::difference_type current = 0
) )
{ {
return first == last return first == last
@ -25,10 +25,10 @@ namespace sprout {
// //
// overlap_count // overlap_count
// //
template<typename Iterator> template<typename InputIterator>
inline SPROUT_CONSTEXPR typename std::iterator_traits<Iterator>::difference_type overlap_count( inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type overlap_count(
Iterator first, InputIterator first,
Iterator last InputIterator last
) )
{ {
return first == last return first == last
@ -37,12 +37,12 @@ namespace sprout {
; ;
} }
template<typename Iterator, typename Predicate> template<typename InputIterator, typename Predicate>
inline SPROUT_CONSTEXPR typename std::iterator_traits<Iterator>::difference_type overlap_count_impl( inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type overlap_count_impl(
Iterator first, InputIterator first,
Iterator last, InputIterator last,
Predicate pred, Predicate pred,
typename std::iterator_traits<Iterator>::value_type const& value typename std::iterator_traits<InputIterator>::value_type const& value
) )
{ {
return first == last return first == last
@ -55,10 +55,10 @@ namespace sprout {
// //
// overlap_count // overlap_count
// //
template<typename Iterator, typename Predicate> template<typename InputIterator, typename Predicate>
inline SPROUT_CONSTEXPR typename std::iterator_traits<Iterator>::difference_type overlap_count( inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator>::difference_type overlap_count(
Iterator first, InputIterator first,
Iterator last, InputIterator last,
Predicate pred Predicate pred
) )
{ {

View file

@ -1,54 +0,0 @@
#ifndef SPROUT_DETAIL_OVERLAP_COUNT_2_HPP
#define SPROUT_DETAIL_OVERLAP_COUNT_2_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
namespace detail {
//
// overlap_count_2
//
template<typename Iterator1, typename Iterator2, typename Compare>
inline SPROUT_CONSTEXPR typename std::iterator_traits<Iterator1>::difference_type overlap_count_2(
Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2,
Compare comp
)
{
return first1 != last1 && first2 != last2
? comp(*first1, *first2)
? sprout::detail::overlap_count_2(sprout::next(first1), last1, first2, last2, comp)
: comp(*first2, *first1)
? sprout::detail::overlap_count_2(first1, last1, sprout::next(first2), last2, comp)
: 1 + sprout::detail::overlap_count_2(sprout::next(first1), last1, sprout::next(first2), last2, comp)
: 0
;
}
//
// overlap_count_2
//
template<typename Iterator1, typename Iterator2>
inline SPROUT_CONSTEXPR typename std::iterator_traits<Iterator1>::difference_type overlap_count_2(
Iterator1 first1,
Iterator1 last1,
Iterator2 first2,
Iterator2 last2
)
{
return first1 != last1 && first2 != last2
? *first1 < *first2
? sprout::detail::overlap_count_2(sprout::next(first1), last1, first2, last2)
: *first2 < *first1
? sprout::detail::overlap_count_2(first1, last1, sprout::next(first2), last2)
: 1 + sprout::detail::overlap_count_2(sprout::next(first1), last1, sprout::next(first2), last2)
: 0
;
}
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_OVERLAP_COUNT_2_HPP

View file

@ -0,0 +1,54 @@
#ifndef SPROUT_DETAIL_SET_OVERLAP_COUNT_HPP
#define SPROUT_DETAIL_SET_OVERLAP_COUNT_HPP
#include <iterator>
#include <sprout/config.hpp>
#include <sprout/iterator/operation.hpp>
namespace sprout {
namespace detail {
//
// set_overlap_count
//
template<typename InputIterator1, typename InputIterator2, typename Compare>
inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator1>::difference_type set_overlap_count(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
InputIterator2 last2,
Compare comp
)
{
return first1 != last1 && first2 != last2
? comp(*first1, *first2)
? sprout::detail::set_overlap_count(sprout::next(first1), last1, first2, last2, comp)
: comp(*first2, *first1)
? sprout::detail::set_overlap_count(first1, last1, sprout::next(first2), last2, comp)
: 1 + sprout::detail::set_overlap_count(sprout::next(first1), last1, sprout::next(first2), last2, comp)
: 0
;
}
//
// set_overlap_count
//
template<typename InputIterator1, typename InputIterator2>
inline SPROUT_CONSTEXPR typename std::iterator_traits<InputIterator1>::difference_type set_overlap_count(
InputIterator1 first1,
InputIterator1 last1,
InputIterator2 first2,
InputIterator2 last2
)
{
return first1 != last1 && first2 != last2
? *first1 < *first2
? sprout::detail::set_overlap_count(sprout::next(first1), last1, first2, last2)
: *first2 < *first1
? sprout::detail::set_overlap_count(first1, last1, sprout::next(first2), last2)
: 1 + sprout::detail::set_overlap_count(sprout::next(first1), last1, sprout::next(first2), last2)
: 0
;
}
} // namespace detail
} // namespace sprout
#endif // #ifndef SPROUT_DETAIL_SET_OVERLAP_COUNT_HPP

View file

@ -4,9 +4,7 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION #include <sprout/math/detail/config.hpp>
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -27,12 +25,7 @@ namespace sprout {
> >
inline SPROUT_CONSTEXPR FloatType inline SPROUT_CONSTEXPR FloatType
abs(FloatType x) { abs(FloatType x) {
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION return NS_SPROUT_MATH_DETAIL::abs(x);
using std::abs;
# else
using sprout::math::detail::abs;
# endif
return abs(x);
} }
} // namespace math } // namespace math

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/asin.hpp> #include <sprout/math/asin.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::acos;
using std::acos;
# else
using sprout::math::detail::acos;
# endif
} // namespace math } // namespace math
using sprout::math::acos; using sprout::math::acos;

View file

@ -4,12 +4,10 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp> #include <sprout/math/log.hpp>
#include <sprout/math/sqrt.hpp> #include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -36,11 +34,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::acosh;
using std::acosh;
# else
using sprout::math::detail::acosh;
# endif
} // namespace math } // namespace math
using sprout::math::acosh; using sprout::math::acosh;

View file

@ -5,13 +5,11 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/math/factorial.hpp> #include <sprout/math/factorial.hpp>
#include <sprout/math/sqrt.hpp> #include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -75,11 +73,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::asin;
using std::asin;
# else
using sprout::math::detail::asin;
# endif
} // namespace math } // namespace math
using sprout::math::asin; using sprout::math::asin;

View file

@ -4,12 +4,10 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp> #include <sprout/math/log.hpp>
#include <sprout/math/sqrt.hpp> #include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -36,11 +34,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::asinh;
using std::asinh;
# else
using sprout::math::detail::asinh;
# endif
} // namespace math } // namespace math
using sprout::math::asinh; using sprout::math::asinh;

View file

@ -4,12 +4,10 @@
#include <cstddef> #include <cstddef>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/math/factorial.hpp> #include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -70,11 +68,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::atan;
using std::atan;
# else
using sprout::math::detail::atan;
# endif
} // namespace math } // namespace math
using sprout::math::atan; using sprout::math::atan;

View file

@ -3,13 +3,11 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/atan.hpp> #include <sprout/math/atan.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/math/float_promote.hpp> #include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -40,11 +38,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::atan2;
using std::atan2;
# else
using sprout::math::detail::atan2;
# endif
} // namespace math } // namespace math
using sprout::math::atan2; using sprout::math::atan2;

View file

@ -4,11 +4,9 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp> #include <sprout/math/log.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -36,11 +34,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::atanh;
using std::atanh;
# else
using sprout::math::detail::atanh;
# endif
} // namespace math } // namespace math
using sprout::math::atanh; using sprout::math::atanh;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/pow.hpp> #include <sprout/math/pow.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -34,11 +32,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::cbrt;
using std::cbrt;
# else
using sprout::math::detail::cbrt;
# endif
} // namespace math } // namespace math
using sprout::math::cbrt; using sprout::math::cbrt;

View file

@ -5,11 +5,9 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp> #include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -56,11 +54,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::cos;
using std::cos;
# else
using sprout::math::detail::cos;
# endif
} // namespace math } // namespace math
using sprout::math::cos; using sprout::math::cos;

View file

@ -4,11 +4,9 @@
#include <cstddef> #include <cstddef>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp> #include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -51,11 +49,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::cosh;
using std::cosh;
# else
using sprout::math::detail::cosh;
# endif
} // namespace math } // namespace math
using sprout::math::cosh; using sprout::math::cosh;

View file

@ -0,0 +1,15 @@
#ifndef SPROUT_MATH_DETAIL_CONFIG_HPP
#define SPROUT_MATH_DETAIL_CONFIG_HPP
#include <sprout/config.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# define NS_SPROUT_MATH_DETAIL std
#else // #ifndef SPROUT_USE_BUILTIN_CMATH_FUNCTION
# define NS_SPROUT_MATH_DETAIL sprout::math::detail
#endif // #ifndef SPROUT_USE_BUILTIN_CMATH_FUNCTION
#endif // #ifndef SPROUT_MATH_DETAIL_CONFIG_HPP

View file

@ -4,11 +4,9 @@
#include <cstddef> #include <cstddef>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp> #include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -51,11 +49,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::exp;
using std::exp;
# else
using sprout::math::detail::exp;
# endif
} // namespace math } // namespace math
using sprout::math::exp; using sprout::math::exp;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/exp.hpp> #include <sprout/math/exp.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::exp2;
using std::exp2;
# else
using sprout::math::detail::exp2;
# endif
} // namespace math } // namespace math
using sprout::math::exp2; using sprout::math::exp2;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/exp.hpp> #include <sprout/math/exp.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::expm1;
using std::expm1;
# else
using sprout::math::detail::expm1;
# endif
} // namespace math } // namespace math
using sprout::math::expm1; using sprout::math::expm1;

View file

@ -3,10 +3,8 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -30,11 +28,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::fabs;
using std::fabs;
# else
using sprout::math::detail::fabs;
# endif
} // namespace math } // namespace math
using sprout::math::fabs; using sprout::math::fabs;

View file

@ -3,11 +3,9 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp> #include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -35,11 +33,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::fdim;
using std::fdim;
# else
using sprout::math::detail::fdim;
# endif
} // namespace math } // namespace math
using sprout::math::fdim; using sprout::math::fdim;

View file

@ -3,11 +3,9 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp> #include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -42,11 +40,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::fma;
using std::fma;
# else
using sprout::math::detail::fma;
# endif
} // namespace math } // namespace math
using sprout::math::fma; using sprout::math::fma;

View file

@ -3,11 +3,9 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp> #include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -35,11 +33,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::fmax;
using std::fmax;
# else
using sprout::math::detail::fmax;
# endif
} // namespace math } // namespace math
using sprout::math::fmax; using sprout::math::fmax;

View file

@ -3,11 +3,9 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp> #include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -35,11 +33,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::fmin;
using std::fmin;
# else
using sprout::math::detail::fmin;
# endif
} // namespace math } // namespace math
using sprout::math::fmin; using sprout::math::fmin;

View file

@ -5,6 +5,7 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/isnan.hpp> #include <sprout/math/isnan.hpp>
#include <sprout/math/isinf.hpp> #include <sprout/math/isinf.hpp>
#include <sprout/math/iszero.hpp> #include <sprout/math/iszero.hpp>
@ -28,11 +29,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::fpclassify;
using std::fpclassify;
# else
using sprout::math::detail::fpclassify;
# endif
} // namespace math } // namespace math
using sprout::math::fpclassify; using sprout::math::fpclassify;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/float_promote.hpp> #include <sprout/math/float_promote.hpp>
#include <sprout/math/sqrt.hpp> #include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -36,11 +34,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::hypot;
using std::hypot;
# else
using sprout::math::detail::hypot;
# endif
} // namespace math } // namespace math
using sprout::math::hypot; using sprout::math::hypot;

View file

@ -4,11 +4,9 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/isnan.hpp> #include <sprout/math/isnan.hpp>
#include <sprout/math/isinf.hpp> #include <sprout/math/isinf.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -25,11 +23,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::isfinite;
using std::isfinite;
# else
using sprout::math::detail::isfinite;
# endif
} // namespace math } // namespace math
using sprout::math::isfinite; using sprout::math::isfinite;

View file

@ -4,10 +4,8 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -24,11 +22,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::isinf;
using std::isinf;
# else
using sprout::math::detail::isinf;
# endif
} // namespace math } // namespace math
using sprout::math::isinf; using sprout::math::isinf;

View file

@ -3,10 +3,8 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -21,11 +19,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::isnan;
using std::isnan;
# else
using sprout::math::detail::isnan;
# endif
} // namespace math } // namespace math
using sprout::math::isnan; using sprout::math::isnan;

View file

@ -4,12 +4,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/isnan.hpp> #include <sprout/math/isnan.hpp>
#include <sprout/math/isinf.hpp> #include <sprout/math/isinf.hpp>
#include <sprout/math/issubnormal.hpp> #include <sprout/math/issubnormal.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -27,11 +25,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::isnormal;
using std::isnormal;
# else
using sprout::math::detail::isnormal;
# endif
} // namespace math } // namespace math
using sprout::math::isnormal; using sprout::math::isnormal;

View file

@ -5,13 +5,11 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/math/factorial.hpp> #include <sprout/math/factorial.hpp>
#include <sprout/math/sqrt.hpp> #include <sprout/math/sqrt.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -69,11 +67,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::log;
using std::log;
# else
using sprout::math::detail::log;
# endif
} // namespace math } // namespace math
using sprout::math::log; using sprout::math::log;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp> #include <sprout/math/log.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::log10;
using std::log10;
# else
using sprout::math::detail::log10;
# endif
} // namespace math } // namespace math
using sprout::math::log10; using sprout::math::log10;

View file

@ -3,11 +3,9 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp> #include <sprout/math/log.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -31,11 +29,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::log1p;
using std::log1p;
# else
using sprout::math::detail::log1p;
# endif
} // namespace math } // namespace math
using sprout::math::log1p; using sprout::math::log1p;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/log.hpp> #include <sprout/math/log.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::log2;
using std::log2;
# else
using sprout::math::detail::log2;
# endif
} // namespace math } // namespace math
using sprout::math::log2; using sprout::math::log2;

View file

@ -3,14 +3,12 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/exp.hpp> #include <sprout/math/exp.hpp>
#include <sprout/math/log.hpp> #include <sprout/math/log.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/math/float_promote.hpp> #include <sprout/math/float_promote.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -40,11 +38,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::pow;
using std::pow;
# else
using sprout::math::detail::pow;
# endif
} // namespace math } // namespace math
using sprout::math::pow; using sprout::math::pow;

View file

@ -3,10 +3,8 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -21,11 +19,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::signbit;
using std::signbit;
# else
using sprout::math::detail::signbit;
# endif
} // namespace math } // namespace math
using sprout::math::signbit; using sprout::math::signbit;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/cos.hpp> #include <sprout/math/cos.hpp>
#include <sprout/math/constants.hpp> #include <sprout/math/constants.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::sin;
using std::sin;
# else
using sprout::math::detail::sin;
# endif
} // namespace math } // namespace math
using sprout::math::sin; using sprout::math::sin;

View file

@ -4,11 +4,9 @@
#include <cstddef> #include <cstddef>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/factorial.hpp> #include <sprout/math/factorial.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -51,11 +49,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::sinh;
using std::sinh;
# else
using sprout::math::detail::sinh;
# endif
} // namespace math } // namespace math
using sprout::math::sinh; using sprout::math::sinh;

View file

@ -4,10 +4,8 @@
#include <limits> #include <limits>
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -59,11 +57,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::sqrt;
using std::sqrt;
# else
using sprout::math::detail::sqrt;
# endif
} // namespace math } // namespace math
using sprout::math::sqrt; using sprout::math::sqrt;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/sin.hpp> #include <sprout/math/sin.hpp>
#include <sprout/math/cos.hpp> #include <sprout/math/cos.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::tan;
using std::tan;
# else
using sprout::math::detail::tan;
# endif
} // namespace math } // namespace math
using sprout::math::tan; using sprout::math::tan;

View file

@ -3,12 +3,10 @@
#include <type_traits> #include <type_traits>
#include <sprout/config.hpp> #include <sprout/config.hpp>
#include <sprout/math/detail/config.hpp>
#include <sprout/math/sinh.hpp> #include <sprout/math/sinh.hpp>
#include <sprout/math/cosh.hpp> #include <sprout/math/cosh.hpp>
#include <sprout/type_traits/enabler_if.hpp> #include <sprout/type_traits/enabler_if.hpp>
#if SPROUT_USE_BUILTIN_CMATH_FUNCTION
# include <cmath>
#endif
namespace sprout { namespace sprout {
namespace math { namespace math {
@ -32,11 +30,7 @@ namespace sprout {
} }
} // namespace detail } // namespace detail
# if SPROUT_USE_BUILTIN_CMATH_FUNCTION using NS_SPROUT_MATH_DETAIL::tanh;
using std::tanh;
# else
using sprout::math::detail::tanh;
# endif
} // namespace math } // namespace math
using sprout::math::tanh; using sprout::math::tanh;