@@ -2357,37 +2357,6 @@ namespace detail {
23572357 return detail::make_xfunction<detail::nan_to_num_functor>(std::forward<E>(e));
23582358 }
23592359
2360- #define XTENSOR_NAN_REDUCER_FUNCTION (NAME, FUNCTOR, RESULT_TYPE, NAN ) \
2361- template <class T = void , class E , class X , class EVS = DEFAULT_STRATEGY_REDUCERS, \
2362- XTL_REQUIRES (xtl::negation<is_reducer_options<X>>)> \
2363- inline auto NAME(E&& e, X&& axes, EVS es = EVS()) \
2364- { \
2365- using result_type = std::conditional_t <std::is_same<T, void >::value, RESULT_TYPE, T>; \
2366- using functor_type = FUNCTOR<result_type>; \
2367- using init_functor_type = detail::nan_init<result_type, NAN>; \
2368- return xt::reduce (make_xreducer_functor (functor_type (), init_functor_type ()), std::forward<E>(e), \
2369- std::forward<X>(axes), es); \
2370- } \
2371- \
2372- template <class T = void , class E , class EVS = DEFAULT_STRATEGY_REDUCERS, \
2373- XTL_REQUIRES (is_reducer_options<EVS>)> \
2374- inline auto NAME(E&& e, EVS es = EVS()) \
2375- { \
2376- using result_type = std::conditional_t <std::is_same<T, void >::value, RESULT_TYPE, T>; \
2377- using functor_type = FUNCTOR<result_type>; \
2378- using init_functor_type = detail::nan_init<result_type, NAN>; \
2379- return xt::reduce (make_xreducer_functor (functor_type (), init_functor_type ()), std::forward<E>(e), es); \
2380- } \
2381- \
2382- template <class T = void , class E , class I , std::size_t N, class EVS = DEFAULT_STRATEGY_REDUCERS> \
2383- inline auto NAME (E&& e, const I (&axes)[N], EVS es = EVS()) \
2384- { \
2385- using result_type = std::conditional_t <std::is_same<T, void >::value, RESULT_TYPE, T>; \
2386- using functor_type = FUNCTOR<result_type>; \
2387- using init_functor_type = detail::nan_init<result_type, NAN>; \
2388- return xt::reduce (make_xreducer_functor (functor_type (), init_functor_type ()), std::forward<E>(e), axes, es); \
2389- }
2390-
23912360 /* *
23922361 * @ingroup nan_functions
23932362 * @brief Sum of elements over given axes, replacing nan with 0.
@@ -2397,7 +2366,9 @@ namespace detail {
23972366 * @param e an \ref xexpression
23982367 * @param axes the axes along which the sum is performed (optional)
23992368 * @param es evaluation strategy of the reducer (optional)
2400- * @tparam T the result type. The default is `E::value_type`.
2369+ * @tparam T the value type used for internal computation. The default is
2370+ * `E::value_type`. `T` is also used for determining the value type
2371+ * of the result, which is the type of `T() + E::value_type()`.
24012372 * You can pass `big_promote_value_type_t<E>` to avoid overflow in computation.
24022373 * @return an \ref xreducer
24032374 */
@@ -2412,14 +2383,14 @@ namespace detail {
24122383 * @param e an \ref xexpression
24132384 * @param axes the axes along which the sum is performed (optional)
24142385 * @param es evaluation strategy of the reducer (optional)
2415- * @tparam T the result type. The default is `E::value_type`.
2386+ * @tparam T the value type used for internal computation. The default is
2387+ * `E::value_type`. `T` is also used for determining the value type
2388+ * of the result, which is the type of `T() * E::value_type()`.
24162389 * You can pass `big_promote_value_type_t<E>` to avoid overflow in computation.
24172390 * @return an \ref xreducer
24182391 */
24192392 XTENSOR_REDUCER_FUNCTION(nanprod, detail::nan_multiplies, typename std::decay_t <E>::value_type, 1 )
24202393
2421- #undef XTENSOR_NAN_REDUCER_FUNCTION
2422-
24232394#define COUNT_NON_ZEROS_CONTENT \
24242395 using value_type = typename std::decay_t <E>::value_type; \
24252396 using result_type = xt::detail::xreducer_size_type_t <value_type>; \
@@ -2507,7 +2478,9 @@ namespace detail {
25072478 * \em axis, replacing nan with 0.
25082479 * @param e an \ref xexpression
25092480 * @param axis the axis along which the elements are accumulated (optional)
2510- * @tparam T the result type. The default is `E::value_type`.
2481+ * @tparam T the value type used for internal computation. The default is
2482+ * `E::value_type`. `T` is also used for determining the value type
2483+ * of the result, which is the type of `T() + E::value_type()`.
25112484 * You can pass `big_promote_value_type_t<E>` to avoid overflow in computation.
25122485 * @return an xaccumulator
25132486 */
@@ -2533,7 +2506,9 @@ namespace detail {
25332506 * \em axis, replacing nan with 1.
25342507 * @param e an \ref xexpression
25352508 * @param axis the axis along which the elements are accumulated (optional)
2536- * @tparam T the result type. The default is `E::value_type`.
2509+ * @tparam T the value type used for internal computation. The default is
2510+ * `E::value_type`. `T` is also used for determining the value type
2511+ * of the result, which is the type of `T() * E::value_type()`.
25372512 * You can pass `big_promote_value_type_t<E>` to avoid overflow in computation.
25382513 * @return an xaccumulator
25392514 */
0 commit comments