From 34edd4e1433ad4047a9b1f5535d9147135f26f53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 18 Apr 2023 16:54:35 +0200 Subject: [PATCH] Bytecode: remove useless FBEGINBLOCK_::endo_nbr data member --- src/Bytecode.cc | 1 - src/Bytecode.hh | 13 ++----------- src/DynamicModel.cc | 2 -- src/StaticModel.cc | 2 -- 4 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/Bytecode.cc b/src/Bytecode.cc index 09120612..8de86ff5 100644 --- a/src/Bytecode.cc +++ b/src/Bytecode.cc @@ -90,7 +90,6 @@ operator<<(BytecodeWriter &code_file, const FBEGINBLOCK_ &instr) || instr.type == BlockSimulationType::solveForwardComplete) { write_member(instr.is_linear); - write_member(instr.endo_nbr); write_member(instr.u_count_int); } write_member(instr.nb_col_jacob); diff --git a/src/Bytecode.hh b/src/Bytecode.hh index 32729333..3688e9d2 100644 --- a/src/Bytecode.hh +++ b/src/Bytecode.hh @@ -893,7 +893,6 @@ private: vector det_exogenous; bool is_linear{false}; vector Block_Contain_; - int endo_nbr{0}; int u_count_int{0}; int nb_col_jacob{0}; int det_exo_size, exo_size; @@ -903,7 +902,7 @@ public: derivatives w.r.t. endogenous not belonging to the block) */ FBEGINBLOCK_(int size_arg, BlockSimulationType type_arg, int first_element, int block_size, const vector &variable_arg, const vector &equation_arg, - bool is_linear_arg, int endo_nbr_arg, int u_count_int_arg, int nb_col_jacob_arg, + bool is_linear_arg, int u_count_int_arg, int nb_col_jacob_arg, int det_exo_size_arg, int exo_size_arg, vector det_exogenous_arg, vector exogenous_arg) : BytecodeInstruction{Tags::FBEGINBLOCK}, @@ -914,7 +913,6 @@ public: exogenous{move(exogenous_arg)}, det_exogenous{move(det_exogenous_arg)}, is_linear{is_linear_arg}, - endo_nbr{endo_nbr_arg}, u_count_int{u_count_int_arg}, nb_col_jacob{nb_col_jacob_arg}, det_exo_size{det_exo_size_arg}, @@ -924,14 +922,13 @@ public: // Constructor when derivatives w.r.t. exogenous are absent FBEGINBLOCK_(int size_arg, BlockSimulationType type_arg, int first_element, int block_size, const vector &variable_arg, const vector &equation_arg, - bool is_linear_arg, int endo_nbr_arg, int u_count_int_arg, int nb_col_jacob_arg) : + bool is_linear_arg, int u_count_int_arg, int nb_col_jacob_arg) : BytecodeInstruction{Tags::FBEGINBLOCK}, size{size_arg}, type{type_arg}, variable{variable_arg.begin()+first_element, variable_arg.begin()+(first_element+block_size)}, equation{equation_arg.begin()+first_element, equation_arg.begin()+(first_element+block_size)}, is_linear{is_linear_arg}, - endo_nbr{endo_nbr_arg}, u_count_int{u_count_int_arg}, nb_col_jacob{nb_col_jacob_arg}, det_exo_size{0}, @@ -966,7 +963,6 @@ public: || type == BlockSimulationType::solveForwardComplete) { read_member(is_linear); - read_member(endo_nbr); read_member(u_count_int); } read_member(nb_col_jacob); @@ -1003,11 +999,6 @@ public: return is_linear; }; int - get_endo_nbr() - { - return endo_nbr; - }; - int get_u_count_int() { return u_count_int; diff --git a/src/DynamicModel.cc b/src/DynamicModel.cc index 04292b00..9c0cb676 100644 --- a/src/DynamicModel.cc +++ b/src/DynamicModel.cc @@ -183,7 +183,6 @@ DynamicModel::writeDynamicBytecode(const string &basename) const endo_idx, eq_idx, false, - symbol_table.endo_nbr(), u_count_int, jacobian_ncols_endo, symbol_table.exo_det_nbr(), @@ -229,7 +228,6 @@ DynamicModel::writeDynamicBlockBytecode(const string &basename) const endo_idx_block2orig, eq_idx_block2orig, blocks[block].linear, - symbol_table.endo_nbr(), u_count, static_cast(blocks_jacob_cols_endo[block].size())}; diff --git a/src/StaticModel.cc b/src/StaticModel.cc index 7d3b9f79..3282d4e9 100644 --- a/src/StaticModel.cc +++ b/src/StaticModel.cc @@ -121,7 +121,6 @@ StaticModel::writeStaticBytecode(const string &basename) const endo_idx, eq_idx, false, - symbol_table.endo_nbr(), u_count_int, symbol_table.endo_nbr()}; @@ -161,7 +160,6 @@ StaticModel::writeStaticBlockBytecode(const string &basename) const endo_idx_block2orig, eq_idx_block2orig, blocks[block].linear, - symbol_table.endo_nbr(), u_count, block_size};