Remove obsolete function
parent
ea3573180a
commit
3f874cfced
|
@ -4981,7 +4981,6 @@ DynamicModel::writeParamsDerivativesFile(const string &basename, bool julia) con
|
||||||
ostringstream third_derivs1_output; // Used for storing third order derivatives equations
|
ostringstream third_derivs1_output; // Used for storing third order derivatives equations
|
||||||
|
|
||||||
deriv_node_temp_terms_t tef_terms;
|
deriv_node_temp_terms_t tef_terms;
|
||||||
writeModelLocalVariables(model_local_vars_output, output_type, tef_terms);
|
|
||||||
|
|
||||||
writeTemporaryTerms(params_derivs_temporary_terms, {}, params_derivs_temporary_terms_idxs, model_output, output_type, tef_terms);
|
writeTemporaryTerms(params_derivs_temporary_terms, {}, params_derivs_temporary_terms_idxs, model_output, output_type, tef_terms);
|
||||||
|
|
||||||
|
|
|
@ -853,8 +853,8 @@ VariableNode::writeOutput(ostream &output, ExprNodeOutputType output_type,
|
||||||
output << ")";
|
output << ")";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* We append underscores to avoid name clashes with "g1" or "oo_" (see
|
/* We append underscores to avoid name clashes with "g1" or "oo_".
|
||||||
also ModelTree::writeModelLocalVariables) */
|
But we probably never arrive here because MLV are temporary terms… */
|
||||||
output << datatree.symbol_table.getName(symb_id) << "__";
|
output << datatree.symbol_table.getName(symb_id) << "__";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -1469,40 +1469,6 @@ ModelTree::compileTemporaryTerms(ostream &code_file, unsigned int &instruction_n
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ModelTree::writeModelLocalVariables(ostream &output, ExprNodeOutputType output_type, deriv_node_temp_terms_t &tef_terms) const
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
/* Collect all model local variables appearing in equations, and print only
|
|
||||||
them. Printing unused model local variables can lead to a crash (see
|
|
||||||
ticket #101). */
|
|
||||||
set<int> used_local_vars;
|
|
||||||
const temporary_terms_t tt;
|
|
||||||
const temporary_terms_idxs_t tti;
|
|
||||||
for (size_t i = 0; i < equations.size(); i++)
|
|
||||||
equations[i]->collectVariables(eModelLocalVariable, used_local_vars);
|
|
||||||
|
|
||||||
for (vector<int>::const_iterator it = local_variables_vector.begin();
|
|
||||||
it != local_variables_vector.end(); it++)
|
|
||||||
if (used_local_vars.find(*it) != used_local_vars.end())
|
|
||||||
{
|
|
||||||
int id = *it;
|
|
||||||
expr_t value = local_variables_table.find(id)->second;
|
|
||||||
value->writeExternalFunctionOutput(output, output_type, tt, tti, tef_terms);
|
|
||||||
|
|
||||||
if (IS_C(output_type))
|
|
||||||
output << "double ";
|
|
||||||
else if (IS_JULIA(output_type))
|
|
||||||
output << " @inbounds ";
|
|
||||||
|
|
||||||
/* We append underscores to avoid name clashes with "g1" or "oo_" (see
|
|
||||||
also VariableNode::writeOutput) */
|
|
||||||
output << symbol_table.getName(id) << "__ = ";
|
|
||||||
value->writeOutput(output, output_type, tt, tti, tef_terms);
|
|
||||||
output << ";" << endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ModelTree::writeJsonModelLocalVariables(ostream &output, deriv_node_temp_terms_t &tef_terms) const
|
ModelTree::writeJsonModelLocalVariables(ostream &output, deriv_node_temp_terms_t &tef_terms) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -197,9 +197,6 @@ protected:
|
||||||
void fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_paren_vars, bool &message_printed) const;
|
void fixNestedParenthesis(ostringstream &output, map<string, string> &tmp_paren_vars, bool &message_printed) const;
|
||||||
//! Tests if string contains more than 32 nested parens, Issue #1201
|
//! Tests if string contains more than 32 nested parens, Issue #1201
|
||||||
bool testNestedParenthesis(const string &str) const;
|
bool testNestedParenthesis(const string &str) const;
|
||||||
//! Writes model local variables
|
|
||||||
/*! No temporary term is used in the output, so that local parameters declarations can be safely put before temporary terms declaration in the output files */
|
|
||||||
void writeModelLocalVariables(ostream &output, ExprNodeOutputType output_type, deriv_node_temp_terms_t &tef_terms) const;
|
|
||||||
void writeModelLocalVariableTemporaryTerms(const temporary_terms_t &tto, const map<expr_t, expr_t, ExprNodeLess> &tt,
|
void writeModelLocalVariableTemporaryTerms(const temporary_terms_t &tto, const map<expr_t, expr_t, ExprNodeLess> &tt,
|
||||||
ostream &output, ExprNodeOutputType output_type,
|
ostream &output, ExprNodeOutputType output_type,
|
||||||
deriv_node_temp_terms_t &tef_terms) const;
|
deriv_node_temp_terms_t &tef_terms) const;
|
||||||
|
|
|
@ -2519,7 +2519,6 @@ StaticModel::writeParamsDerivativesFile(const string &basename, bool julia) cons
|
||||||
ostringstream third_derivs1_output; // Used for storing third order derivatives equations
|
ostringstream third_derivs1_output; // Used for storing third order derivatives equations
|
||||||
|
|
||||||
deriv_node_temp_terms_t tef_terms;
|
deriv_node_temp_terms_t tef_terms;
|
||||||
writeModelLocalVariables(model_local_vars_output, output_type, tef_terms);
|
|
||||||
|
|
||||||
writeTemporaryTerms(params_derivs_temporary_terms, {}, params_derivs_temporary_terms_idxs, model_output, output_type, tef_terms);
|
writeTemporaryTerms(params_derivs_temporary_terms, {}, params_derivs_temporary_terms_idxs, model_output, output_type, tef_terms);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue