Fixed indentation if c and c++ files.

parent 6d573547
......@@ -229,7 +229,7 @@ enum TrinaryOpcode
};
enum external_function_type
{
{
ExternalFunctionWithoutDerivative,
ExternalFunctionWithFirstDerivative,
ExternalFunctionWithFirstandSecondDerivative,
......@@ -237,7 +237,7 @@ enum external_function_type
ExternalFunctionFirstDerivative,
ExternalFunctionNumericalSecondDerivative,
ExternalFunctionSecondDerivative
};
};
enum PriorDistributions
{
......@@ -1468,7 +1468,7 @@ public:
is_linear = is_linear_arg; endo_nbr = endo_nbr_arg; Max_Lag = Max_Lag_arg; Max_Lead = Max_Lead_arg; u_count_int = u_count_int_arg;
nb_col_jacob = nb_col_jacob_arg;
det_exo_size = 0; exo_size = 0; other_endo_size = 0;
nb_col_det_exo_jacob = 0;nb_col_exo_jacob = 0;nb_col_other_endo_jacob = 0;
nb_col_det_exo_jacob = 0; nb_col_exo_jacob = 0; nb_col_other_endo_jacob = 0;
}
inline unsigned int
get_size()
......@@ -2026,4 +2026,3 @@ public:
#endif
#pragma pack(pop)
#endif
This diff is collapsed.
......@@ -189,7 +189,8 @@ public:
class RamseyConstraintsStatement : public Statement
{
public:
struct Constraint {
struct Constraint
{
int endo;
BinaryOpcode code;
expr_t expression;
......@@ -476,7 +477,8 @@ public:
/*! \param model_tree_arg the model tree used to store the objective function.
It is owned by the PlannerObjectiveStatement, and will be deleted by its destructor */
PlannerObjectiveStatement(StaticModel *model_tree_arg);
virtual ~PlannerObjectiveStatement();
virtual
~PlannerObjectiveStatement();
/*! \todo check there are only endogenous variables at the current period in the objective
(no exogenous, no lead/lag) */
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
......@@ -845,11 +847,11 @@ public:
void writeOutputHelper(ostream &output, const string &field, const string &lhs_field) const;
};
class BasicPriorStatement : public Statement
{
public:
virtual ~BasicPriorStatement();
virtual
~BasicPriorStatement();
protected:
const string name;
const string subsample_name;
......@@ -952,7 +954,8 @@ public:
class BasicOptionsStatement : public Statement
{
public:
virtual ~BasicOptionsStatement();
virtual
~BasicOptionsStatement();
protected:
const string name;
const string subsample_name;
......
......@@ -102,7 +102,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
if (config_file.empty())
{
string defaultConfigFile ("");
string defaultConfigFile("");
// Test OS and try to open default file
#if defined(_WIN32) || defined(__CYGWIN32__)
if (getenv("APPDATA") == NULL)
......@@ -158,7 +158,6 @@ ConfigFile::getConfigFileInfo(const string &config_file)
}
}
string name, computerName, port, userName, password, remoteDrive,
remoteDirectory, dynarePath, matlabOctavePath, operatingSystem,
global_init_file;
......@@ -271,7 +270,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
vector<string> tokenizedPath;
split(tokenizedPath, tokenizedLine.back(), is_any_of(":"), token_compress_on);
for (vector<string>::iterator it = tokenizedPath.begin();
it != tokenizedPath.end(); it++ )
it != tokenizedPath.end(); it++)
if (!it->empty())
{
trim(*it);
......@@ -375,7 +374,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
for (tokenizer<char_separator<char> >::iterator it = tokens.begin();
it != tokens.end(); it++)
{
string token (*it);
string token(*it);
if (token.compare("(") == 0)
{
begin_weight = true;
......@@ -525,10 +524,10 @@ void
ConfigFile::checkPass(WarningConsolidation &warnings) const
{
bool global_init_file_declared = false;
for (vector<Hook *>::const_iterator it = hooks.begin() ; it != hooks.end(); it++)
for (vector<Hook *>::const_iterator it = hooks.begin(); it != hooks.end(); it++)
{
const map <string, string> hookmap = (*it)->get_hooks();
for (map <string, string>::const_iterator mapit = hookmap.begin() ; mapit != hookmap.end(); mapit++)
for (map <string, string>::const_iterator mapit = hookmap.begin(); mapit != hookmap.end(); mapit++)
if (mapit->first.compare("global_init_file") == 0)
if (global_init_file_declared == true)
{
......@@ -686,10 +685,10 @@ vector<string>
ConfigFile::getIncludePaths() const
{
vector<string> include_paths;
for (vector<Path *>::const_iterator it = paths.begin() ; it != paths.end(); it++)
for (vector<Path *>::const_iterator it = paths.begin(); it != paths.end(); it++)
{
map <string, vector<string> > pathmap = (*it)->get_paths();
for (map <string, vector<string> >::const_iterator mapit = pathmap.begin() ; mapit != pathmap.end(); mapit++)
for (map <string, vector<string> >::const_iterator mapit = pathmap.begin(); mapit != pathmap.end(); mapit++)
for (vector<string>::const_iterator vecit = mapit->second.begin(); vecit != mapit->second.end(); vecit++)
include_paths.push_back(*vecit);
}
......@@ -699,10 +698,10 @@ ConfigFile::getIncludePaths() const
void
ConfigFile::writeHooks(ostream &output) const
{
for (vector<Hook *>::const_iterator it = hooks.begin() ; it != hooks.end(); it++)
for (vector<Hook *>::const_iterator it = hooks.begin(); it != hooks.end(); it++)
{
map <string, string> hookmap = (*it)->get_hooks();
for (map <string, string>::const_iterator mapit = hookmap.begin() ; mapit != hookmap.end(); mapit++)
for (map <string, string>::const_iterator mapit = hookmap.begin(); mapit != hookmap.end(); mapit++)
output << "options_." << mapit->first << " = '" << mapit->second << "';" << endl;
}
}
......
......@@ -37,7 +37,11 @@ public:
private:
map<string, string> hooks;
public:
inline map<string, string>get_hooks() { return hooks; };
inline map<string, string>
get_hooks()
{
return hooks;
};
};
class Path
......@@ -48,7 +52,11 @@ public:
private:
map<string, vector<string> > paths;
public:
inline map<string, vector<string> >get_paths() { return paths; };
inline map<string, vector<string> >
get_paths()
{
return paths;
};
};
class SlaveNode
......
......@@ -109,7 +109,8 @@ private:
public:
DataTree(SymbolTable &symbol_table_arg, NumericalConstants &num_constants_arg, ExternalFunctionsTable &external_functions_table_arg);
virtual ~DataTree();
virtual
~DataTree();
//! Some predefined constants
expr_t Zero, One, Two, MinusOne, NaN, Infinity, MinusInfinity, Pi;
......
This diff is collapsed.
......@@ -547,14 +547,17 @@ public:
long unsigned int col_nbr;
unsigned int row_nbr;
expr_t value;
derivative(long unsigned int arg1, long unsigned int arg2, int arg3, expr_t arg4):
linear_address(arg1), col_nbr(arg2), row_nbr(arg3), value(arg4) {};
derivative(long unsigned int arg1, long unsigned int arg2, int arg3, expr_t arg4) :
linear_address(arg1), col_nbr(arg2), row_nbr(arg3), value(arg4)
{
};
};
class derivative_less_than
{
public:
bool operator()(const derivative & d1, const derivative & d2) const
bool
operator()(const derivative &d1, const derivative &d2) const
{
return d1.linear_address < d2.linear_address;
}
......
......@@ -124,8 +124,8 @@ main(int argc, char **argv)
clear_all = false;
else if (strlen(argv[arg]) >= 19 && !strncmp(argv[arg], "params_derivs_order", 19))
{
if (strlen(argv[arg]) >= 22 || argv[arg][19] != '=' ||
!(argv[arg][20] == '0' || argv[arg][20] == '1' || argv[arg][20] == '2'))
if (strlen(argv[arg]) >= 22 || argv[arg][19] != '='
|| !(argv[arg][20] == '0' || argv[arg][20] == '1' || argv[arg][20] == '2'))
{
cerr << "Incorrect syntax for params_derivs_order option" << endl;
usage();
......@@ -222,12 +222,12 @@ main(int argc, char **argv)
size_t equal_index = string(argv[arg]).find('=');
if (equal_index != string::npos)
{
string key = string(argv[arg]).erase(equal_index).erase(0,2);
string key = string(argv[arg]).erase(equal_index).erase(0, 2);
defines[key] = string(argv[arg]).erase(0, equal_index+1);
}
else
{
string key = string(argv[arg]).erase(0,2);
string key = string(argv[arg]).erase(0, 2);
defines[key] = "1";
}
}
......@@ -239,7 +239,7 @@ main(int argc, char **argv)
<< "must not be separated from -I by whitespace." << endl;
usage();
}
path.push_back(string(argv[arg]).erase(0,2));
path.push_back(string(argv[arg]).erase(0, 2));
}
else if (strlen(argv[arg]) >= 6 && !strncmp(argv[arg], "output", 6))
{
......
......@@ -100,7 +100,7 @@ ExprNode::collectVariables(SymbolType type, set<int> &result) const
set<pair<int, int> > symbs_lags;
collectDynamicVariables(type, symbs_lags);
transform(symbs_lags.begin(), symbs_lags.end(), inserter(result, result.begin()),
boost::bind(&pair<int,int>::first,_1));
boost::bind(&pair<int, int>::first, _1));
}
void
......@@ -535,7 +535,6 @@ NumConstNode::substituteStaticAuxiliaryVariable() const
return const_cast<NumConstNode *>(this);
}
VariableNode::VariableNode(DataTree &datatree_arg, int symb_id_arg, int lag_arg) :
ExprNode(datatree_arg),
symb_id(symb_id_arg),
......@@ -2521,7 +2520,7 @@ UnaryOpNode::substituteExoLag(subst_table_t &subst_table, vector<BinaryOpNode *>
expr_t
UnaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool partial_information_model) const
{
if (op_code==oExpectation)
if (op_code == oExpectation)
{
subst_table_t::iterator it = subst_table.find(const_cast<UnaryOpNode *>(this));
if (it != subst_table.end())
......@@ -3872,7 +3871,6 @@ BinaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOpN
return buildSimilarBinaryOpNode(arg1subst, arg2subst, datatree);
}
expr_t
BinaryOpNode::differentiateForwardVars(const vector<string> &subset, subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const
{
......@@ -4569,7 +4567,6 @@ TrinaryOpNode::substituteExpectation(subst_table_t &subst_table, vector<BinaryOp
return buildSimilarTrinaryOpNode(arg1subst, arg2subst, arg3subst, datatree);
}
expr_t
TrinaryOpNode::differentiateForwardVars(const vector<string> &subset, subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const
{
......
......@@ -123,8 +123,8 @@ enum ExprNodeOutputType
#define MIN_COST(is_matlab) ((is_matlab) ? MIN_COST_MATLAB : MIN_COST_C)
//! Base class for expression nodes
class ExprNode
{
class ExprNode
{
friend class DataTree;
friend class DynamicModel;
friend class StaticModel;
......@@ -137,12 +137,12 @@ class ExprNode
friend class TrinaryOpNode;
friend class AbstractExternalFunctionNode;
friend class VarExpectationNode;
private:
private:
//! Computes derivative w.r. to a derivation ID (but doesn't store it in derivatives map)
/*! You shoud use getDerivative() to get the benefit of symbolic a priori and of caching */
virtual expr_t computeDerivative(int deriv_id) = 0;
protected:
protected:
//! Reference to the enclosing DataTree
DataTree &datatree;
......@@ -173,9 +173,10 @@ protected:
set<pair<int, int> > exo_det;
};
public:
public:
ExprNode(DataTree &datatree_arg);
virtual ~ExprNode();
virtual
~ExprNode();
//! Initializes data member non_null_derivatives
virtual void prepareForDerivation() = 0;
......@@ -460,7 +461,7 @@ public:
//! Fills map
virtual void getEndosAndMaxLags(map<string, int> &model_endos_and_lags) const = 0;
};
};
//! Object used to compare two nodes (using their indexes)
struct ExprNodeLess
......@@ -564,7 +565,11 @@ public:
{
return symb_id;
};
int get_lag() const { return lag; };
int
get_lag() const
{
return lag;
};
virtual pair<int, expr_t> normalizeEquation(int symb_id_endo, vector<pair<int, pair<expr_t, expr_t> > > &List_of_Op_RHS) const;
virtual expr_t getChainRuleDerivative(int deriv_id, const map<int, expr_t> &recursive_variables);
virtual int maxEndoLead() const;
......
......@@ -257,15 +257,15 @@ ModFile::checkPass(bool nostrict)
exit(EXIT_FAILURE);
}
if (dynamic_model.staticOnlyEquationsNbr() > 0 &&
(mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present))
if (dynamic_model.staticOnlyEquationsNbr() > 0
&& (mod_file_struct.ramsey_model_present || mod_file_struct.discretionary_policy_present))
{
cerr << "ERROR: marking equations as [static] or [dynamic] is not possible with ramsey_model, ramsey_policy or discretionary_policy" << endl;
exit(EXIT_FAILURE);
}
if (stochastic_statement_present &&
(dynamic_model.isUnaryOpUsed(oSign)
if (stochastic_statement_present
&& (dynamic_model.isUnaryOpUsed(oSign)
|| dynamic_model.isUnaryOpUsed(oAbs)
|| dynamic_model.isBinaryOpUsed(oMax)
|| dynamic_model.isBinaryOpUsed(oMin)
......@@ -277,8 +277,8 @@ ModFile::checkPass(bool nostrict)
|| dynamic_model.isBinaryOpUsed(oDifferent)))
warnings << "WARNING: you are using a function (max, min, abs, sign) or an operator (<, >, <=, >=, ==, !=) which is unsuitable for a stochastic context; see the reference manual, section about \"Expressions\", for more details." << endl;
if (linear &&
(dynamic_model.isUnaryOpUsed(oSign)
if (linear
&& (dynamic_model.isUnaryOpUsed(oSign)
|| dynamic_model.isUnaryOpUsed(oAbs)
|| dynamic_model.isBinaryOpUsed(oMax)
|| dynamic_model.isBinaryOpUsed(oMin)
......@@ -302,7 +302,7 @@ ModFile::checkPass(bool nostrict)
{
cerr << "ERROR: some estimated parameters (";
for (set<int>::const_iterator it = parameters_intersect.begin();
it != parameters_intersect.end(); )
it != parameters_intersect.end();)
{
cerr << symbol_table.getName(*it);
if (++it != parameters_intersect.end())
......@@ -583,8 +583,8 @@ ModFile::computingPass(bool no_tmp_terms, FileOutputType output, int params_deri
else // No computing task requested, compute derivatives up to 2nd order by default
dynamic_model.computingPass(true, true, false, none, global_eval_context, no_tmp_terms, block, use_dll, byte_code);
if ((linear && !mod_file_struct.ramsey_model_present && !dynamic_model.checkHessianZero()) ||
(linear && mod_file_struct.ramsey_model_present && !orig_ramsey_dynamic_model.checkHessianZero()))
if ((linear && !mod_file_struct.ramsey_model_present && !dynamic_model.checkHessianZero())
|| (linear && mod_file_struct.ramsey_model_present && !orig_ramsey_dynamic_model.checkHessianZero()))
{
map<int, string> eqs;
if (mod_file_struct.ramsey_model_present)
......@@ -771,7 +771,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
}
#if defined(_WIN32) || defined(__CYGWIN32__)
#if (defined(_MSC_VER) && _MSC_VER < 1700)
# if (defined(_MSC_VER) && _MSC_VER < 1700)
// If using USE_DLL with MSVC 10.0 or earlier, check that the user didn't use a function not supported by the compiler (because MSVC <= 10.0 doesn't comply with C99 standard)
if (use_dll && msvc)
{
......@@ -791,7 +791,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
exit(EXIT_FAILURE);
}
}
#endif
# endif
#endif
// Compile the dynamic MEX file for use_dll option
......@@ -906,7 +906,6 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
<< "end" << endl;
}
if (!no_log)
mOutputFile << "diary off" << endl;
......@@ -937,7 +936,7 @@ ModFile::writeOutputFiles(const string &basename, bool clear_all, bool clear_glo
void
ModFile::writeExternalFiles(const string &basename, FileOutputType output, LanguageOutputType language) const
{
switch(language)
switch (language)
{
case c:
writeExternalFilesC(basename, output);
......@@ -965,7 +964,6 @@ ModFile::writeExternalFilesC(const string &basename, FileOutputType output) cons
if (!no_static)
static_model.writeStaticFile(basename, false, false, true, false);
// static_model.writeStaticCFile(basename, block, byte_code, use_dll);
// static_model.writeParamsDerivativesFileC(basename, cuda);
// static_model.writeAuxVarInitvalC(mOutputFile, oMatlabOutsideModel, cuda);
......
......@@ -41,7 +41,7 @@ using namespace std;
// for checksum computation
#ifndef PRIVATE_BUFFER_SIZE
#define PRIVATE_BUFFER_SIZE 1024
# define PRIVATE_BUFFER_SIZE 1024
#endif
//! The abstract representation of a "mod" file
......
......@@ -212,7 +212,7 @@ ModelTree::computeNonSingularNormalization(jacob_map_t &contemporaneous_jacobian
if (first_derivatives.find(make_pair(it->first.first, getDerivID(symbol_table.getID(eEndogenous, it->first.second), 0))) == first_derivatives.end())
first_derivatives[make_pair(it->first.first, getDerivID(symbol_table.getID(eEndogenous, it->first.second), 0))] = Zero;
}
catch(DataTree::UnknownDerivIDException &e)
catch (DataTree::UnknownDerivIDException &e)
{
cerr << "The variable " << symbol_table.getName(symbol_table.getID(eEndogenous, it->first.second))
<< " does not appear at the current period (i.e. with no lead and no lag); this case is not handled by the 'block' option of the 'model' block." << endl;
......@@ -1125,10 +1125,10 @@ ModelTree::computeTemporaryTerms(bool is_matlab)
temporary_terms_g2.clear();
temporary_terms_g3.clear();
map<NodeTreeReference, temporary_terms_t> temp_terms_map;
temp_terms_map[eResiduals]=temporary_terms_res;
temp_terms_map[eFirstDeriv]=temporary_terms_g1;
temp_terms_map[eSecondDeriv]=temporary_terms_g2;
temp_terms_map[eThirdDeriv]=temporary_terms_g3;
temp_terms_map[eResiduals] = temporary_terms_res;
temp_terms_map[eFirstDeriv] = temporary_terms_g1;
temp_terms_map[eSecondDeriv] = temporary_terms_g2;
temp_terms_map[eThirdDeriv] = temporary_terms_g3;
for (vector<BinaryOpNode *>::iterator it = equations.begin();
it != equations.end(); it++)
......@@ -1332,17 +1332,17 @@ ModelTree::compileTemporaryTerms(ostream &code_file, unsigned int &instruction_n
(*it)->compileExternalFunctionOutput(code_file, instruction_number, false, tt2, map_idx, dynamic, steady_dynamic, tef_terms);
}
FNUMEXPR_ fnumexpr(TemporaryTerm, (int) (map_idx.find((*it)->idx)->second));
FNUMEXPR_ fnumexpr(TemporaryTerm, (int)(map_idx.find((*it)->idx)->second));
fnumexpr.write(code_file, instruction_number);
(*it)->compile(code_file, instruction_number, false, tt2, map_idx, dynamic, steady_dynamic, tef_terms);
if (dynamic)
{
FSTPT_ fstpt((int) (map_idx.find((*it)->idx)->second));
FSTPT_ fstpt((int)(map_idx.find((*it)->idx)->second));
fstpt.write(code_file, instruction_number);
}
else
{
FSTPST_ fstpst((int) (map_idx.find((*it)->idx)->second));
FSTPST_ fstpst((int)(map_idx.find((*it)->idx)->second));
fstpst.write(code_file, instruction_number);
}
// Insert current node into tt2
......@@ -1577,7 +1577,7 @@ ModelTree::writeLatexModelFile(const string &basename, ExprNodeOutputType output
bool wrote_eq_tag = false;
if (write_equation_tags)
{
for (vector<pair<int,pair<string,string> > >::const_iterator iteqt = equation_tags.begin();
for (vector<pair<int, pair<string, string> > >::const_iterator iteqt = equation_tags.begin();
iteqt != equation_tags.end(); iteqt++)
if (iteqt->first == eq)
{
......@@ -1792,11 +1792,11 @@ ModelTree::computeParamsDerivativesTemporaryTerms()
map<expr_t, pair<int, NodeTreeReference > > reference_count;
params_derivs_temporary_terms.clear();
map<NodeTreeReference, temporary_terms_t> temp_terms_map;
temp_terms_map[eResidualsParamsDeriv]=params_derivs_temporary_terms_res;
temp_terms_map[eJacobianParamsDeriv]=params_derivs_temporary_terms_g1;
temp_terms_map[eResidualsParamsSecondDeriv]=params_derivs_temporary_terms_res2;
temp_terms_map[eJacobianParamsSecondDeriv]=params_derivs_temporary_terms_g12;
temp_terms_map[eHessianParamsDeriv]=params_derivs_temporary_terms_g2;
temp_terms_map[eResidualsParamsDeriv] = params_derivs_temporary_terms_res;
temp_terms_map[eJacobianParamsDeriv] = params_derivs_temporary_terms_g1;
temp_terms_map[eResidualsParamsSecondDeriv] = params_derivs_temporary_terms_res2;
temp_terms_map[eJacobianParamsSecondDeriv] = params_derivs_temporary_terms_g12;
temp_terms_map[eHessianParamsDeriv] = params_derivs_temporary_terms_g2;
for (first_derivatives_t::iterator it = residuals_params_derivatives.begin();
it != residuals_params_derivatives.end(); it++)
......@@ -1839,9 +1839,9 @@ ModelTree::computeParamsDerivativesTemporaryTerms()
params_derivs_temporary_terms_g2 = temp_terms_map[eHessianParamsDeriv];
}
bool ModelTree::isNonstationary(int symb_id) const
bool
ModelTree::isNonstationary(int symb_id) const
{
return (nonstationary_symbols_map.find(symb_id)
!= nonstationary_symbols_map.end());
}
......@@ -128,7 +128,6 @@ protected:
*/
third_derivatives_t hessian_params_derivatives;
//! Temporary terms for the static/dynamic file (those which will be noted Txxxx)
temporary_terms_t temporary_terms;
temporary_terms_t temporary_terms_res;
......@@ -144,7 +143,6 @@ protected:
temporary_terms_t params_derivs_temporary_terms_g12;
temporary_terms_t params_derivs_temporary_terms_g2;
//! Trend variables and their growth factors
map<int, expr_t> trend_symbols_map;
......@@ -177,7 +175,7 @@ protected:
void computeTemporaryTerms(bool is_matlab);
//! Computes temporary terms for the file containing parameters derivatives
void computeParamsDerivativesTemporaryTerms();
//! Writes temporary terms
//! Writes temporary terms
void writeTemporaryTerms(const temporary_terms_t &tt, const temporary_terms_t &ttm1, ostream &output, ExprNodeOutputType output_type, deriv_node_temp_terms_t &tef_terms) const;
//! Compiles temporary terms
void compileTemporaryTerms(ostream &code_file, unsigned int &instruction_number, const temporary_terms_t &tt, map_idx_t map_idx, bool dynamic, bool steady_dynamic) const;
......@@ -268,7 +266,8 @@ protected:
virtual unsigned int getBlockMaxLag(int block_number) const = 0;
//! Return the maximum lead in a block
virtual unsigned int getBlockMaxLead(int block_number) const = 0;
inline void setBlockLeadLag(int block, int max_lag, int max_lead)
inline void
setBlockLeadLag(int block, int max_lag, int max_lead)
{
block_lag_lead[block] = make_pair(max_lag, max_lead);
};
......
......@@ -202,8 +202,8 @@ ParsingDriver::declare_var_endogenous(string *name)
{
SymbolType type = mod_file->symbol_table.getType(*name);
if (type != eEndogenous && type != eExogenous && type != eExogenousDet)
error("Symbol " + *name + " used in a VAR must be either endogenous or " +
"exogenous if it is also used elsewhere in the .mod file");
error("Symbol " + *name + " used in a VAR must be either endogenous or "
+"exogenous if it is also used elsewhere in the .mod file");
add_in_symbol_list(name);
return;
}
......@@ -276,8 +276,8 @@ void
ParsingDriver::declare_statement_local_variable(string *name)
{
if (mod_file->symbol_table.exists(*name))
error("Symbol " + *name + " cannot be assigned within a statement " +
"while being assigned elsewhere in the modfile");
error("Symbol " + *name + " cannot be assigned within a statement "
+"while being assigned elsewhere in the modfile");
declare_symbol(name, eStatementDeclaredVariable, NULL, NULL);
delete name;
}
......@@ -383,7 +383,7 @@ ParsingDriver::add_model_variable(string *name)
{
// This could be endog or param too. Just declare something to continue parsing,
// knowing that processing will end at the end of parsing of the model block
declare_exogenous(new string (*name));
declare_exogenous(new string(*name));
undeclared_model_vars.insert(*name);
symb_id = mod_file->symbol_table.getID(*name);
}
......@@ -558,7 +558,7 @@ ParsingDriver::add_VAR_restriction_equation_or_crossequation(string *numberstr)
double number = atof(numberstr->c_str());
if (var_restriction_eq_or_crosseq.size() == 1)
var_restriction_equation_or_crossequation = make_pair(make_pair(var_restriction_eq_or_crosseq[0],
make_pair(make_pair(-1, make_pair(-1, -1)), (expr_t)NULL)),
make_pair(make_pair(-1, make_pair(-1, -1)), (expr_t) NULL)),
number);
else
var_restriction_equation_or_crossequation = make_pair(make_pair(var_restriction_eq_or_crosseq[0],
......@@ -1379,7 +1379,7 @@ ParsingDriver::option_symbol_list(const string &name_option)
!= options_list.symbol_list_options.end())
error("option " + name_option + " declared twice");
if (name_option.compare("irf_shocks")==0)
if (name_option.compare("irf_shocks") == 0)
{
vector<string> shocks = symbol_list.get_symbols();
for (vector<string>::const_iterator it = shocks.begin();
......@@ -1388,7 +1388,7 @@ ParsingDriver::option_symbol_list(const string &name_option)
error("Variables passed to irf_shocks must be exogenous. Caused by: " + *it);
}
if (name_option.compare("ms.parameters")==0)
if (name_option.compare("ms.parameters") == 0)
{
vector<string> parameters = symbol_list.get_symbols();
for (vector<string>::const_iterator it = parameters.begin();
......@@ -1594,7 +1594,7 @@ ParsingDriver::copy_subsamples(string *to_name1, string *to_name2, string *from_
if (!from_name2->empty())
check_symbol_existence(*from_name2);
if (subsample_declarations.find(make_pair(*from_name1,*from_name2)) == subsample_declarations.end())
if (subsample_declarations.find(make_pair(*from_name1, *from_name2)) == subsample_declarations.end())
{
string err = *from_name1;
if (!from_name2->empty())
......@@ -1605,8 +1605,8 @@ ParsingDriver::copy_subsamples(string *to_name1, string *to_name2, string *from_
mod_file->addStatement(new SubsamplesEqualStatement(*to_name1, *to_name2, *from_name1, *from_name2,
mod_file->symbol_table));
subsample_declarations[make_pair(*to_name1, *to_name2)] =
subsample_declarations[make_pair(*from_name1, *from_name2)];
subsample_declarations[make_pair(*to_name1, *to_name2)]
= subsample_declarations[make_pair(*from_name1, *from_name2)];
delete to_name1;
delete to_name2;
......@@ -1640,7 +1640,7 @@ ParsingDriver::check_subsample_declaration_exists(string *name1, string *subsamp
if (subsample_name->empty())
return;