PAC models: handle PAC data in DynamicModel copy constructor and assignment operator
parent
4f453320d1
commit
5f22f00436
|
@ -48,6 +48,9 @@ DynamicModel::copyHelper(const DynamicModel &m)
|
||||||
blocks_derivatives_exo.emplace_back(convert_block_derivative(it));
|
blocks_derivatives_exo.emplace_back(convert_block_derivative(it));
|
||||||
for (const auto &it : m.blocks_derivatives_exo_det)
|
for (const auto &it : m.blocks_derivatives_exo_det)
|
||||||
blocks_derivatives_exo_det.emplace_back(convert_block_derivative(it));
|
blocks_derivatives_exo_det.emplace_back(convert_block_derivative(it));
|
||||||
|
|
||||||
|
for (const auto &[key, expr] : m.pac_expectation_substitution)
|
||||||
|
pac_expectation_substitution.emplace(key, f(expr));
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicModel::DynamicModel(SymbolTable &symbol_table_arg,
|
DynamicModel::DynamicModel(SymbolTable &symbol_table_arg,
|
||||||
|
@ -103,7 +106,14 @@ DynamicModel::DynamicModel(const DynamicModel &m) :
|
||||||
block_exo_index{m.block_exo_index},
|
block_exo_index{m.block_exo_index},
|
||||||
block_det_exo_index{m.block_det_exo_index},
|
block_det_exo_index{m.block_det_exo_index},
|
||||||
block_other_endo_index{m.block_other_endo_index},
|
block_other_endo_index{m.block_other_endo_index},
|
||||||
var_expectation_functions_to_write{m.var_expectation_functions_to_write}
|
var_expectation_functions_to_write{m.var_expectation_functions_to_write},
|
||||||
|
pac_mce_alpha_symb_ids{m.pac_mce_alpha_symb_ids},
|
||||||
|
pac_h0_indices{m.pac_h0_indices},
|
||||||
|
pac_h1_indices{m.pac_h1_indices},
|
||||||
|
pac_mce_z1_symb_ids{m.pac_mce_z1_symb_ids},
|
||||||
|
pac_eqtag_and_lag{m.pac_eqtag_and_lag},
|
||||||
|
pac_model_info{m.pac_model_info},
|
||||||
|
pac_equation_info{m.pac_equation_info}
|
||||||
{
|
{
|
||||||
copyHelper(m);
|
copyHelper(m);
|
||||||
}
|
}
|
||||||
|
@ -160,6 +170,15 @@ DynamicModel::operator=(const DynamicModel &m)
|
||||||
block_other_endo_index = m.block_other_endo_index;
|
block_other_endo_index = m.block_other_endo_index;
|
||||||
var_expectation_functions_to_write = m.var_expectation_functions_to_write;
|
var_expectation_functions_to_write = m.var_expectation_functions_to_write;
|
||||||
|
|
||||||
|
pac_mce_alpha_symb_ids = m.pac_mce_alpha_symb_ids;
|
||||||
|
pac_h0_indices = m.pac_h0_indices;
|
||||||
|
pac_h1_indices = m.pac_h1_indices;
|
||||||
|
pac_mce_z1_symb_ids = m.pac_mce_z1_symb_ids;
|
||||||
|
pac_eqtag_and_lag = m.pac_eqtag_and_lag;
|
||||||
|
pac_expectation_substitution.clear();
|
||||||
|
pac_model_info = m.pac_model_info;
|
||||||
|
pac_equation_info = m.pac_equation_info;
|
||||||
|
|
||||||
copyHelper(m);
|
copyHelper(m);
|
||||||
|
|
||||||
return *this;
|
return *this;
|
||||||
|
|
Loading…
Reference in New Issue