Commit e2d5a835 authored by Sébastien Villemot's avatar Sébastien Villemot

Global reindentation

parent 42106f85
Pipeline #2736 passed with stages
in 2 minutes and 24 seconds
This diff is collapsed.
......@@ -501,7 +501,7 @@ VarRestrictionsStatement::writeOutput(ostream &output, const string &basename, b
output << "struct('eq', " << findIdxInVector(vars, symbol_table.getName(it1->first)) + 1
<< ", 'vars', [";
vector<string> excvars = it1->second.getSymbols();
for (auto & excvar : excvars)
for (auto &excvar : excvars)
output << findIdxInVector(vars, excvar) + 1 << " ";
output << "])";
nrestrictions += it1->second.getSize();
......@@ -775,7 +775,7 @@ DetCondForecast::writeOutput(ostream &output, const string &basename, bool minim
}
vector<string> symbols = symbol_list.get_symbols();
if (symbols.size() > 0)
output << symbols[1] << " = det_cond_forecast(" ;
output << symbols[1] << " = det_cond_forecast(";
for (unsigned int i = 0; i < symbols.size() - 1; i++)
output << symbols[i] << ", ";
if (symbols.size() > 0)
......@@ -1004,7 +1004,7 @@ RamseyPolicyStatement::writeOutput(ostream &output, const string &basename, bool
// Ensure that order 3 implies k_order (#844)
if (auto it = options_list.num_options.find("order"),
it1 = options_list.num_options.find("k_order_solver");
(it1 != options_list.num_options.end() && it1->second == "true")
(it1 != options_list.num_options.end() && it1->second == "true")
|| (it != options_list.num_options.end() && stoi(it->second) >= 3))
output << "options_.k_order_solver = true;" << endl;
......@@ -1404,7 +1404,7 @@ EstimatedParamsStatement::EstimatedParamsStatement(vector<EstimationParams> esti
void
EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings)
{
for (const auto & it : estim_params_list)
for (const auto &it : estim_params_list)
{
if (it.name == "dsge_prior_weight")
mod_file_struct.dsge_prior_weight_in_estimated_params = true;
......@@ -1429,7 +1429,7 @@ EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
// Check that no parameter/endogenous is declared twice in the block
set<string> already_declared;
set<pair<string, string>> already_declared_corr;
for (const auto & it : estim_params_list)
for (const auto &it : estim_params_list)
{
if (it.type == 3) // Correlation
{
......@@ -1457,7 +1457,7 @@ EstimatedParamsStatement::checkPass(ModFileStructure &mod_file_struct, WarningCo
}
// Fill in mod_file_struct.estimated_parameters (related to #469)
for (const auto & it : estim_params_list)
for (const auto &it : estim_params_list)
if (it.type == 2 && it.name != "dsge_prior_weight")
mod_file_struct.estimated_parameters.insert(symbol_table.getID(it.name));
}
......@@ -1471,7 +1471,7 @@ EstimatedParamsStatement::writeOutput(ostream &output, const string &basename, b
<< "estim_params_.corrn = zeros(0, 11);" << endl
<< "estim_params_.param_vals = zeros(0, 10);" << endl;
for (const auto & it : estim_params_list)
for (const auto &it : estim_params_list)
{
int symb_id = symbol_table.getTypeSpecificID(it.name) + 1;
SymbolType symb_type = symbol_table.getType(it.name);
......@@ -1590,7 +1590,7 @@ EstimatedParamsInitStatement::writeOutput(ostream &output, const string &basenam
bool skipline = false;
for (const auto & it : estim_params_list)
for (const auto &it : estim_params_list)
{
int symb_id = symbol_table.getTypeSpecificID(it.name) + 1;
SymbolType symb_type = symbol_table.getType(it.name);
......@@ -1715,7 +1715,7 @@ EstimatedParamsBoundsStatement::EstimatedParamsBoundsStatement(vector<Estimation
void
EstimatedParamsBoundsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
{
for (const auto & it : estim_params_list)
for (const auto &it : estim_params_list)
{
int symb_id = symbol_table.getTypeSpecificID(it.name) + 1;
SymbolType symb_type = symbol_table.getType(it.name);
......@@ -1835,7 +1835,7 @@ void
ObservationTrendsStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
{
output << "options_.trend_coeff = {};" << endl;
for (const auto & trend_element : trend_elements)
for (const auto &trend_element : trend_elements)
{
SymbolType type = symbol_table.getType(trend_element.first);
if (type == SymbolType::endogenous)
......@@ -1856,7 +1856,7 @@ ObservationTrendsStatement::writeJsonOutput(ostream &output) const
output << R"({"statementName": "observation_trends", )"
<< R"("trends" : {)";
bool printed = false;
for (const auto & trend_element : trend_elements)
for (const auto &trend_element : trend_elements)
{
if (symbol_table.getType(trend_element.first) == SymbolType::endogenous)
{
......@@ -1896,7 +1896,7 @@ OsrParamsStatement::writeOutput(ostream &output, const string &basename, bool mi
<< "M_.osr.param_indices = zeros(length(M_.osr.param_names), 1);" << endl;
int i = 0;
vector<string> symbols = symbol_list.get_symbols();
for (auto & symbol : symbols)
for (auto &symbol : symbols)
output << "M_.osr.param_indices(" << ++i <<") = " << symbol_table.getTypeSpecificID(symbol) + 1 << ";" << endl;
}
......@@ -1933,7 +1933,7 @@ OsrParamsBoundsStatement::writeOutput(ostream &output, const string &basename, b
output << "M_.osr.param_bounds = [-inf(length(M_.osr.param_names), 1), inf(length(M_.osr.param_names), 1)];" << endl;
for (const auto & it : osr_params_list)
for (const auto &it : osr_params_list)
{
output << "M_.osr.param_bounds(strcmp(M_.osr.param_names, '" << it.name << "'), :) = [";
it.low_bound->writeOutput(output);
......@@ -2207,7 +2207,7 @@ ModelComparisonStatement::writeOutput(ostream &output, const string &basename, b
output << "ModelNames_ = {};" << endl;
output << "ModelPriors_ = [];" << endl;
for (const auto & it : filename_list)
for (const auto &it : filename_list)
{
output << "ModelNames_ = { ModelNames_{:} '" << it.first << "'};" << endl;
output << "ModelPriors_ = [ ModelPriors_ ; " << it.second << "];" << endl;
......@@ -2243,7 +2243,7 @@ ModelComparisonStatement::writeJsonOutput(ostream &output) const
}
PlannerObjectiveStatement::PlannerObjectiveStatement(const StaticModel &model_tree_arg) :
model_tree {model_tree_arg}
model_tree{model_tree_arg}
{
}
......@@ -3145,7 +3145,7 @@ int
SvarIdentificationStatement::getMaxLag() const
{
int max_lag = 0;
for (const auto & restriction : restrictions)
for (const auto &restriction : restrictions)
if (restriction.lag > max_lag)
max_lag = restriction.lag;
......@@ -3282,12 +3282,12 @@ MarkovSwitchingStatement::MarkovSwitchingStatement(OptionsList options_list_arg)
{
using namespace boost;
auto it_num_regimes = options_list.num_options.find("ms.number_of_regimes");
assert(it_num_regimes != options_list.num_options.end());
assert(it_num_regimes != options_list.num_options.end());
auto num_regimes = stoi(it_num_regimes->second);
vector<string> tokenizedRestrictions;
split(tokenizedRestrictions, it_num->second, is_any_of("["), token_compress_on);
for (auto & tokenizedRestriction : tokenizedRestrictions)
for (auto &tokenizedRestriction : tokenizedRestrictions)
if (tokenizedRestriction.size() > 0)
{
vector<string> restriction;
......@@ -3859,13 +3859,13 @@ JointPriorStatement::checkPass(ModFileStructure &mod_file_struct, WarningConsoli
void
JointPriorStatement::writeOutput(ostream &output, const string &basename, bool minimal_workspace) const
{
for (const auto & joint_parameter : joint_parameters)
for (const auto &joint_parameter : joint_parameters)
output << "eifind = get_new_or_existing_ei_index('joint_parameter_prior_index', '"
<< joint_parameter << "', '');" << endl
<< "estimation_info.joint_parameter_prior_index(eifind) = {'" << joint_parameter << "'};" << endl;
output << "key = {[";
for (const auto & joint_parameter : joint_parameters)
for (const auto &joint_parameter : joint_parameters)
output << "get_new_or_existing_ei_index('joint_parameter_prior_index', '" << joint_parameter << "', '') ..."
<< endl << " ";
output << "]};" << endl;
......@@ -4734,7 +4734,7 @@ ExtendedPathStatement::writeOutput(ostream &output, const string &basename, bool
{
// Beware: options do not have the same name in the interface and in the M code...
for (const auto & num_option : options_list.num_options)
for (const auto &num_option : options_list.num_options)
if (num_option.first != "periods")
output << "options_." << num_option.first << " = " << num_option.second << ";" << endl;
......@@ -4902,7 +4902,7 @@ GenerateIRFsStatement::writeOutput(ostream &output, const string &basename, bool
return;
output << "options_.irf_opt.irf_shock_graphtitles = { ";
for (const auto & generate_irf_name : generate_irf_names)
for (const auto &generate_irf_name : generate_irf_names)
output << "'" << generate_irf_name << "'; ";
output << "};" << endl;
......@@ -4912,7 +4912,7 @@ GenerateIRFsStatement::writeOutput(ostream &output, const string &basename, bool
for (size_t i = 0; i < generate_irf_names.size(); i++)
{
map<string, double> m = generate_irf_elements[i];
for (auto & it : m)
for (auto &it : m)
output << "options_.irf_opt.irf_shocks(M_.exo_names == '"
<< it.first << "', " << i + 1 << ") = "
<< it.second << ";" << endl;
......
......@@ -95,7 +95,6 @@ public:
void writeJsonOutput(ostream &output) const override;
};
class DetCondForecast : public Statement
{
private:
......
......@@ -86,7 +86,7 @@ SlaveNode::SlaveNode(string computerName_arg, string port_arg, int minCpuNbr_arg
}
}
Cluster::Cluster(member_nodes_t member_nodes_arg) :
Cluster::Cluster(member_nodes_t member_nodes_arg) :
member_nodes{move(member_nodes_arg)}
{
if (member_nodes.empty())
......@@ -276,7 +276,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
{
vector<string> tokenizedPath;
split(tokenizedPath, tokenizedLine.back(), is_any_of(":"), token_compress_on);
for (auto & it : tokenizedPath)
for (auto &it : tokenizedPath)
if (!it.empty())
{
trim(it);
......@@ -377,7 +377,7 @@ ConfigFile::getConfigFileInfo(const string &config_file)
tokenizer<char_separator<char>> tokens(tokenizedLine.back(), sep);
bool begin_weight = false;
string node_name;
for (const auto & token : tokens)
for (const auto &token : tokens)
{
if (token.compare("(") == 0)
{
......@@ -497,9 +497,9 @@ ConfigFile::addParallelConfFileElement(bool inNode, bool inCluster, const member
}
else
slave_nodes.emplace(name, SlaveNode{computerName, port, minCpuNbr, maxCpuNbr, userName,
password, remoteDrive, remoteDirectory, dynarePath,
matlabOctavePath, singleCompThread, numberOfThreadsPerJob,
operatingSystem});
password, remoteDrive, remoteDirectory, dynarePath,
matlabOctavePath, singleCompThread, numberOfThreadsPerJob,
operatingSystem});
//! ADD CLUSTER
else if (inCluster)
if (minCpuNbr > 0 || maxCpuNbr > 0 || !userName.empty()
......@@ -527,9 +527,9 @@ void
ConfigFile::checkPass(WarningConsolidation &warnings) const
{
bool global_init_file_declared = false;
for (const auto & hook : hooks)
for (const auto &hook : hooks)
{
for (const auto & mapit : hook.get_hooks())
for (const auto &mapit : hook.get_hooks())
if (mapit.first.compare("global_init_file") == 0)
if (global_init_file_declared == true)
{
......@@ -550,7 +550,7 @@ ConfigFile::checkPass(WarningConsolidation &warnings) const
exit(EXIT_FAILURE);
}
for (const auto & slave_node : slave_nodes)
for (const auto &slave_node : slave_nodes)
{
#if !defined(_WIN32) && !defined(__CYGWIN32__)
//For Linux/Mac, check that cpuNbr starts at 0
......@@ -638,8 +638,8 @@ ConfigFile::checkPass(WarningConsolidation &warnings) const
exit(EXIT_FAILURE);
}
for (const auto & cluster : clusters)
for (const auto & itmn : cluster.second.member_nodes)
for (const auto &cluster : clusters)
for (const auto &itmn : cluster.second.member_nodes)
if (slave_nodes.find(itmn.first) == slave_nodes.end())
{
cerr << "Error: node " << itmn.first << " specified in cluster " << cluster.first << " was not found" << endl;
......@@ -655,7 +655,7 @@ ConfigFile::transformPass()
#if !defined(_WIN32) && !defined(__CYGWIN32__)
//For Linux/Mac, check that cpuNbr starts at 0
for (auto & it : slave_nodes)
for (auto &it : slave_nodes)
if (it.second.minCpuNbr != 0)
{
it.second.maxCpuNbr = it.second.maxCpuNbr - it.second.minCpuNbr;
......@@ -666,10 +666,10 @@ ConfigFile::transformPass()
auto cluster_it = cluster_name.empty() ? clusters.find(firstClusterName) : clusters.find(cluster_name);
double weight_denominator{0.0};
for (const auto & it : cluster_it->second.member_nodes)
for (const auto &it : cluster_it->second.member_nodes)
weight_denominator += it.second;
for (auto & member_node : cluster_it->second.member_nodes)
for (auto &member_node : cluster_it->second.member_nodes)
member_node.second /= weight_denominator;
}
......@@ -678,8 +678,8 @@ ConfigFile::getIncludePaths() const
{
vector<filesystem::path> include_paths;
for (auto path : paths)
for (const auto & mapit : path.get_paths())
for (const auto & vecit : mapit.second)
for (const auto &mapit : path.get_paths())
for (const auto &vecit : mapit.second)
include_paths.emplace_back(vecit);
return include_paths;
}
......@@ -688,7 +688,7 @@ void
ConfigFile::writeHooks(ostream &output) const
{
for (auto hook : hooks)
for (const auto & mapit : hook.get_hooks())
for (const auto &mapit : hook.get_hooks())
output << "options_." << mapit.first << " = '" << mapit.second << "';" << endl;
}
......@@ -701,10 +701,10 @@ ConfigFile::writeCluster(ostream &output) const
auto cluster_it = cluster_name.empty() ? clusters.find(firstClusterName) : clusters.find(cluster_name);
int i{1};
for (const auto & slave_node : slave_nodes)
for (const auto &slave_node : slave_nodes)
{
bool slave_node_in_member_nodes = false;
for (const auto & itmn : cluster_it->second.member_nodes)
for (const auto &itmn : cluster_it->second.member_nodes)
if (!slave_node.first.compare(itmn.first))
slave_node_in_member_nodes = true;
......
......@@ -50,27 +50,27 @@ DataTree::DataTree(SymbolTable &symbol_table_arg,
symbol_table{symbol_table_arg},
num_constants{num_constants_arg},
external_functions_table{external_functions_table_arg},
is_dynamic {is_dynamic_arg}
is_dynamic{is_dynamic_arg}
{
initConstants();
}
DataTree::DataTree(const DataTree &d) :
symbol_table {d.symbol_table},
num_constants {d.num_constants},
external_functions_table {d.external_functions_table},
is_dynamic {d.is_dynamic},
local_variables_vector {d.local_variables_vector}
symbol_table{d.symbol_table},
num_constants{d.num_constants},
external_functions_table{d.external_functions_table},
is_dynamic{d.is_dynamic},
local_variables_vector{d.local_variables_vector}
{
// Constants must be initialized first because they are used in some Add* methods
initConstants();
for (const auto & it : d.node_list)
for (const auto &it : d.node_list)
it->clone(*this);
assert(node_list.size() == d.node_list.size());
for (const auto & it : d.local_variables_table)
for (const auto &it : d.local_variables_table)
local_variables_table[it.first] = it.second->clone(*this);
}
......@@ -98,14 +98,14 @@ DataTree::operator=(const DataTree &d)
// Constants must be initialized first because they are used in some Add* methods
initConstants();
for (const auto & it : d.node_list)
for (const auto &it : d.node_list)
it->clone(*this);
assert(node_list.size() == d.node_list.size());
local_variables_vector = d.local_variables_vector;
for (const auto & it : d.local_variables_table)
for (const auto &it : d.local_variables_table)
local_variables_table[it.first] = it.second->clone(*this);
return *this;
......@@ -162,7 +162,7 @@ DataTree::getVariable(int symb_id, int lag) const
bool
DataTree::ParamUsedWithLeadLagInternal() const
{
for (const auto & it : variable_node_map)
for (const auto &it : variable_node_map)
if (symbol_table.getType(it.first.first) == SymbolType::parameter && it.first.second != 0)
return true;
return false;
......@@ -759,7 +759,7 @@ DataTree::AddSecondDerivExternalFunction(int top_level_symb_id, const vector<exp
bool
DataTree::isSymbolUsed(int symb_id) const
{
for (const auto & it : variable_node_map)
for (const auto &it : variable_node_map)
if (it.first.first == symb_id)
return true;
......@@ -807,7 +807,7 @@ DataTree::getDynJacobianCol(int deriv_id) const noexcept(false)
bool
DataTree::isUnaryOpUsed(UnaryOpcode opcode) const
{
for (const auto & it : unary_op_node_map)
for (const auto &it : unary_op_node_map)
if (get<1>(it.first) == opcode)
return true;
......@@ -818,7 +818,7 @@ bool
DataTree::isUnaryOpUsedOnType(SymbolType type, UnaryOpcode opcode) const
{
set<int> var;
for (const auto & it : unary_op_node_map)
for (const auto &it : unary_op_node_map)
if (get<1>(it.first) == opcode)
{
it.second->collectVariables(type, var);
......@@ -831,7 +831,7 @@ DataTree::isUnaryOpUsedOnType(SymbolType type, UnaryOpcode opcode) const
bool
DataTree::isBinaryOpUsed(BinaryOpcode opcode) const
{
for (const auto & it : binary_op_node_map)
for (const auto &it : binary_op_node_map)
if (get<2>(it.first) == opcode)
return true;
......@@ -842,7 +842,7 @@ bool
DataTree::isBinaryOpUsedOnType(SymbolType type, BinaryOpcode opcode) const
{
set<int> var;
for (const auto & it : binary_op_node_map)
for (const auto &it : binary_op_node_map)
if (get<2>(it.first) == opcode)
{
it.second->collectVariables(type, var);
......@@ -855,7 +855,7 @@ DataTree::isBinaryOpUsedOnType(SymbolType type, BinaryOpcode opcode) const
bool
DataTree::isTrinaryOpUsed(TrinaryOpcode opcode) const
{
for (const auto & it : trinary_op_node_map)
for (const auto &it : trinary_op_node_map)
if (get<3>(it.first) == opcode)
return true;
......@@ -865,7 +865,7 @@ DataTree::isTrinaryOpUsed(TrinaryOpcode opcode) const
bool
DataTree::isExternalFunctionUsed(int symb_id) const
{
for (const auto & it : external_function_node_map)
for (const auto &it : external_function_node_map)
if (it.first.second == symb_id)
return true;
......@@ -875,7 +875,7 @@ DataTree::isExternalFunctionUsed(int symb_id) const
bool
DataTree::isFirstDerivExternalFunctionUsed(int symb_id) const
{
for (const auto & it : first_deriv_external_function_node_map)
for (const auto &it : first_deriv_external_function_node_map)
if (get<2>(it.first) == symb_id)
return true;
......@@ -885,7 +885,7 @@ DataTree::isFirstDerivExternalFunctionUsed(int symb_id) const
bool
DataTree::isSecondDerivExternalFunctionUsed(int symb_id) const
{
for (const auto & it : second_deriv_external_function_node_map)
for (const auto &it : second_deriv_external_function_node_map)
if (get<3>(it.first) == symb_id)
return true;
......@@ -896,7 +896,7 @@ int
DataTree::minLagForSymbol(int symb_id) const
{
int r = 0;
for (const auto & it : variable_node_map)
for (const auto &it : variable_node_map)
if (it.first.first == symb_id && it.first.second < r)
r = it.first.second;
return r;
......
......@@ -128,8 +128,8 @@ public:
DataTree(const DataTree &d);
DataTree(DataTree &&) = delete;
DataTree & operator=(const DataTree &d);
DataTree & operator=(DataTree &&) = delete;
DataTree &operator=(const DataTree &d);
DataTree &operator=(DataTree &&) = delete;
//! Some predefined constants
expr_t Zero, One, Two, Three, MinusOne, NaN, Infinity, MinusInfinity, Pi;
......@@ -155,7 +155,7 @@ public:
VariableNode *AddVariable(int symb_id, int lag = 0);
//! Gets a variable
/*! Same as AddVariable, except that it fails if the variable node has not
already been created */
already been created */
VariableNode *getVariable(int symb_id, int lag = 0) const;
//! Adds "arg1+arg2" to model tree
expr_t AddPlus(expr_t iArg1, expr_t iArg2);
......@@ -324,7 +324,8 @@ public:
}
};
expr_t getLocalVariable(int symb_id) const
expr_t
getLocalVariable(int symb_id) const
{
auto it = local_variables_table.find(symb_id);
if (it == local_variables_table.end())
......
This diff is collapsed.
......@@ -288,10 +288,11 @@ private:
X
Y
*/
void parseIncludeExcludeEquations(const string &inc_exc_eq_tags, set<pair<string, string>> & eq_tag_set, bool exclude_eqs);
void parseIncludeExcludeEquations(const string &inc_exc_eq_tags, set<pair<string, string>> &eq_tag_set, bool exclude_eqs);
// General function that removes leading/trailing whitespace from a string
inline void removeLeadingTrailingWhitespace(string & str)
inline void
removeLeadingTrailingWhitespace(string &str)
{
str.erase(0, str.find_first_not_of("\t\n\v\f\r "));
str.erase(str.find_last_not_of("\t\n\v\f\r ") + 1);
......@@ -306,8 +307,8 @@ public:
DynamicModel(const DynamicModel &m);
DynamicModel(DynamicModel &&) = delete;
DynamicModel & operator=(const DynamicModel &m);
DynamicModel & operator=(DynamicModel &&) = delete;
DynamicModel &operator=(const DynamicModel &m);
DynamicModel &operator=(DynamicModel &&) = delete;
//! Compute cross references
void computeXrefs();
......@@ -358,13 +359,15 @@ public:
//! Tells whether Hessian has been computed
/*! This is needed to know whether no non-zero equation in Hessian means a
zero Hessian or Hessian not computed */
inline bool isHessianComputed() const
zero Hessian or Hessian not computed */
inline bool
isHessianComputed() const
{
return hessian_computed;
}
//! Returns equations that have non-zero second derivatives
inline set<int> getNonZeroHessianEquations() const
inline set<int>
getNonZeroHessianEquations() const
{
return nonzero_hessian_eqs;
}
......@@ -406,7 +409,7 @@ public:
expr_t growth);
//! Substitutes pac_expectation operator with expectation based on auxiliary model
void substitutePacExpectation(const string & pac_model_name);
void substitutePacExpectation(const string &pac_model_name);
//! Adds informations for simulation in a binary file
void Write_Inf_To_Bin_File_Block(const string &basename,
......@@ -439,7 +442,7 @@ public:
void setLeadsLagsOrig();
//! Removes equations from the model according to name tags
void includeExcludeEquations(const string & eqs, bool exclude_eqs);
void includeExcludeEquations(const string &eqs, bool exclude_eqs);
//! Replaces model equations with derivatives of Lagrangian w.r.t. endogenous
void computeRamseyPolicyFOCs(const StaticModel &static_model);
......@@ -498,12 +501,14 @@ public:
//! Transforms the model by removing trends specified by the user
void detrendEquations();
inline const nonstationary_symbols_map_t & getNonstationarySymbolsMap() const
inline const nonstationary_symbols_map_t &
getNonstationarySymbolsMap() const
{
return nonstationary_symbols_map;
}
inline const map<int, expr_t> & getTrendSymbolsMap() const
inline const map<int, expr_t> &
getTrendSymbolsMap() const
{
return trend_symbols_map;
}
......@@ -536,7 +541,7 @@ public:
void declarePacModelConsistentExpectationEndogs(const string &name);
//! Add model consistent expectation equation for pac model
void addPacModelConsistentExpectationEquation(const string & name, int discount,
void addPacModelConsistentExpectationEquation(const string &name, int discount,
const map<pair<string, string>, pair<string, int>> &eqtag_and_lag,
ExprNode::subst_table_t &diff_subst_table);
......@@ -581,7 +586,11 @@ public:
//! Fills eval context with values of model local variables and auxiliary variables
void fillEvalContext(eval_context_t &eval_context) const;
auto getStaticOnlyEquationsInfo() const { return tuple(static_only_equations, static_only_equations_lineno, static_only_equations_equation_tags); };
auto
getStaticOnlyEquationsInfo() const
{
return tuple(static_only_equations, static_only_equations_lineno, static_only_equations_equation_tags);
};
//! Return the number of blocks
unsigned int
......
......@@ -44,7 +44,7 @@ main1(const string &filename, const string &basename, istream &modfile, bool deb
exit(EXIT_FAILURE);
}
string str (macro_output.str());
string str(macro_output.str());
if (no_empty_line_macro)
{
auto compareNewline = [](char i, char j) { return i == '\n' && j == '\n'; };
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,31 +22,31 @@
enum class FileOutputType
{
none, // outputs files for Matlab/Octave processing
dynamic, // outputs <fname>_dynamic.* and related files
first, // outputs <fname>_first_derivatives.* and related files
second, // outputs <fname>_first_derivatives.*, <fname>_second_derivatives.* and related files
third, // outputs <fname>_first_derivatives.*, <fname>_second_derivatives.*, <fname>_third_derivatives.* and related files
none, // outputs files for Matlab/Octave processing
dynamic, // outputs <fname>_dynamic.* and related files
first, // outputs <fname>_first_derivatives.* and related files
second, // outputs <fname>_first_derivatives.*, <fname>_second_derivatives.* and related files
third, // outputs <fname>_first_derivatives.*, <fname>_second_derivatives.*, <fname>_third_derivatives.* and related files
};
enum class LanguageOutputType
{
matlab, // outputs files for Matlab/Octave processing
julia, // outputs files for Julia
matlab, // outputs files for Matlab/Octave processing
julia, // outputs files for Julia
};
enum class JsonFileOutputType
{
file, // output JSON files to file
standardout, // output JSON files to stdout
file, // output JSON files to file
standardout, // output JSON files to stdout
};
enum class JsonOutputPointType
{
nojson, // don't output JSON
parsing, // output JSON after the parsing step
checkpass, // output JSON after the check pass
transformpass, // output JSON after the transform pass
computingpass // output JSON after the computing pass
nojson, // don't output JSON
parsing, // output JSON after the parsing step
checkpass, // output JSON after the check pass
transformpass, // output JSON after the transform pass
computingpass // output JSON after the computing pass
};
#endif
......@@ -33,7 +33,7 @@ ExternalFunctionsTable::addExternalFunction(int symb_id, const external_function
// Change options to be saved so the table is consistent
external_function_options external_function_options_chng = external_function_options_arg;
if (external_function_options_arg.firstDerivSymbID == IDSetButNoNameProvided)
if (external_function_options_arg.firstDerivSymbID == IDSetButNoNameProvided)
external_function_options_chng.firstDerivSymbID = symb_id;
if (external_function_options_arg.secondDerivSymbID == IDSetButNoNameProvided)
......@@ -44,7 +44,7 @@ ExternalFunctionsTable::addExternalFunction(int symb_id, const external_function
// Ensure 1st & 2nd deriv option consistency
if (external_function_options_chng.secondDerivSymbID == symb_id
&& external_function_options_chng.firstDerivSymbID != symb_id)
&& external_function_options_chng.firstDerivSymbID != symb_id)
{
cerr << "ERROR: If the second derivative is provided by the top-level function "
<< "the first derivative must also be provided by the same function." << endl;
......@@ -52,7 +52,7 @@ ExternalFunctionsTable::addExternalFunction(int symb_id, const external_function
}
if ((external_function_options_chng.secondDerivSymbID != symb_id
&& external_function_options_chng.firstDerivSymbID == symb_id)
&& external_function_options_chng.firstDerivSymbID == symb_id)
&& external_function_options_chng.secondDerivSymbID != IDNotSet)
{
cerr << "ERROR: If the first derivative is provided by the top-level function, the "
......@@ -84,7 +84,7 @@ ExternalFunctionsTable::addExternalFunction(int symb_id, const external_function
ok_to_overwrite = true;
if (!ok_to_overwrite) // prevents multiple non-compatible calls to external_function(name=funcname)
{ // e.g. e_f(name=a,nargs=1,fd,sd) and e_f(name=a,nargs=2,fd=b,sd=c) should cause an error
{ // e.g. e_f(name=a,nargs=1,fd,sd) and e_f(name=a,nargs=2,fd=b,sd=c) should cause an error
if (external_function_options_chng.nargs != getNargs(symb_id))
{
cerr << "ERROR: The number of arguments passed to the external_function() statement do not "
......
......@@ -101,7 +101,7 @@ namespace MFS
void
Print(AdjacencyList_t &G)
{
AdjacencyList_t::vertex_iterator it, it_end;
AdjacencyList_t::vertex_iterator it, it_end;
auto v_index = get(vertex_index, G);
cout << "Graph\n"
<< "-----\n";
......@@ -193,7 +193,7 @@ namespace MFS
tie(it_out, out_end) = out_edges(vertex, G);
while (it_in != in_end && it_out != out_end && agree)
{
agree = (source(*it_in, G) == target(*it_out, G) && source(*it_in, G) != target(*it_in, G)); //not a loop
agree = (source(*it_in, G) == target(*it_out, G) && source(*it_in, G) != target(*it_in, G)); //not a loop
liste.push_back(source(*it_in, G));
++it_in;
++it_out;
......
......@@ -46,7 +46,7 @@ ModFile::ModFile(WarningConsolidation &warnings_arg)