43struct Raw:
public NextT
54 categoryFile = NextT::categoryFile | Variable::Category::FileLevel::allFile,
88 inline void merge(uint year,
const IntermediateValues& rhs)
90 rawdata.merge(year, rhs);
92 NextType::merge(year, rhs);
95 template<
class S,
class VCardT>
96 void buildSurveyReport(SurveyResults& report,
102 if (fileLevel & FileFilter && !(fileLevel & Category::FileLevel::id))
106 case Category::hourly:
107 InternalExportValues<Category::hourly, HOURS_PER_YEAR, VCardT>(
109 ::Antares::Memory::RawPointer(rawdata.hourly));
111 case Category::daily:
112 InternalExportValues<Category::daily, DAYS_PER_YEAR, VCardT>(report, rawdata.daily);
114 case Category::weekly:
115 InternalExportValues<Category::weekly, WEEKS_PER_YEAR, VCardT>(report,
118 case Category::monthly:
119 InternalExportValues<Category::monthly, MONTHS_PER_YEAR, VCardT>(report,
122 case Category::annual:
123 InternalExportValues<Category::annual, 1, VCardT>(report, rawdata.year.data());
128 NextType::template buildSurveyReport<S, VCardT>(report,
135 template<
class VCardT>
136 void buildDigest(SurveyResults& report,
int digestLevel,
int dataLevel)
const
138 if ((dataLevel & Category::DataLevel::area || dataLevel & Category::DataLevel::setOfAreas)
139 && digestLevel & Category::digestAllYears)
141 assert(report.data.columnIndex < report.maxVariables &&
"Column index out of bounds");
143 report.captions[0][report.data.columnIndex] = report.variableCaption;
144 report.captions[1][report.data.columnIndex] = report.variableUnit;
145 report.captions[2][report.data.columnIndex] =
"values";
148 report.precision[report.data.columnIndex] = PrecisionToPrintfFormat<
149 VCardT::decimal>::Value();
151 report.values[report.data.columnIndex][report.data.rowIndex] = rawdata.allYears;
153 report.digestNonApplicableStatus[report.data.rowIndex][report.data.columnIndex]
154 = *report.isCurrentVarNA;
156 ++(report.data.columnIndex);
159 NextType::template buildDigest<VCardT>(report, digestLevel, dataLevel);
162 template<
template<
class,
int>
class DecoratorT>
163 Antares::Memory::Stored<double>::ConstReturnType hourlyValuesForSpatialAggregate()
const
165 if (Yuni::Static::Type::StrictlyEqual<DecoratorT<Empty, 0>, Raw<Empty, 0>>::Yes)
167 return rawdata.hourly;
169 return NextType::template hourlyValuesForSpatialAggregate<DecoratorT>();
176 template<
int PrecisionT, u
int Size,
class VCardT>
177 void InternalExportValues(SurveyResults& report,
const double* array)
const
180 assert(report.data.columnIndex < report.maxVariables &&
"Column index out of bounds");
183 report.captions[0][report.data.columnIndex] = report.variableCaption;
184 report.captions[1][report.data.columnIndex] = report.variableUnit;
185 report.captions[2][report.data.columnIndex] =
"values";
188 VCardT::decimal>::Value();
190 report.nonApplicableStatus[report.data.columnIndex] = *report.isCurrentVarNA;
193 if (PrecisionT == Category::annual)
195 rawdata.allYears = 0.;
196 for (uint i = 0; i != rawdata.nbYearsCapacity; ++i)
198 rawdata.allYears += array[i];
200 *(report.values[report.data.columnIndex]) = rawdata.allYears;
204 (void)::memcpy(report.values[report.data.columnIndex], array,
sizeof(
double) * Size);
208 ++report.data.columnIndex;
211 template<u
int Size,
class VCardT>
212 void InternalExportValuesMC(
int precision, SurveyResults& report,
const double* array)
const
214 if (not(precision & Category::annual))
218 assert(report.data.columnIndex < report.maxVariables &&
"Column index out of bounds");
221 report.captions[0][report.data.columnIndex] = report.variableCaption;
222 report.captions[1][report.data.columnIndex] = report.variableUnit;
223 report.captions[2][report.data.columnIndex] =
"values";
226 VCardT::decimal>::Value();
228 report.nonApplicableStatus[report.data.columnIndex] = *report.isCurrentVarNA;
230 (void)::memcpy(report.data.matrix[report.data.columnIndex],
232 report.data.nbYears *
sizeof(
double));
235 ++report.data.columnIndex;