Merge branch 'master' into rmExtraExo

issue#70
Houtan Bastani 2015-04-01 15:22:10 +02:00
commit e3ef0b12c4
6 changed files with 29 additions and 24 deletions

View File

@ -730,17 +730,14 @@ DynareSensitivityStatement::writeOutput(ostream &output, const string &basename)
output << "dynare_sensitivity(options_gsa);" << endl;
}
RplotStatement::RplotStatement(const SymbolList &symbol_list_arg,
const OptionsList &options_list_arg) :
symbol_list(symbol_list_arg),
options_list(options_list_arg)
RplotStatement::RplotStatement(const SymbolList &symbol_list_arg) :
symbol_list(symbol_list_arg)
{
}
void
RplotStatement::writeOutput(ostream &output, const string &basename) const
{
options_list.writeOutput(output);
symbol_list.writeOutput("var_list_", output);
output << "rplot(var_list_);" << endl;
}
@ -2369,7 +2366,7 @@ JointPriorStatement::writeOutput(ostream &output, const string &basename) const
writeOutputHelper(output, "truncate", lhs_field);
writeOutputHelper(output, "variance", lhs_field);
output << "estimation_info.joint_parameter_tmp = table(key, ..." << endl
output << "estimation_info.joint_parameter_tmp = [key, ..." << endl
<< " " << lhs_field << ".domain , ..." << endl
<< " " << lhs_field << ".interval , ..." << endl
<< " " << lhs_field << ".mean , ..." << endl
@ -2379,15 +2376,9 @@ JointPriorStatement::writeOutput(ostream &output, const string &basename) const
<< " " << lhs_field << ".shift , ..." << endl
<< " " << lhs_field << ".stdev , ..." << endl
<< " " << lhs_field << ".truncate , ..." << endl
<< " " << lhs_field << ".variance, ..." << endl
<< " 'VariableNames',{'index','domain','interval','mean','median','mode','shape','shift','stdev','truncate','variance'});" << endl;
output << "if height(estimation_info.joint_parameter)" << endl
<< " estimation_info.joint_parameter = [estimation_info.joint_parameter; estimation_info.joint_parameter_tmp];" << endl
<< "else" << endl
<< " estimation_info.joint_parameter = estimation_info.joint_parameter_tmp;" << endl
<< "end" << endl
<< "clear estimation_info.joint_parameter_tmp;" << endl;
<< " " << lhs_field << ".variance];" << endl
<< "estimation_info.joint_parameter = [estimation_info.joint_parameter; estimation_info.joint_parameter_tmp];" << endl
<< "estimation_info=rmfield(estimation_info, 'joint_parameter_tmp');" << endl;
}
void
@ -2395,10 +2386,14 @@ JointPriorStatement::writeOutputHelper(ostream &output, const string &field, con
{
OptionsList::num_options_t::const_iterator itn = options_list.num_options.find(field);
output << lhs_field << "." << field << " = {";
if (field=="variance")
output << "{";
if (itn != options_list.num_options.end())
output << itn->second;
else
output << "{}";
if (field=="variance")
output << "}";
output << "};" << endl;
}

View File

@ -155,10 +155,8 @@ class RplotStatement : public Statement
{
private:
const SymbolList symbol_list;
const OptionsList options_list;
public:
RplotStatement(const SymbolList &symbol_list_arg,
const OptionsList &options_list_arg);
RplotStatement(const SymbolList &symbol_list_arg);
virtual void writeOutput(ostream &output, const string &basename) const;
};

View File

@ -187,6 +187,10 @@ DynamicModel::computeTemporaryTermsOrdered()
it->second->collectTemporary_terms(temporary_terms, temporary_terms_in_use, block);
for (derivative_t::const_iterator it = derivative_other_endo[block].begin(); it != derivative_other_endo[block].end(); it++)
it->second->collectTemporary_terms(temporary_terms, temporary_terms_in_use, block);
for (derivative_t::const_iterator it = derivative_exo[block].begin(); it != derivative_exo[block].end(); it++)
it->second->collectTemporary_terms(temporary_terms, temporary_terms_in_use, block);
for (derivative_t::const_iterator it = derivative_exo_det[block].begin(); it != derivative_exo_det[block].end(); it++)
it->second->collectTemporary_terms(temporary_terms, temporary_terms_in_use, block);
v_temporary_terms_inuse[block] = temporary_terms_in_use;
}
computeTemporaryTermsMapping();

View File

@ -851,6 +851,8 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
string token;
yylval->vector_string_val = new vector<string *>;
bool dynare_statement = true;
while(getline(ss, token, ','))
if (driver.symbol_exists_and_is_not_modfile_local_or_external_function(token.c_str()))
yylval->vector_string_val->push_back(new string(token));
@ -862,9 +864,10 @@ DATE -?[0-9]+([YyAa]|[Mm]([1-9]|1[0-2])|[Qq][1-4]|[Ww]([1-9]{1}|[1-4][0-9]|5[0-2
delete yylval->vector_string_val;
BEGIN NATIVE;
yyless(0);
dynare_statement = false;
break;
}
if (yylval->vector_string_val->size() > 0)
if (dynare_statement)
{
BEGIN DYNARE_STATEMENT;
return token::SYMBOL_VEC;

View File

@ -68,8 +68,14 @@ DynareFlex.cc FlexLexer.h: DynareFlex.ll
DynareBison.cc DynareBison.hh location.hh stack.hh position.hh: DynareBison.yy
$(YACC) -o DynareBison.cc DynareBison.yy
all-local:
cd ../matlab && $(LN_S) -f $(abs_srcdir)/$(PROGRAMS) $(PROGRAMS)
all-local: $(PROGRAMS)
if [ -z "`file $(PROGRAMS) | grep x86.64`" ]; then \
ARCH="32"; \
else \
ARCH="64"; \
fi; \
mkdir -p ../matlab/preprocessor$$ARCH ; \
cd ../matlab/preprocessor$$ARCH && $(LN_S) -f $(abs_srcdir)/$(PROGRAMS) $(PROGRAMS)
if HAVE_DOXYGEN
html-local:
@ -77,7 +83,7 @@ html-local:
endif
clean-local:
cd ../matlab && rm -f $(PROGRAMS)
rm -rf ../matlab/preprocessor*
rm -rf doc/html/
EXTRA_DIST = $(BUILT_SOURCES) Doxyfile

View File

@ -1186,8 +1186,7 @@ ParsingDriver::add_in_symbol_list(string *tmp_var)
void
ParsingDriver::rplot()
{
mod_file->addStatement(new RplotStatement(symbol_list, options_list));
options_list.clear();
mod_file->addStatement(new RplotStatement(symbol_list));
symbol_list.clear();
}