Commit 233c59601f0eafe4bbf3ff09b9ca57e22c867745

Authored by Benjamin Renard
1 parent ab5cbac2

Fix catalog size definition in statistic process when first interval do not return any data (#9254)

Showing 1 changed file with 13 additions and 9 deletions   Show diff stats
src/ExternLib/StatisticProcesses/MinMaxMeanStatistic.hh
... ... @@ -49,6 +49,9 @@ namespace AMDA {
49 49 _paramInput(param), _timeIntervalList(pTimeIntervalList),
50 50 _currentTimeInterval(_timeIntervalList->begin()),
51 51 _funcType(funcType), _dimDef("unknown") {
  52 + ElementType fillValue;
  53 + fillValue << NotANumber();
  54 + initDimSize(fillValue);
52 55 resetData(StatisticOperation<TResultData>::_resultData);
53 56 }
54 57  
... ... @@ -128,6 +131,16 @@ namespace AMDA {
128 131 }
129 132  
130 133 private:
  134 + template<typename Type>
  135 + void initDimSize(Type &/*a*/) {
  136 + _dimDef.str("1");
  137 + }
  138 +
  139 + template<typename Type>
  140 + void initDimSize(std::vector<Type> &/*a*/) {
  141 + _dimDef.str("unknown");
  142 + }
  143 +
131 144  
132 145 template<typename Type>
133 146 void resetData(Type &a) {
... ... @@ -142,8 +155,6 @@ namespace AMDA {
142 155  
143 156 template<typename Type>
144 157 void computeMin(Type &a) {
145   - _dimDef.str("1");
146   -
147 158 if (isNAN(a))
148 159 return;
149 160  
... ... @@ -184,8 +195,6 @@ namespace AMDA {
184 195  
185 196 template<typename Type>
186 197 void computeMax(Type &a) {
187   - _dimDef.str("1");
188   -
189 198 if (isNAN(a))
190 199 return;
191 200  
... ... @@ -227,8 +236,6 @@ namespace AMDA {
227 236  
228 237 template<typename Type>
229 238 void addForMean(Type &a) {
230   - _dimDef.str("1");
231   -
232 239 if (isNAN(a))
233 240 return;
234 241  
... ... @@ -270,8 +277,6 @@ namespace AMDA {
270 277  
271 278 template<typename Type>
272 279 void addForRMS(Type &a) {
273   - _dimDef.str("1");
274   -
275 280 if (isNAN(a))
276 281 return;
277 282  
... ... @@ -313,7 +318,6 @@ namespace AMDA {
313 318  
314 319 template<typename Type>
315 320 void generateVector(Type &a) {
316   - _dimDef.str("1");
317 321 if (isNAN(a))
318 322 return;
319 323 if (isNAN(StatisticOperation<TResultData>::_resultData._result))
... ...