summaryrefslogtreecommitdiff
path: root/sci-physics/yoda/files/yoda-2.1.3-stdvector.patch
blob: 5dd1bc78aae8e4a74f7612552db8459294707b84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
From 22c3cfbd04bdd7ef31db0800f9fa8d5a7f637e2e Mon Sep 17 00:00:00 2001
From: Alexander Puck Neuwirth <alexander@neuwirth-informatik.de>
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 <vector>
 
 using namespace YODA;
+using namespace std;
 
-using DStrAxis = Axis<std::string>;
+using DStrAxis = Axis<string>;
 using CDblAxis = Axis<double>;
 using DIntAxis = Axis<int>;
 
 using BinningT = Binning<DStrAxis, CDblAxis, DIntAxis>;
 
 template <typename T>
-using StorageT = BinnedStorage<T, std::string, double, int>;
+using StorageT = BinnedStorage<T, string, double, int>;
 
 template <size_t N, typename T>
-using FillableT = FillableStorage<N, T, std::string, double, int>;
+using FillableT = FillableStorage<N, T, string, double, int>;
 
 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<BinningT>(
+  auto binning = make_shared<BinningT>(
     BinningT({"test1", "test2"}, {1., 2., 3., 4.}, {1, 2, 3, 4, 5}));
   using BinT = Bin<3, int, BinningT>;
-  std::vector<BinT> bins;
+  vector<BinT> bins;
 
   bins.reserve(100);
   for(size_t i = 0; i < 100; i++){
@@ -94,9 +95,9 @@ auto binsVectorWrapper() {
   }
 
   /// @note Must be sorted.
-  std::vector<size_t> hiddenBins = {0, 9, 15, 87};
+  vector<size_t> hiddenBins = {0, 9, 15, 87};
 
-  auto vecWrapper = BinsVecWrapper<std::vector<BinT>>(bins, hiddenBins);
+  auto vecWrapper = BinsVecWrapper<vector<BinT>>(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<string> sedges{"A", "B", "C"};
   vector<double> dedges{1.,2.,3.,4.};
   vector<int> iedges{1,2,3,4,5,6,7};
-  using BinStorageT = BinnedStorage<double, std::string, double, int>;
+  using BinStorageT = BinnedStorage<double, string, double, int>;
   BinStorageT storage(sedges, dedges, iedges);
   const bool res1 = storage.shape() == vector<size_t>{3, 3, 7};
   const bool res2 = storage.shape(true) == vector<size_t>{4, 5, 8};
@@ -198,10 +199,10 @@ auto shape() {
 }
 
 auto getBins() {
-  using BinStorageT = BinnedStorage<double, std::string, double>;
+  using BinStorageT = BinnedStorage<double, string, double>;
   BinStorageT binnedStorage1({"test1", "test2"}, { 1.0, 2.0, 3.0});
 
-  std::vector<size_t> overflowIndices = {0, 1, 2, 3, 6, 9, 10, 11};
+  vector<size_t> 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<T> and std::initializer_list<std::initializer_list<T>>
+  /// of initializer_list<T> and initializer_list<initializer_list<T>>
   /// type. Intermediate axis is created.
   /*BinStorageT binnedStorage2({{"test1", "test2"}}, {{{1., 2.}, {3., 4.}}});
 
-  std::vector<size_t> hiddenBinIndices = {4, 5}; /// {0,1} + 2*2
+  vector<size_t> hiddenBinIndices = {4, 5}; /// {0,1} + 2*2
 
   auto binsVec2 = binnedStorage2.bins(true);
 
@@ -231,7 +232,7 @@ auto getBins() {
 }
 
 auto mergeBins() {
-  using BinStorageT = BinnedStorage<double, std::string, double>;
+  using BinStorageT = BinnedStorage<double, string, double>;
   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<double, std::string, double>;
+  using BinStorageT = BinnedStorage<double, string, double>;
   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 <alexander@neuwirth-informatik.de>
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