21#ifndef __SOLVER_VARIABLE_STORAGE_INTERMEDIATE_HXX__
22#define __SOLVER_VARIABLE_STORAGE_INTERMEDIATE_HXX__
24#include <antares/solver/variable/print.h>
39 Antares::Memory::Zero(HOURS_PER_YEAR,
hour);
42 memset(
day, 0,
sizeof(
day));
51 const unsigned int index)
const
57inline void IntermediateValues::buildAnnualSurveyReport(SurveyResults& report,
61 if (!(fileLevel & Category::FileLevel::id))
65 case Category::hourly:
66 internalExportAnnualValues<HOURS_PER_YEAR, VCardT>(report,
hour,
false);
69 internalExportAnnualValues<DAYS_PER_YEAR, VCardT>(report,
day,
false);
71 case Category::weekly:
72 internalExportAnnualValues<WEEKS_PER_YEAR, VCardT>(report,
week,
false);
74 case Category::monthly:
75 internalExportAnnualValues<MONTHS_PER_YEAR, VCardT>(report,
month,
false);
77 case Category::annual:
78 internalExportAnnualValues<1, VCardT>(report, &
year,
true);
84template<
unsigned int Size,
class VCardT,
class A>
85void IntermediateValues::internalExportAnnualValues(SurveyResults& report,
90 assert(report.data.columnIndex < report.maxVariables &&
"Column index out of bounds");
93 report.captions[0][report.data.columnIndex] = report.variableCaption;
94 report.captions[1][report.data.columnIndex] = report.variableUnit;
95 report.captions[2][report.data.columnIndex] =
nullptr;
97 report.precision[report.data.columnIndex] = PrecisionToPrintfFormat<VCardT::decimal>::Value();
99 report.nonApplicableStatus[report.data.columnIndex] = *report.isCurrentVarNA;
104 (void)::memcpy(report.values[report.data.columnIndex], array,
sizeof(
double) * Size);
108 double& target = *(report.values[report.data.columnIndex]);
113 ++report.data.columnIndex;
static void Release(T *&pointer)
Release a raw pointer.
Definition memory.hxx:32