From fdba6a29713816507cae385aafae966b3e149cb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Argos=29?= <stepan@adjemian.eu> Date: Tue, 23 Apr 2024 11:06:09 +0200 Subject: [PATCH] Rename subfield for consistency and remove unused subfields. --- src/SubModel.cc | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/src/SubModel.cc b/src/SubModel.cc index 2b0e1514..03aa0687 100644 --- a/src/SubModel.cc +++ b/src/SubModel.cc @@ -1507,7 +1507,7 @@ PacModelTable::writeOutput(ostream& output) const // Write the auxiliary variable IDs created for the pac_expectation operator for (auto& [name, id] : aux_var_symb_ids) - output << "M_.pac." << name << "." << (aux_model_name.at(name).empty() ? "mce.z1" : "aux_id") + output << "M_.pac." << name << "." << (aux_model_name.at(name).empty() ? "mce.z" : "aux_id") << " = " << symbol_table.getTypeSpecificID(id) + 1 << ";" << endl; // Write PAC equation name info @@ -1714,39 +1714,13 @@ PacModelTable::writeOutput(ostream& output) const if (aux_model_name.at(name).empty()) { string pac_model_name = "M_.pac." + name + ".mce."; - output << pac_model_name << "z = NaN(" << get<2>(val).size() << ",1);" << endl - << pac_model_name << "w = NaN(" << get<2>(val).size() << ",1);" << endl - << pac_model_name << "b = NaN(" << get<2>(val).size() << ",1);" << endl; + output << pac_model_name << "z = NaN(" << get<2>(val).size() << ",1);" << endl; for (int component_idx {1}; auto& [component, growth_component, auxname, kind, coeff, growth_neutrality_param, h_indices, original_growth_component, growth_component_info] : get<2>(val)) { output << pac_model_name << "z(" << component_idx << ") = " << symbol_table.getTypeSpecificID(auxname) + 1 << ";" << endl; - set<int> params; - coeff->collectVariables(SymbolType::parameter, params); - /* If the coefficient expression uses numerical constants only, set b to 0 and w to the - computed numerical weight - */ - if (params.empty()) - { - ostringstream mce_w; - coeff->writeOutput(mce_w); - output << pac_model_name << "b(" << component_idx << ") = 0;" << endl - << pac_model_name << "w(" << component_idx << ") = " << mce_w.str() << ";" - << endl; - } - /* If the coefficient expression is simply a parameter, set b to 1 and w to - the parameter index - */ - if ((params.size() == 1) && (typeid(*coeff) == typeid(VariableNode))) - output << pac_model_name << "b(" << component_idx << ") = 1;" << endl - << pac_model_name << "w(" << component_idx - << ") = " << symbol_table.getTypeSpecificID(*params.begin()) + 1 << ";" - << endl; - /* If the coefficient expression mixes numerical constants and parameters, the - associated values in w and b are NaN - */ component_idx++; } } -- GitLab