Commit f0cc9c41 authored by Houtan Bastani's avatar Houtan Bastani

modify *_set_auxiliary_variables to work in julia

parent 88a87a91
......@@ -1617,7 +1617,7 @@ StaticModel::writeStaticFile(const string &basename, bool block, bool bytecode,
writeStaticJuliaFile(basename);
else
writeStaticMFile(basename);
writeAuxVarRecursiveDefinitions(basename);
writeAuxVarRecursiveDefinitions(basename, julia);
}
void
......@@ -1977,10 +1977,11 @@ StaticModel::writeAuxVarInitval(ostream &output, ExprNodeOutputType output_type)
}
}
void StaticModel::writeAuxVarRecursiveDefinitions(const string &basename) const
void StaticModel::writeAuxVarRecursiveDefinitions(const string &basename, const bool julia) const
{
string func_name = basename + "_set_auxiliary_variables";
string filename = func_name + ".m";
string filename = julia ? func_name + ".jl" : func_name + ".m";
string comment = julia ? "#" : "%";
ofstream output;
output.open(filename.c_str(), ios::out | ios::binary);
......@@ -1991,11 +1992,11 @@ void StaticModel::writeAuxVarRecursiveDefinitions(const string &basename) const
}
output << "function y = " << func_name + "(y, x, params)" << endl
<< "%" << endl
<< "% Status : Computes static model for Dynare" << endl
<< "%" << endl
<< "% Warning : this file is generated automatically by Dynare" << endl
<< "% from model file (.mod)" << endl
<< comment << endl
<< comment << " Status : Computes static model for Dynare" << endl
<< comment << endl
<< comment << " Warning : this file is generated automatically by Dynare" << endl
<< comment << " from model file (.mod)" << endl
<< endl;
deriv_node_temp_terms_t tef_terms;
......
......@@ -182,8 +182,8 @@ public:
//! Writes initializations in oo_.steady_state or steady state file for the auxiliary variables
void writeAuxVarInitval(ostream &output, ExprNodeOutputType output_type) const;
//! Writes definition of the auxiliary variables in a M file
void writeAuxVarRecursiveDefinitions(const string &basename) const;
//! Writes definition of the auxiliary variables in a .m or .jl file
void writeAuxVarRecursiveDefinitions(const string &basename, const bool julia) const;
virtual int getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException);
virtual void addAllParamDerivId(set<int> &deriv_id_set);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment