Implemented MATLAB part of the block_mfs option to steady.

(Still need to fix a bug)


git-svn-id: https://www.dynare.org/svn/dynare/trunk@2829 ac1d8469-bf42-47a9-8791-bf33cf982152
issue#70
sebastien 2009-07-09 16:35:07 +00:00
parent 84f3993088
commit 8a6d750c51
1 changed files with 7 additions and 8 deletions

View File

@ -517,15 +517,11 @@ StaticModel::writeOutput(ostream &output) const
if (!block_mfs)
return;
output << "M_.blocks = cell(" << blocks.size() << ", 1);" << endl
<< "M_.blocksMFS = cell(" << blocksMFS.size() << ", 1);" << endl;
output << "M_.blocksMFS = cell(" << blocksMFS.size() << ", 1);" << endl;
for(int b = 0; b < (int) blocks.size(); b++)
{
output << "M_.blocks{" << b+1 << "} = [ ";
transform(blocks[b].begin(), blocks[b].end(), ostream_iterator<int>(output, " "), bind2nd(plus<int>(), 1));
output << "];" << endl
<< "M_.blocksMFS{" << b+1 << "} = [ ";
transform(blocksMFS[b].begin(), blocksMFS[b].end(), ostream_iterator<int>(output, " "), bind2nd(plus<int>(), 1));
output << "M_.blocksMFS{" << b+1 << "} = [ ";
transform(blocksMFS[b].begin(), blocksMFS[b].end(), ostream_iterator<int>(output, "; "), bind2nd(plus<int>(), 1));
output << "];" << endl;
}
}
@ -533,7 +529,7 @@ StaticModel::writeOutput(ostream &output) const
void
StaticModel::writeStaticBlockMFSFile(ostream &output, const string &func_name) const
{
output << "function [y, residual, g1] = " << func_name << "(nblock, y, x, params)" << endl
output << "function [residual, g1, y] = " << func_name << "(nblock, y, x, params)" << endl
<< " switch nblock" << endl;
for(int b = 0; b < (int) blocks.size(); b++)
@ -596,4 +592,7 @@ StaticModel::writeStaticBlockMFSFile(ostream &output, const string &func_name) c
i++;
}
}
output << " end" << endl
<< "end" << endl;
}