Skip to content
Snippets Groups Projects
Commit 2b835a50 authored by Houtan Bastani's avatar Houtan Bastani
Browse files

preprocessor: simplify code

parent 1f3ea3ad
Branches
Tags
No related merge requests found
...@@ -389,19 +389,13 @@ ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &ba ...@@ -389,19 +389,13 @@ ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &ba
<< "constrained_paths_ = zeros(" << paths.size() << ", " << path_length << ");" << endl; << "constrained_paths_ = zeros(" << paths.size() << ", " << path_length << ");" << endl;
int k = 1; int k = 1;
for (AbstractShocksStatement::det_shocks_t::const_iterator it = paths.begin(); for (AbstractShocksStatement::det_shocks_t::const_iterator it = paths.begin();
it != paths.end(); it++) it != paths.end(); it++, k++)
{ {
if (it == paths.begin()) if (it == paths.begin())
{
output << "constrained_vars_ = " << symbol_table.getTypeSpecificID(it->first) + 1 << ";" << endl; output << "constrained_vars_ = " << symbol_table.getTypeSpecificID(it->first) + 1 << ";" << endl;
}
else else
{
output << "constrained_vars_ = [constrained_vars_; " << symbol_table.getTypeSpecificID(it->first) + 1 << "];" << endl; output << "constrained_vars_ = [constrained_vars_; " << symbol_table.getTypeSpecificID(it->first) + 1 << "];" << endl;
}
const vector<AbstractShocksStatement::DetShockElement> &elems = it->second; const vector<AbstractShocksStatement::DetShockElement> &elems = it->second;
for (int i = 0; i < (int) elems.size(); i++) for (int i = 0; i < (int) elems.size(); i++)
...@@ -411,7 +405,6 @@ ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &ba ...@@ -411,7 +405,6 @@ ConditionalForecastPathsStatement::writeOutput(ostream &output, const string &ba
elems[i].value->writeOutput(output); elems[i].value->writeOutput(output);
output << ";" << endl; output << ";" << endl;
} }
k++;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment