Skip to content

Commit d88341b

Browse files
authored
Merge pull request #2522 from tdegeus/warning
Fixing compiler warning
2 parents 18b50ba + dfa7de6 commit d88341b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

include/xtensor/xmath.hpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,7 @@ namespace detail {
22402240
inline auto cumsum(E&& e, std::ptrdiff_t axis)
22412241
{
22422242
using init_value_type = std::conditional_t<std::is_same<T, void>::value, typename std::decay_t<E>::value_type, T>;
2243-
return accumulate(make_xaccumulator_functor(detail::plus(), detail::accumulator_identity<init_value_type>()),
2243+
return accumulate(make_xaccumulator_functor(detail::plus(), detail::accumulator_identity<init_value_type>()),
22442244
std::forward<E>(e),
22452245
axis);
22462246
}
@@ -2249,7 +2249,7 @@ namespace detail {
22492249
inline auto cumsum(E&& e)
22502250
{
22512251
using init_value_type = std::conditional_t<std::is_same<T, void>::value, typename std::decay_t<E>::value_type, T>;
2252-
return accumulate(make_xaccumulator_functor(detail::plus(), detail::accumulator_identity<init_value_type>()),
2252+
return accumulate(make_xaccumulator_functor(detail::plus(), detail::accumulator_identity<init_value_type>()),
22532253
std::forward<E>(e));
22542254
}
22552255

@@ -2271,16 +2271,16 @@ namespace detail {
22712271
inline auto cumprod(E&& e, std::ptrdiff_t axis)
22722272
{
22732273
using init_value_type = std::conditional_t<std::is_same<T, void>::value, typename std::decay_t<E>::value_type, T>;
2274-
return accumulate(make_xaccumulator_functor(detail::multiplies(), detail::accumulator_identity<init_value_type>()),
2275-
std::forward<E>(e),
2274+
return accumulate(make_xaccumulator_functor(detail::multiplies(), detail::accumulator_identity<init_value_type>()),
2275+
std::forward<E>(e),
22762276
axis);
22772277
}
22782278

22792279
template <class T = void, class E>
22802280
inline auto cumprod(E&& e)
22812281
{
22822282
using init_value_type = std::conditional_t<std::is_same<T, void>::value, typename std::decay_t<E>::value_type, T>;
2283-
return accumulate(make_xaccumulator_functor(detail::multiplies(), detail::accumulator_identity<init_value_type>()),
2283+
return accumulate(make_xaccumulator_functor(detail::multiplies(), detail::accumulator_identity<init_value_type>()),
22842284
std::forward<E>(e));
22852285
}
22862286

@@ -3026,20 +3026,20 @@ namespace detail {
30263026
struct valid{};
30273027
struct full{};
30283028
}
3029-
3029+
30303030
namespace detail {
30313031
template <class E1, class E2>
30323032
inline auto convolve_impl(E1&& e1, E2&& e2, convolve_mode::valid)
30333033
{
30343034
using value_type = typename std::decay<E1>::type::value_type;
30353035

3036-
size_t const na = e1.size();
3037-
size_t const nv = e2.size();
3038-
size_t const n = na - nv + 1;
3036+
std::size_t const na = e1.size();
3037+
std::size_t const nv = e2.size();
3038+
std::size_t const n = na - nv + 1;
30393039
xt::xtensor<value_type, 1> out = xt::zeros<value_type>({ n });
3040-
for (size_t i = 0; i < n; i++)
3040+
for (std::size_t i = 0; i < n; i++)
30413041
{
3042-
for (int j = 0; j < nv; j++)
3042+
for (std::size_t j = 0; j < nv; j++)
30433043
{
30443044
out(i) += e1(j) * e2(j + i);
30453045
}
@@ -3052,15 +3052,15 @@ namespace detail {
30523052
{
30533053
using value_type = typename std::decay<E1>::type::value_type;
30543054

3055-
size_t const na = e1.size();
3056-
size_t const nv = e2.size();
3057-
size_t const n = na + nv - 1;
3055+
std::size_t const na = e1.size();
3056+
std::size_t const nv = e2.size();
3057+
std::size_t const n = na + nv - 1;
30583058
xt::xtensor<value_type, 1> out = xt::zeros<value_type>({ n });
3059-
for (size_t i = 0; i < n; i++)
3059+
for (std::size_t i = 0; i < n; i++)
30603060
{
3061-
size_t const jmn = (i >= nv - 1) ? i - (nv - 1) : 0;
3062-
size_t const jmx = (i < na - 1) ? i : na - 1;
3063-
for (size_t j = jmn; j <= jmx; ++j)
3061+
std::size_t const jmn = (i >= nv - 1) ? i - (nv - 1) : 0;
3062+
std::size_t const jmx = (i < na - 1) ? i : na - 1;
3063+
for (std::size_t j = jmn; j <= jmx; ++j)
30643064
{
30653065
out(i) += e1(j) * e2(i - j);
30663066
}
@@ -3075,7 +3075,7 @@ namespace detail {
30753075
* @param a 1D expression
30763076
* @param v 1D expression
30773077
* @param mode placeholder Select algorithm #convolve_mode
3078-
*
3078+
*
30793079
* @detail the algorithm convolves a with v and will incur a copy overhead
30803080
* should v be longer than a.
30813081
*/

0 commit comments

Comments
 (0)