From 72daceedefacfd8c0098cab845c727e3fb923acd Mon Sep 17 00:00:00 2001 From: Drew Hubley Date: Mon, 1 Jan 2024 17:07:06 -0400 Subject: [PATCH] run pre-commit --- include/xtensor/xbuilder.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/include/xtensor/xbuilder.hpp b/include/xtensor/xbuilder.hpp index e4e49bba3..6be2775c3 100644 --- a/include/xtensor/xbuilder.hpp +++ b/include/xtensor/xbuilder.hpp @@ -542,15 +542,20 @@ namespace xt size_t offset = 0; const size_t end = arr.dimension(); bool after_axis = false; - for(size_t i = 0; i < end; i++) + for (size_t i = 0; i < end; i++) { - if(i == axis) + if (i == axis) { after_axis = true; } const auto& shape = arr.shape(); - const size_t stride = std::accumulate(shape.begin() + i + 1, shape.end(), 1, std::multiplies()); - const auto len = (*(first + i + after_axis)); + const size_t stride = std::accumulate( + shape.begin() + i + 1, + shape.end(), + 1, + std::multiplies() + ); + const auto len = (*(first + i + after_axis)); offset += len * stride; } const auto element = arr.begin() + offset; @@ -565,6 +570,7 @@ namespace xt class vstack_access { public: + using tuple_type = std::tuple; using size_type = std::size_t; using value_type = xtl::promote_type_t::value_type...>; @@ -581,9 +587,11 @@ namespace xt return concatonate.access(t, axis, first, last); } } + private: + concatenate_access concatonate; - stack_access stack; + stack_access stack; }; template