21 #ifndef __SOLVER_VARIABLE_STORAGE_INTERMEDIATE_HXX__
22 #define __SOLVER_VARIABLE_STORAGE_INTERMEDIATE_HXX__
24 #include <antares/solver/variable/print.h>
26 namespace Antares::Solver::Variable
35 Antares::Memory::Zero(HOURS_PER_YEAR,
hour);
38 memset(
day, 0,
sizeof(
day));
47 const unsigned int index)
const
52 template<
class VCardT>
53 inline void IntermediateValues::buildAnnualSurveyReport(SurveyResults& report,
57 if (!(fileLevel & Category::FileLevel::id))
61 case Category::hourly:
62 internalExportAnnualValues<HOURS_PER_YEAR, VCardT>(report,
hour,
false);
65 internalExportAnnualValues<DAYS_PER_YEAR, VCardT>(report,
day,
false);
67 case Category::weekly:
68 internalExportAnnualValues<WEEKS_PER_YEAR, VCardT>(report,
week,
false);
70 case Category::monthly:
71 internalExportAnnualValues<MONTHS_PER_YEAR, VCardT>(report,
month,
false);
73 case Category::annual:
74 internalExportAnnualValues<1, VCardT>(report, &
year,
true);
80 template<
unsigned int Size,
class VCardT,
class A>
81 void IntermediateValues::internalExportAnnualValues(SurveyResults& report,
86 assert(report.data.columnIndex < report.maxVariables &&
"Column index out of bounds");
89 report.captions[0][report.data.columnIndex] = report.variableCaption;
90 report.captions[1][report.data.columnIndex] = report.variableUnit;
91 report.captions[2][report.data.columnIndex] =
nullptr;
93 report.precision[report.data.columnIndex] = PrecisionToPrintfFormat<VCardT::decimal>::Value();
95 report.nonApplicableStatus[report.data.columnIndex] = *report.isCurrentVarNA;
100 (void)::memcpy(report.values[report.data.columnIndex], array,
sizeof(
double) * Size);
104 double& target = *(report.values[report.data.columnIndex]);
109 ++report.data.columnIndex;
static void Release(T *&pointer)
Release a raw pointer.
Definition: memory.hxx:32