diff --git a/src/SubModel.cc b/src/SubModel.cc index 2b0e151422fc38e16278d238b1a3c44130677436..03aa06871fb8bedb03e8a132e64d4f10d6fe2205 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++; } }