Skip to content

Commit 90a2fa6

Browse files
committed
fix clang-format
1 parent 6178efd commit 90a2fa6

File tree

7 files changed

+74
-84
lines changed

7 files changed

+74
-84
lines changed

include/xtensor/generators/xbuilder.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -964,12 +964,10 @@ namespace xt
964964
detail::make_xgenerator(detail::repeat_impl<xclosure_t<E>>(std::forward<E>(e), I), shape)...
965965
);
966966
#else
967-
return std::make_tuple(
968-
detail::make_xgenerator(
969-
detail::repeat_impl<xclosure_t<E>>(std::forward<E>(e), I),
970-
{e.shape()[0]...}
971-
)...
972-
);
967+
return std::make_tuple(detail::make_xgenerator(
968+
detail::repeat_impl<xclosure_t<E>>(std::forward<E>(e), I),
969+
{e.shape()[0]...}
970+
)...);
973971
#endif
974972
}
975973
}

include/xtensor/misc/xfft.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ namespace xt
9090
xt::xtensor<std::size_t, 1> i = xt::pow(xt::linspace<std::size_t>(0, n - 1, n), 2);
9191
i %= (n * 2);
9292

93-
auto angles = xt::eval(static_cast<precision>(3.141592653589793238463) * i / static_cast<precision>(n));
93+
auto angles = xt::eval(
94+
static_cast<precision>(3.141592653589793238463) * i / static_cast<precision>(n)
95+
);
9496
auto j = std::complex<precision>(0, 1);
9597
exp_table = xt::exp(-angles * j);
9698

include/xtensor/misc/xmanipulation.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@ namespace xt
659659
template <std::size_t N, class E>
660660
inline auto atleast_Nd(E&& e)
661661
{
662-
xstrided_slice_vector sv((std::max) (e.dimension(), N), all());
662+
xstrided_slice_vector sv((std::max)(e.dimension(), N), all());
663663
if (e.dimension() < N)
664664
{
665665
std::size_t i = 0;

include/xtensor/utils/xutils.hpp

Lines changed: 54 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ namespace xt
272272
************************/
273273

274274
template <class R, class F, class... S>
275-
inline R
276-
apply(std::size_t index, F&& func, const std::tuple<S...>& s) NOEXCEPT(noexcept(func(std::get<0>(s))))
275+
inline R apply(std::size_t index, F&& func, const std::tuple<S...>& s)
276+
NOEXCEPT(noexcept(func(std::get<0>(s))))
277277
{
278278
XTENSOR_ASSERT(sizeof...(S) > index);
279279
return std::apply(
@@ -382,16 +382,14 @@ namespace xt
382382
res[i] = normalize_axis(expr.dimension(), axes[i]);
383383
}
384384

385-
XTENSOR_ASSERT(
386-
std::all_of(
387-
res.begin(),
388-
res.end(),
389-
[&expr](auto ax_el)
390-
{
391-
return ax_el < expr.dimension();
392-
}
393-
)
394-
);
385+
XTENSOR_ASSERT(std::all_of(
386+
res.begin(),
387+
res.end(),
388+
[&expr](auto ax_el)
389+
{
390+
return ax_el < expr.dimension();
391+
}
392+
));
395393

396394
return res;
397395
}
@@ -403,16 +401,14 @@ namespace xt
403401
normalize_axis(E& expr, C&& axes)
404402
{
405403
static_cast<void>(expr);
406-
XTENSOR_ASSERT(
407-
std::all_of(
408-
axes.begin(),
409-
axes.end(),
410-
[&expr](auto ax_el)
411-
{
412-
return ax_el < expr.dimension();
413-
}
414-
)
415-
);
404+
XTENSOR_ASSERT(std::all_of(
405+
axes.begin(),
406+
axes.end(),
407+
[&expr](auto ax_el)
408+
{
409+
return ax_el < expr.dimension();
410+
}
411+
));
416412
return std::forward<C>(axes);
417413
}
418414

@@ -433,16 +429,14 @@ namespace xt
433429
}
434430
);
435431

436-
XTENSOR_ASSERT(
437-
std::all_of(
438-
res.begin(),
439-
res.end(),
440-
[&expr](auto ax_el)
441-
{
442-
return ax_el < expr.dimension();
443-
}
444-
)
445-
);
432+
XTENSOR_ASSERT(std::all_of(
433+
res.begin(),
434+
res.end(),
435+
[&expr](auto ax_el)
436+
{
437+
return ax_el < expr.dimension();
438+
}
439+
));
446440

447441
return res;
448442
}
@@ -457,16 +451,14 @@ namespace xt
457451
R res;
458452
xt::resize_container(res, std::size(axes));
459453
std::copy(std::begin(axes), std::end(axes), std::begin(res));
460-
XTENSOR_ASSERT(
461-
std::all_of(
462-
res.begin(),
463-
res.end(),
464-
[&expr](auto ax_el)
465-
{
466-
return ax_el < expr.dimension();
467-
}
468-
)
469-
);
454+
XTENSOR_ASSERT(std::all_of(
455+
res.begin(),
456+
res.end(),
457+
[&expr](auto ax_el)
458+
{
459+
return ax_el < expr.dimension();
460+
}
461+
));
470462
return res;
471463
}
472464

@@ -476,16 +468,14 @@ namespace xt
476468
R&&>
477469
{
478470
static_cast<void>(expr);
479-
XTENSOR_ASSERT(
480-
std::all_of(
481-
std::begin(axes),
482-
std::end(axes),
483-
[&expr](auto ax_el)
484-
{
485-
return ax_el < expr.dimension();
486-
}
487-
)
488-
);
471+
XTENSOR_ASSERT(std::all_of(
472+
std::begin(axes),
473+
std::end(axes),
474+
[&expr](auto ax_el)
475+
{
476+
return ax_el < expr.dimension();
477+
}
478+
));
489479
return std::move(axes);
490480
}
491481

@@ -919,18 +909,18 @@ namespace xt
919909
{
920910
explicit overlapping_memory_checker(const Dst& aDst)
921911
: overlapping_memory_checker_base(
922-
[&]()
923-
{
924-
if (aDst.size() == 0)
925-
{
926-
return memory_range();
927-
}
928-
else
929-
{
930-
return memory_range(std::addressof(*aDst.begin()), std::addressof(*aDst.rbegin()));
931-
}
932-
}()
933-
)
912+
[&]()
913+
{
914+
if (aDst.size() == 0)
915+
{
916+
return memory_range();
917+
}
918+
else
919+
{
920+
return memory_range(std::addressof(*aDst.begin()), std::addressof(*aDst.rbegin()));
921+
}
922+
}()
923+
)
934924
{
935925
}
936926
};

include/xtensor/views/index_mapper.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,8 @@ namespace xt
529529
}
530530

531531
template <class UnderlyingContainer, class... Slices>
532-
auto
533-
index_mapper<xt::xview<UnderlyingContainer, Slices...>>::dimension(const UnderlyingContainer& container) const
534-
-> size_t
532+
auto index_mapper<xt::xview<UnderlyingContainer, Slices...>>::dimension(const UnderlyingContainer& container
533+
) const -> size_t
535534
{
536535
return container.dimension() - nb_integral_slices + nb_new_axis_slices;
537536
}

test/test_common.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -980,9 +980,8 @@ namespace xt
980980
EXPECT_TRUE((std::is_same<rm_layout_iterator, exp_rm_layout_iterator>::value));
981981
EXPECT_TRUE((std::is_same<rm_const_layout_iterator, exp_rm_const_layout_iterator>::value));
982982
EXPECT_TRUE((std::is_same<rm_reverse_layout_iterator, exp_rm_reverse_layout_iterator>::value));
983-
EXPECT_TRUE(
984-
(std::is_same<rm_const_reverse_layout_iterator, exp_rm_const_reverse_layout_iterator>::value)
985-
);
983+
EXPECT_TRUE((std::is_same<rm_const_reverse_layout_iterator, exp_rm_const_reverse_layout_iterator>::value
984+
));
986985

987986
using cm_layout_iterator = typename C::template layout_iterator<layout_type::column_major>;
988987
using cm_const_layout_iterator = typename C::template const_layout_iterator<layout_type::column_major>;
@@ -998,9 +997,8 @@ namespace xt
998997
EXPECT_TRUE((std::is_same<cm_layout_iterator, exp_cm_layout_iterator>::value));
999998
EXPECT_TRUE((std::is_same<cm_const_layout_iterator, exp_cm_const_layout_iterator>::value));
1000999
EXPECT_TRUE((std::is_same<cm_reverse_layout_iterator, exp_cm_reverse_layout_iterator>::value));
1001-
EXPECT_TRUE(
1002-
(std::is_same<cm_const_reverse_layout_iterator, exp_cm_const_reverse_layout_iterator>::value)
1003-
);
1000+
EXPECT_TRUE((std::is_same<cm_const_reverse_layout_iterator, exp_cm_const_reverse_layout_iterator>::value
1001+
));
10041002

10051003
using linear_iterator = typename C::linear_iterator;
10061004
using const_linear_iterator = typename C::const_linear_iterator;

test/test_xreducer.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -882,11 +882,14 @@ namespace xt
882882
truth = std::is_same<std::decay_t<decltype(b_fx_3)>, xtensor_fixed<int, xshape<>>>::value;
883883
EXPECT_TRUE(truth);
884884

885-
truth = std::is_same<xshape<1, 3>, typename fixed_xreducer_shape_type<xshape<1, 5, 3>, xshape<1>>::type>();
885+
truth = std::is_same<xshape<1, 3>, typename fixed_xreducer_shape_type<xshape<1, 5, 3>, xshape<1>>::type>(
886+
);
886887
EXPECT_TRUE(truth);
887-
truth = std::is_same<xshape<5>, typename fixed_xreducer_shape_type<xshape<1, 5, 3>, xshape<0, 2>>::type>();
888+
truth = std::is_same<xshape<5>, typename fixed_xreducer_shape_type<xshape<1, 5, 3>, xshape<0, 2>>::type>(
889+
);
888890
EXPECT_TRUE(truth);
889-
truth = std::is_same<xshape<>, typename fixed_xreducer_shape_type<xshape<1, 5, 3>, xshape<0, 1, 2>>::type>();
891+
truth = std::is_same<xshape<>, typename fixed_xreducer_shape_type<xshape<1, 5, 3>, xshape<0, 1, 2>>::type>(
892+
);
890893
EXPECT_TRUE(truth);
891894
truth = std::is_same<xshape<1, 5>, typename fixed_xreducer_shape_type<xshape<1, 5>, xshape<2>>::type>();
892895
EXPECT_TRUE(truth);

0 commit comments

Comments
 (0)