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

Port towards C++11 override

Performed using modernize-use-override from clang-tidy.

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-override.html
parent 1e56c733
This diff is collapsed.
......@@ -147,11 +147,11 @@ private:
void compileChainRuleDerivative(ofstream &code_file, unsigned int &instruction_number, int eq, int var, int lag, const map_idx_t &map_idx) const;
//! Get the type corresponding to a derivation ID
virtual SymbolType getTypeByDerivID(int deriv_id) const noexcept(false);
SymbolType getTypeByDerivID(int deriv_id) const noexcept(false) override;
//! Get the lag corresponding to a derivation ID
virtual int getLagByDerivID(int deriv_id) const noexcept(false);
int getLagByDerivID(int deriv_id) const noexcept(false) override;
//! Get the symbol ID corresponding to a derivation ID
virtual int getSymbIDByDerivID(int deriv_id) const noexcept(false);
int getSymbIDByDerivID(int deriv_id) const noexcept(false) override;
//! Compute the column indices of the dynamic Jacobian
void computeDynJacobianCols(bool jacobianExo);
//! Computes derivatives of the Jacobian w.r. to trend vars and tests that they are equal to zero
......@@ -249,7 +249,7 @@ public:
DynamicModel(SymbolTable &symbol_table_arg, NumericalConstants &num_constants_arg, ExternalFunctionsTable &external_functions_table_argx);
//! Adds a variable node
/*! This implementation allows for non-zero lag */
virtual VariableNode *AddVariable(int symb_id, int lag = 0);
VariableNode *AddVariable(int symb_id, int lag = 0) override;
//! Compute cross references
void computeXrefs();
......@@ -379,13 +379,13 @@ public:
//! Writes LaTeX file with the equations of the dynamic model (for the original model)
void writeLatexOriginalFile(const string &basename, const bool write_equation_tags) const;
virtual int getDerivID(int symb_id, int lag) const noexcept(false);
virtual int getDynJacobianCol(int deriv_id) const noexcept(false);
virtual void addAllParamDerivId(set<int> &deriv_id_set);
int getDerivID(int symb_id, int lag) const noexcept(false) override;
int getDynJacobianCol(int deriv_id) const noexcept(false) override;
void addAllParamDerivId(set<int> &deriv_id_set) override;
//! Returns true indicating that this is a dynamic model
virtual bool
isDynamic() const
bool
isDynamic() const override
{
return true;
};
......@@ -450,111 +450,111 @@ public:
void fillEvalContext(eval_context_t &eval_context) const;
//! Return the number of blocks
virtual unsigned int
getNbBlocks() const
unsigned int
getNbBlocks() const override
{
return (block_type_firstequation_size_mfs.size());
};
//! Determine the simulation type of each block
virtual BlockSimulationType
getBlockSimulationType(int block_number) const
BlockSimulationType
getBlockSimulationType(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].first.first);
};
//! Return the first equation number of a block
virtual unsigned int
getBlockFirstEquation(int block_number) const
unsigned int
getBlockFirstEquation(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].first.second);
};
//! Return the size of the block block_number
virtual unsigned int
getBlockSize(int block_number) const
unsigned int
getBlockSize(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].second.first);
};
//! Return the number of exogenous variable in the block block_number
virtual unsigned int
getBlockExoSize(int block_number) const
unsigned int
getBlockExoSize(int block_number) const override
{
return (block_var_exo[block_number].first.size());
};
//! Return the number of colums in the jacobian matrix for exogenous variable in the block block_number
virtual unsigned int
getBlockExoColSize(int block_number) const
unsigned int
getBlockExoColSize(int block_number) const override
{
return (block_var_exo[block_number].second);
};
//! Return the number of feedback variable of the block block_number
virtual unsigned int
getBlockMfs(int block_number) const
unsigned int
getBlockMfs(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].second.second);
};
//! Return the maximum lag in a block
virtual unsigned int
getBlockMaxLag(int block_number) const
unsigned int
getBlockMaxLag(int block_number) const override
{
return (block_lag_lead[block_number].first);
};
//! Return the maximum lead in a block
virtual unsigned int
getBlockMaxLead(int block_number) const
unsigned int
getBlockMaxLead(int block_number) const override
{
return (block_lag_lead[block_number].second);
};
//! Return the type of equation (equation_number) belonging to the block block_number
virtual EquationType
getBlockEquationType(int block_number, int equation_number) const
EquationType
getBlockEquationType(int block_number, int equation_number) const override
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first);
};
//! Return true if the equation has been normalized
virtual bool
isBlockEquationRenormalized(int block_number, int equation_number) const
bool
isBlockEquationRenormalized(int block_number, int equation_number) const override
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first == E_EVALUATE_S);
};
//! Return the expr_t of the equation equation_number belonging to the block block_number
virtual expr_t
getBlockEquationExpr(int block_number, int equation_number) const
expr_t
getBlockEquationExpr(int block_number, int equation_number) const override
{
return (equations[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]]);
};
//! Return the expr_t of the renormalized equation equation_number belonging to the block block_number
virtual expr_t
getBlockEquationRenormalizedExpr(int block_number, int equation_number) const
expr_t
getBlockEquationRenormalizedExpr(int block_number, int equation_number) const override
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].second);
};
//! Return the original number of equation equation_number belonging to the block block_number
virtual int
getBlockEquationID(int block_number, int equation_number) const
int
getBlockEquationID(int block_number, int equation_number) const override
{
return (equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]);
};
//! Return the original number of variable variable_number belonging to the block block_number
virtual int
getBlockVariableID(int block_number, int variable_number) const
int
getBlockVariableID(int block_number, int variable_number) const override
{
return (variable_reordered[block_type_firstequation_size_mfs[block_number].first.second+variable_number]);
};
//! Return the original number of the exogenous variable varexo_number belonging to the block block_number
virtual int
getBlockVariableExoID(int block_number, int variable_number) const
int
getBlockVariableExoID(int block_number, int variable_number) const override
{
auto it = exo_block[block_number].find(variable_number);
return (it->first);
};
//! Return the position of equation_number in the block number belonging to the block block_number
virtual int
getBlockInitialEquationID(int block_number, int equation_number) const
int
getBlockInitialEquationID(int block_number, int equation_number) const override
{
return ((int) inv_equation_reordered[equation_number] - (int) block_type_firstequation_size_mfs[block_number].first.second);
};
//! Return the position of variable_number in the block number belonging to the block block_number
virtual int
getBlockInitialVariableID(int block_number, int variable_number) const
int
getBlockInitialVariableID(int block_number, int variable_number) const override
{
return ((int) inv_variable_reordered[variable_number] - (int) block_type_firstequation_size_mfs[block_number].first.second);
};
......@@ -565,8 +565,8 @@ public:
return (variable_block_lead_lag[variable_number].first);
};
//! Return the position of the exogenous variable_number in the block number belonging to the block block_number
virtual int
getBlockInitialExogenousID(int block_number, int variable_number) const
int
getBlockInitialExogenousID(int block_number, int variable_number) const override
{
auto it = block_exo_index.find(block_number);
if (it != block_exo_index.end())
......@@ -581,8 +581,8 @@ public:
return (-1);
};
//! Return the position of the deterministic exogenous variable_number in the block number belonging to the block block_number
virtual int
getBlockInitialDetExogenousID(int block_number, int variable_number) const
int
getBlockInitialDetExogenousID(int block_number, int variable_number) const override
{
auto it = block_det_exo_index.find(block_number);
if (it != block_det_exo_index.end())
......@@ -597,8 +597,8 @@ public:
return (-1);
};
//! Return the position of the other endogenous variable_number in the block number belonging to the block block_number
virtual int
getBlockInitialOtherEndogenousID(int block_number, int variable_number) const
int
getBlockInitialOtherEndogenousID(int block_number, int variable_number) const override
{
auto it = block_other_endo_index.find(block_number);
if (it != block_other_endo_index.end())
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -39,11 +39,11 @@ private:
public:
InitParamStatement(int symb_id_arg, const expr_t param_value_arg,
const SymbolTable &symbol_table_arg);
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJuliaOutput(ostream &output, const string &basename);
virtual void writeCOutput(ostream &output, const string &basename);
virtual void writeJsonOutput(ostream &output) const;
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJuliaOutput(ostream &output, const string &basename) override;
void writeCOutput(ostream &output, const string &basename) override;
void writeJsonOutput(ostream &output) const override;
//! Fill eval context with parameter value
void fillEvalContext(eval_context_t &eval_context) const;
};
......@@ -79,9 +79,9 @@ public:
InitValStatement(const init_values_t &init_values_arg,
const SymbolTable &symbol_table_arg,
const bool &all_values_required_arg);
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
//! Writes initializations for oo_.exo_simul and oo_.exo_det_simul
void writeOutputPostInit(ostream &output) const;
};
......@@ -93,9 +93,9 @@ public:
const SymbolTable &symbol_table_arg,
const bool &all_values_required_arg);
//! Workaround for trac ticket #35
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class HistValStatement : public Statement
......@@ -119,9 +119,9 @@ public:
const SymbolTable &symbol_table_arg,
const bool &all_values_required_arg);
//! Workaround for trac ticket #157
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class InitvalFileStatement : public Statement
......@@ -130,8 +130,8 @@ private:
const string filename;
public:
InitvalFileStatement(string filename_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class HistvalFileStatement : public Statement
......@@ -140,8 +140,8 @@ private:
const string filename;
public:
HistvalFileStatement(string filename_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class HomotopyStatement : public Statement
......@@ -156,8 +156,8 @@ private:
public:
HomotopyStatement(homotopy_values_t homotopy_values_arg,
const SymbolTable &symbol_table_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class SaveParamsAndSteadyStateStatement : public Statement
......@@ -166,8 +166,8 @@ private:
const string filename;
public:
SaveParamsAndSteadyStateStatement(string filename_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class LoadParamsAndSteadyStateStatement : public Statement
......@@ -181,10 +181,10 @@ public:
LoadParamsAndSteadyStateStatement(const string &filename,
const SymbolTable &symbol_table_arg,
WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
//! Fill eval context with parameters/variables values
void fillEvalContext(eval_context_t &eval_context) const;
virtual void writeJsonOutput(ostream &output) const;
void writeJsonOutput(ostream &output) const override;
};
#endif
......@@ -78,9 +78,9 @@ public:
covar_and_corr_shocks_t covar_shocks_arg,
covar_and_corr_shocks_t corr_shocks_arg,
const SymbolTable &symbol_table_arg);
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class MShocksStatement : public AbstractShocksStatement
......@@ -89,7 +89,7 @@ public:
MShocksStatement(bool overwrite_arg,
const det_shocks_t &det_shocks_arg,
const SymbolTable &symbol_table_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
};
class ConditionalForecastPathsStatement : public Statement
......@@ -101,8 +101,8 @@ private:
public:
ConditionalForecastPathsStatement(AbstractShocksStatement::det_shocks_t paths_arg,
const SymbolTable &symbol_table_arg);
virtual void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
void checkPass(ModFileStructure &mod_file_struct, WarningConsolidation &warnings) override;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
};
class MomentCalibration : public Statement
......@@ -121,8 +121,8 @@ private:
public:
MomentCalibration(constraints_t constraints_arg,
const SymbolTable &symbol_table_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class IrfCalibration : public Statement
......@@ -143,8 +143,8 @@ public:
IrfCalibration(constraints_t constraints_arg,
const SymbolTable &symbol_table_arg,
OptionsList options_list_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class ShockGroupsStatement : public Statement
......@@ -162,7 +162,7 @@ private:
string name;
public:
ShockGroupsStatement(group_t shock_groups_arg, string name_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
};
#endif
......@@ -57,7 +57,7 @@ private:
public:
SigmaeStatement(matrix_t matrix_arg) noexcept(false);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
};
#endif
......@@ -158,8 +158,8 @@ private:
const string native_statement;
public:
NativeStatement(string native_statement_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class VerbatimStatement : public Statement
......@@ -168,8 +168,8 @@ private:
const string verbatim_statement;
public:
VerbatimStatement(string verbatim_statement_arg);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
virtual void writeJsonOutput(ostream &output) const;
void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const override;
void writeJsonOutput(ostream &output) const override;
};
class OptionsList
......
......@@ -87,11 +87,11 @@ private:
void compileChainRuleDerivative(ofstream &code_file, unsigned int &instruction_number, int eq, int var, int lag, map_idx_t &map_idx, temporary_terms_t temporary_terms) const;
//! Get the type corresponding to a derivation ID
virtual SymbolType getTypeByDerivID(int deriv_id) const noexcept(false);
SymbolType getTypeByDerivID(int deriv_id) const noexcept(false) override;
//! Get the lag corresponding to a derivation ID
virtual int getLagByDerivID(int deriv_id) const noexcept(false);
int getLagByDerivID(int deriv_id) const noexcept(false) override;
//! Get the symbol ID corresponding to a derivation ID
virtual int getSymbIDByDerivID(int deriv_id) const noexcept(false);
int getSymbIDByDerivID(int deriv_id) const noexcept(false) override;
//! Compute the column indices of the static Jacobian
void computeStatJacobianCols();
//! return a map on the block jacobian
......@@ -208,132 +208,132 @@ public:
//! See #1264
bool exoPresentInEqs() const;
virtual int getDerivID(int symb_id, int lag) const noexcept(false);
virtual void addAllParamDerivId(set<int> &deriv_id_set);
int getDerivID(int symb_id, int lag) const noexcept(false) override;
void addAllParamDerivId(set<int> &deriv_id_set) override;
//! Return the number of blocks
virtual unsigned int
getNbBlocks() const
unsigned int
getNbBlocks() const override
{
return (block_type_firstequation_size_mfs.size());
};
//! Determine the simulation type of each block
virtual BlockSimulationType
getBlockSimulationType(int block_number) const
BlockSimulationType
getBlockSimulationType(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].first.first);
};
//! Return the first equation number of a block
virtual unsigned int
getBlockFirstEquation(int block_number) const
unsigned int
getBlockFirstEquation(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].first.second);
};
//! Return the size of the block block_number
virtual unsigned int
getBlockSize(int block_number) const
unsigned int
getBlockSize(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].second.first);
};
//! Return the number of exogenous variable in the block block_number
virtual unsigned int
getBlockExoSize(int block_number) const
unsigned int
getBlockExoSize(int block_number) const override
{
return 0;
};
//! Return the number of colums in the jacobian matrix for exogenous variable in the block block_number
virtual unsigned int
getBlockExoColSize(int block_number) const
unsigned int
getBlockExoColSize(int block_number) const override
{
return 0;
}
//! Return the number of feedback variable of the block block_number
virtual unsigned int
getBlockMfs(int block_number) const
unsigned int
getBlockMfs(int block_number) const override
{
return (block_type_firstequation_size_mfs[block_number].second.second);
};
//! Return the maximum lag in a block
virtual unsigned int
getBlockMaxLag(int block_number) const
unsigned int
getBlockMaxLag(int block_number) const override
{
return (block_lag_lead[block_number].first);
};
//! Return the maximum lead in a block
virtual unsigned int
getBlockMaxLead(int block_number) const
unsigned int
getBlockMaxLead(int block_number) const override
{
return (block_lag_lead[block_number].second);
};
//! Return the type of equation (equation_number) belonging to the block block_number
virtual EquationType
getBlockEquationType(int block_number, int equation_number) const
EquationType
getBlockEquationType(int block_number, int equation_number) const override
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first);
};
//! Return true if the equation has been normalized
virtual bool
isBlockEquationRenormalized(int block_number, int equation_number) const
bool
isBlockEquationRenormalized(int block_number, int equation_number) const override
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].first == E_EVALUATE_S);
};
//! Return the expr_t of the equation equation_number belonging to the block block_number
virtual expr_t
getBlockEquationExpr(int block_number, int equation_number) const
expr_t
getBlockEquationExpr(int block_number, int equation_number) const override
{
return (equations[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]]);
};
//! Return the expr_t of the renormalized equation equation_number belonging to the block block_number
virtual expr_t
getBlockEquationRenormalizedExpr(int block_number, int equation_number) const
expr_t
getBlockEquationRenormalizedExpr(int block_number, int equation_number) const override
{
return (equation_type_and_normalized_equation[equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]].second);
};
//! Return the original number of equation equation_number belonging to the block block_number
virtual int
getBlockEquationID(int block_number, int equation_number) const
int
getBlockEquationID(int block_number, int equation_number) const override
{
return (equation_reordered[block_type_firstequation_size_mfs[block_number].first.second+equation_number]);
};
//! Return the original number of variable variable_number belonging to the block block_number
virtual int
getBlockVariableID(int block_number, int variable_number) const
int
getBlockVariableID(int block_number, int variable_number) const override
{
return (variable_reordered[block_type_firstequation_size_mfs[block_number].first.second+variable_number]);
};
//! Return the original number of the exogenous variable varexo_number belonging to the block block_number
virtual int
getBlockVariableExoID(int block_number, int variable_number) const
int
getBlockVariableExoID(int block_number, int variable_number) const override
{
return 0;
};
//! Return the position of equation_number in the block number belonging to the block block_number
virtual int
getBlockInitialEquationID(int block_number, int equation_number) const
int
getBlockInitialEquationID(int block_number, int equation_number) const override
{
return ((int) inv_equation_reordered[equation_number] - (int) block_type_firstequation_size_mfs[block_number].first.second);
};
//! Return the position of variable_number in the block number belonging to the block block_number
virtual int
getBlockInitialVariableID(int block_number, int variable_number) const
int
getBlockInitialVariableID(int block_number, int variable_number) const override
{
return ((int) inv_variable_reordered[variable_number] - (int) block_type_firstequation_size_mfs[block_number].first.second);
};
//! Return the position of variable_number in the block number belonging to the block block_number
virtual int
getBlockInitialExogenousID(int block_number, int variable_number) const