Skip to content
Snippets Groups Projects
Verified Commit 8305b94d authored by Stéphane Adjemian's avatar Stéphane Adjemian
Browse files

Fix constant definition in reduced form VAR.

parent c6a7d56b
Branches
No related tags found
No related merge requests found
......@@ -533,8 +533,10 @@ VarModelTable::writeOutput(const string &basename, ostream &output) const
<< " for i=1:" << getMaxLag(name) << endl
<< " ar(:,:,i) = a0\\ar(:,:,i);" << endl
<< " end" << endl
<< " if nargout<3" << endl
<< " a0 = eye(" << lhs.size() << ");" << endl
<< " end" << endl
<< " end" << endl
<< " if nargout>2" << endl
<< " constants = zeros(" << lhs.size() << ",1);" << endl;
for (auto [eqn, expr] : constants.at(name))
......@@ -544,6 +546,10 @@ VarModelTable::writeOutput(const string &basename, ostream &output) const
ar_output << ";" << endl;
}
ar_output << " end" << endl
<< " if reducedform" << endl
<< " constants = a0\\constants;" << endl
<< " a0 = eye(" << lhs.size() << ");" << endl
<< " end" << endl
<< " end" << endl
<< " return" << endl
<< "end" << endl << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment