From 22c3cfbd04bdd7ef31db0800f9fa8d5a7f637e2e Mon Sep 17 00:00:00 2001 From: Alexander Puck Neuwirth Date: Mon, 25 May 2026 12:55:59 +0200 Subject: [PATCH 1/2] Use namespace std and remove std:: prefixes --- tests/TestBinnedStorage.cc | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/tests/TestBinnedStorage.cc b/tests/TestBinnedStorage.cc index 4ce8a18c..b61a078a 100644 --- a/tests/TestBinnedStorage.cc +++ b/tests/TestBinnedStorage.cc @@ -9,18 +9,19 @@ #include using namespace YODA; +using namespace std; -using DStrAxis = Axis; +using DStrAxis = Axis; using CDblAxis = Axis; using DIntAxis = Axis; using BinningT = Binning; template -using StorageT = BinnedStorage; +using StorageT = BinnedStorage; template -using FillableT = FillableStorage; +using FillableT = FillableStorage; auto constructors() { BinningT binning({"test1", "test2"}, {1., 2., 3., 4.}, {1, 2, 3, 4, 5}); @@ -63,7 +64,7 @@ auto adapterConstructors() { auto binStorage2 = FillableT<3, double>(binning, adapter1); auto binStorage3 = FillableT<3, TestClass>(binning, adapter2); - binStorage3.fill({"test1", 1.5, 1}, std::make_index_sequence<3>()); + binStorage3.fill({"test1", 1.5, 1}, make_index_sequence<3>()); FillableT<3, TestClass>::BinType& bin = binStorage3.binAt({"test1", 1.5, 1}); @@ -83,10 +84,10 @@ auto set() { } auto binsVectorWrapper() { - auto binning = std::make_shared( + auto binning = make_shared( BinningT({"test1", "test2"}, {1., 2., 3., 4.}, {1, 2, 3, 4, 5})); using BinT = Bin<3, int, BinningT>; - std::vector bins; + vector bins; bins.reserve(100); for(size_t i = 0; i < 100; i++){ @@ -94,9 +95,9 @@ auto binsVectorWrapper() { } /// @note Must be sorted. - std::vector hiddenBins = {0, 9, 15, 87}; + vector hiddenBins = {0, 9, 15, 87}; - auto vecWrapper = BinsVecWrapper>(bins, hiddenBins); + auto vecWrapper = BinsVecWrapper>(bins, hiddenBins); for (auto& bin : vecWrapper) { for (auto& i : hiddenBins) { @@ -178,8 +179,8 @@ auto dbnAdapter() { auto binStorage = FillableT<3, Dbn<3>>(binning); - binStorage.fill({"test1", 1.4, 1}, std::make_index_sequence<3>(), 2.0, 1.0); - binStorage.fill({"test1", 1.6, 1}, std::make_index_sequence<3>(), 2.0, 1.0); + binStorage.fill({"test1", 1.4, 1}, make_index_sequence<3>(), 2.0, 1.0); + binStorage.fill({"test1", 1.6, 1}, make_index_sequence<3>(), 2.0, 1.0); auto& bin = binStorage.binAt({"test1", 1.4, 1}); @@ -190,7 +191,7 @@ auto shape() { vector sedges{"A", "B", "C"}; vector dedges{1.,2.,3.,4.}; vector iedges{1,2,3,4,5,6,7}; - using BinStorageT = BinnedStorage; + using BinStorageT = BinnedStorage; BinStorageT storage(sedges, dedges, iedges); const bool res1 = storage.shape() == vector{3, 3, 7}; const bool res2 = storage.shape(true) == vector{4, 5, 8}; @@ -198,10 +199,10 @@ auto shape() { } auto getBins() { - using BinStorageT = BinnedStorage; + using BinStorageT = BinnedStorage; BinStorageT binnedStorage1({"test1", "test2"}, { 1.0, 2.0, 3.0}); - std::vector overflowIndices = {0, 1, 2, 3, 6, 9, 10, 11}; + vector overflowIndices = {0, 1, 2, 3, 6, 9, 10, 11}; auto binsVec1 = binnedStorage1.bins(); @@ -213,11 +214,11 @@ auto getBins() { /// @note Double curly braces to construct temporary axes, because /// there is no constructor defined to work with arguments - /// of std::initializer_list and std::initializer_list> + /// of initializer_list and initializer_list> /// type. Intermediate axis is created. /*BinStorageT binnedStorage2({{"test1", "test2"}}, {{{1., 2.}, {3., 4.}}}); - std::vector hiddenBinIndices = {4, 5}; /// {0,1} + 2*2 + vector hiddenBinIndices = {4, 5}; /// {0,1} + 2*2 auto binsVec2 = binnedStorage2.bins(true); @@ -231,7 +232,7 @@ auto getBins() { } auto mergeBins() { - using BinStorageT = BinnedStorage; + using BinStorageT = BinnedStorage; BinStorageT binnedStorage1({"test1", "test2"}, {1., 2., 3.}); BinStorageT binnedStorage2({"test1", "test2"}, {1., 2., 3., 4., 5., 6.}); @@ -248,7 +249,7 @@ auto mergeBins() { } auto binnedStorageOperators() { - using BinStorageT = BinnedStorage; + using BinStorageT = BinnedStorage; BinStorageT binnedStorage1({"test1", "test2"}, {1., 2., 3.}); BinStorageT binnedStorage2({"test1", "test2"}, {1., 2., 3., 4., 5., 6.}); -- GitLab From a34335f7058152218ba35a5c2af13780c1c6524f Mon Sep 17 00:00:00 2001 From: Alexander Puck Neuwirth Date: Mon, 25 May 2026 14:01:46 +0200 Subject: [PATCH 2/2] rename: set -> setFunction --- tests/TestBinnedStorage.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/TestBinnedStorage.cc b/tests/TestBinnedStorage.cc index b61a078a..9382f40f 100644 --- a/tests/TestBinnedStorage.cc +++ b/tests/TestBinnedStorage.cc @@ -71,7 +71,7 @@ auto adapterConstructors() { return CHECK_TEST_RES(bin.counter == 1); } -auto set() { +auto setFunction() { BinningT binning({"test1", "test2"}, {1., 2., 3., 4.}, {1, 2, 3, 4, 5}); auto binStorage = FillableT<3, TestClass>(binning, [](...){}); @@ -285,7 +285,7 @@ auto testBinnedStorage() { return CHECK_TEST_RES( (constructors() == EXIT_SUCCESS) && (adapterConstructors() == EXIT_SUCCESS) && - (set() == EXIT_SUCCESS) && + (setFunction() == EXIT_SUCCESS) && (binsVectorWrapper() == EXIT_SUCCESS) && (binSpaceCharacteristics() == EXIT_SUCCESS) && (arithmeticWrapper() == EXIT_SUCCESS) && -- GitLab