Commit e73ebc70 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Port to C++11 noexcept keyword

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

https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-noexcept.html
parent 64eb4942
......@@ -177,7 +177,7 @@ DataTree::AddTimes(expr_t iArg1, expr_t iArg2)
}
expr_t
DataTree::AddDivide(expr_t iArg1, expr_t iArg2) throw (DivisionByZeroException)
DataTree::AddDivide(expr_t iArg1, expr_t iArg2) noexcept(false)
{
if (iArg2 == One)
return iArg1;
......@@ -530,7 +530,7 @@ DataTree::AddEqual(expr_t iArg1, expr_t iArg2)
}
void
DataTree::AddLocalVariable(int symb_id, expr_t value) throw (LocalVariableException)
DataTree::AddLocalVariable(int symb_id, expr_t value) noexcept(false)
{
assert(symbol_table.getType(symb_id) == eModelLocalVariable);
......@@ -598,25 +598,25 @@ DataTree::isSymbolUsed(int symb_id) const
}
int
DataTree::getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException)
DataTree::getDerivID(int symb_id, int lag) const noexcept(false)
{
throw UnknownDerivIDException();
}
SymbolType
DataTree::getTypeByDerivID(int deriv_id) const throw (UnknownDerivIDException)
DataTree::getTypeByDerivID(int deriv_id) const noexcept(false)
{
throw UnknownDerivIDException();
}
int
DataTree::getLagByDerivID(int deriv_id) const throw (UnknownDerivIDException)
DataTree::getLagByDerivID(int deriv_id) const noexcept(false)
{
throw UnknownDerivIDException();
}
int
DataTree::getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDException)
DataTree::getSymbIDByDerivID(int deriv_id) const noexcept(false)
{
throw UnknownDerivIDException();
}
......@@ -627,7 +627,7 @@ DataTree::addAllParamDerivId(set<int> &deriv_id_set)
}
int
DataTree::getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException)
DataTree::getDynJacobianCol(int deriv_id) const noexcept(false)
{
throw UnknownDerivIDException();
}
......
......@@ -152,7 +152,7 @@ public:
//! Adds "arg1*arg2" to model tree
expr_t AddTimes(expr_t iArg1, expr_t iArg2);
//! Adds "arg1/arg2" to model tree
expr_t AddDivide(expr_t iArg1, expr_t iArg2) throw (DivisionByZeroException);
expr_t AddDivide(expr_t iArg1, expr_t iArg2) noexcept(false);
//! Adds "arg1<arg2" to model tree
expr_t AddLess(expr_t iArg1, expr_t iArg2);
//! Adds "arg1>arg2" to model tree
......@@ -234,7 +234,7 @@ public:
//! Adds pac_expectation command to model tree
expr_t AddPacExpectation(const string &model_name);
//! Adds a model local variable with its value
void AddLocalVariable(int symb_id, expr_t value) throw (LocalVariableException);
void AddLocalVariable(int symb_id, expr_t value) noexcept(false);
//! Adds an external function node
expr_t AddExternalFunction(int symb_id, const vector<expr_t> &arguments);
//! Adds an external function node for the first derivative of an external function
......@@ -282,12 +282,12 @@ public:
};
//! Returns the derivation ID, or throws an exception if the derivation ID does not exist
virtual int getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException);
virtual SymbolType getTypeByDerivID(int deriv_id) const throw (UnknownDerivIDException);
virtual int getLagByDerivID(int deriv_id) const throw (UnknownDerivIDException);
virtual int getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDException);
virtual int getDerivID(int symb_id, int lag) const noexcept(false);
virtual SymbolType getTypeByDerivID(int deriv_id) const noexcept(false);
virtual int getLagByDerivID(int deriv_id) const noexcept(false);
virtual int getSymbIDByDerivID(int deriv_id) const noexcept(false);
//! Returns the column of the dynamic Jacobian associated to a derivation ID
virtual int getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException);
virtual int getDynJacobianCol(int deriv_id) const noexcept(false);
//! Adds to the set all the deriv IDs corresponding to parameters
virtual void addAllParamDerivId(set<int> &deriv_id_set);
......
......@@ -4776,13 +4776,13 @@ DynamicModel::computeDerivIDs()
}
SymbolType
DynamicModel::getTypeByDerivID(int deriv_id) const throw (UnknownDerivIDException)
DynamicModel::getTypeByDerivID(int deriv_id) const noexcept(false)
{
return symbol_table.getType(getSymbIDByDerivID(deriv_id));
}
int
DynamicModel::getLagByDerivID(int deriv_id) const throw (UnknownDerivIDException)
DynamicModel::getLagByDerivID(int deriv_id) const noexcept(false)
{
if (deriv_id < 0 || deriv_id >= (int) inv_deriv_id_table.size())
throw UnknownDerivIDException();
......@@ -4791,7 +4791,7 @@ DynamicModel::getLagByDerivID(int deriv_id) const throw (UnknownDerivIDException
}
int
DynamicModel::getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDException)
DynamicModel::getSymbIDByDerivID(int deriv_id) const noexcept(false)
{
if (deriv_id < 0 || deriv_id >= (int) inv_deriv_id_table.size())
throw UnknownDerivIDException();
......@@ -4800,7 +4800,7 @@ DynamicModel::getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDExcept
}
int
DynamicModel::getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException)
DynamicModel::getDerivID(int symb_id, int lag) const noexcept(false)
{
auto it = deriv_id_table.find(make_pair(symb_id, lag));
if (it == deriv_id_table.end())
......@@ -4872,7 +4872,7 @@ DynamicModel::computeDynJacobianCols(bool jacobianExo)
}
int
DynamicModel::getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException)
DynamicModel::getDynJacobianCol(int deriv_id) const noexcept(false)
{
auto it = dyn_jacobian_cols_table.find(deriv_id);
if (it == dyn_jacobian_cols_table.end())
......
......@@ -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 throw (UnknownDerivIDException);
virtual SymbolType getTypeByDerivID(int deriv_id) const noexcept(false);
//! Get the lag corresponding to a derivation ID
virtual int getLagByDerivID(int deriv_id) const throw (UnknownDerivIDException);
virtual int getLagByDerivID(int deriv_id) const noexcept(false);
//! Get the symbol ID corresponding to a derivation ID
virtual int getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDException);
virtual int getSymbIDByDerivID(int deriv_id) const noexcept(false);
//! 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
......@@ -379,8 +379,8 @@ 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 throw (UnknownDerivIDException);
virtual int getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException);
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);
//! Returns true indicating that this is a dynamic model
......
......@@ -383,7 +383,7 @@ NumConstNode::containsExternalFunction() const
}
double
NumConstNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
NumConstNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
return (datatree.num_constants.getDouble(id));
}
......@@ -1049,7 +1049,7 @@ VariableNode::substituteStaticAuxiliaryVariable() const
}
double
VariableNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
VariableNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
auto it = eval_context.find(symb_id);
if (it == eval_context.end())
......@@ -2570,7 +2570,7 @@ UnaryOpNode::compileExternalFunctionOutput(ostream &CompileCode, unsigned int &i
}
double
UnaryOpNode::eval_opcode(UnaryOpcode op_code, double v) throw (EvalException, EvalExternalFunctionException)
UnaryOpNode::eval_opcode(UnaryOpcode op_code, double v) noexcept(false)
{
switch (op_code)
{
......@@ -2631,7 +2631,7 @@ UnaryOpNode::eval_opcode(UnaryOpcode op_code, double v) throw (EvalException, Ev
}
double
UnaryOpNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
UnaryOpNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
double v = arg->eval(eval_context);
......@@ -3852,7 +3852,7 @@ BinaryOpNode::computeTemporaryTerms(map<expr_t, int> &reference_count,
}
double
BinaryOpNode::eval_opcode(double v1, BinaryOpcode op_code, double v2, int derivOrder) throw (EvalException, EvalExternalFunctionException)
BinaryOpNode::eval_opcode(double v1, BinaryOpcode op_code, double v2, int derivOrder) noexcept(false)
{
switch (op_code)
{
......@@ -3908,7 +3908,7 @@ BinaryOpNode::eval_opcode(double v1, BinaryOpcode op_code, double v2, int derivO
}
double
BinaryOpNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
BinaryOpNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
double v1 = arg1->eval(eval_context);
double v2 = arg2->eval(eval_context);
......@@ -5354,7 +5354,7 @@ TrinaryOpNode::computeTemporaryTerms(map<expr_t, int> &reference_count,
}
double
TrinaryOpNode::eval_opcode(double v1, TrinaryOpcode op_code, double v2, double v3) throw (EvalException, EvalExternalFunctionException)
TrinaryOpNode::eval_opcode(double v1, TrinaryOpcode op_code, double v2, double v3) noexcept(false)
{
switch (op_code)
{
......@@ -5368,7 +5368,7 @@ TrinaryOpNode::eval_opcode(double v1, TrinaryOpcode op_code, double v2, double v
}
double
TrinaryOpNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
TrinaryOpNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
double v1 = arg1->eval(eval_context);
double v2 = arg2->eval(eval_context);
......@@ -6055,7 +6055,7 @@ AbstractExternalFunctionNode::collectTemporary_terms(const temporary_terms_t &te
}
double
AbstractExternalFunctionNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
AbstractExternalFunctionNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
throw EvalExternalFunctionException();
}
......@@ -6290,7 +6290,7 @@ AbstractExternalFunctionNode::alreadyWrittenAsTefTerm(int the_symb_id, const der
}
int
AbstractExternalFunctionNode::getIndxInTefTerms(int the_symb_id, const deriv_node_temp_terms_t &tef_terms) const throw (UnknownFunctionNameAndArgs)
AbstractExternalFunctionNode::getIndxInTefTerms(int the_symb_id, const deriv_node_temp_terms_t &tef_terms) const noexcept(false)
{
auto it = tef_terms.find(make_pair(the_symb_id, arguments));
if (it != tef_terms.end())
......@@ -7719,7 +7719,7 @@ VarExpectationNode::containsExternalFunction() const
}
double
VarExpectationNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
VarExpectationNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
auto it = eval_context.find(symb_id);
if (it == eval_context.end())
......@@ -8170,7 +8170,7 @@ PacExpectationNode::containsExternalFunction() const
}
double
PacExpectationNode::eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException)
PacExpectationNode::eval(const eval_context_t &eval_context) const noexcept(false)
{
throw EvalException();
}
......
......@@ -331,7 +331,7 @@ class ExprNode
{
};
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException) = 0;
virtual double eval(const eval_context_t &eval_context) const noexcept(false) = 0;
virtual void compile(ostream &CompileCode, unsigned int &instruction_number, bool lhs_rhs, const temporary_terms_t &temporary_terms, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic, const deriv_node_temp_terms_t &tef_terms) const = 0;
void compile(ostream &CompileCode, unsigned int &instruction_number, bool lhs_rhs, const temporary_terms_t &temporary_terms, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic) const;
//! Creates a static version of this node
......@@ -579,7 +579,7 @@ public:
virtual void collectVARLHSVariable(set<expr_t> &result) const;
virtual void collectDynamicVariables(SymbolType type_arg, set<pair<int, int> > &result) const;
virtual void collectTemporary_terms(const temporary_terms_t &temporary_terms, temporary_terms_inuse_t &temporary_terms_inuse, int Curr_Block) const;
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
virtual void compile(ostream &CompileCode, unsigned int &instruction_number, bool lhs_rhs, const temporary_terms_t &temporary_terms, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic, const deriv_node_temp_terms_t &tef_terms) const;
virtual expr_t toStatic(DataTree &static_datatree) const;
virtual void computeXrefs(EquationInfo &ei) const;
......@@ -654,7 +654,7 @@ public:
vector< vector<temporary_terms_t> > &v_temporary_terms,
int equation) const;
virtual void collectTemporary_terms(const temporary_terms_t &temporary_terms, temporary_terms_inuse_t &temporary_terms_inuse, int Curr_Block) const;
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
virtual void compile(ostream &CompileCode, unsigned int &instruction_number, bool lhs_rhs, const temporary_terms_t &temporary_terms, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic, const deriv_node_temp_terms_t &tef_terms) const;
virtual expr_t toStatic(DataTree &static_datatree) const;
virtual void computeXrefs(EquationInfo &ei) const;
......@@ -767,8 +767,8 @@ public:
virtual void collectVARLHSVariable(set<expr_t> &result) const;
virtual void collectDynamicVariables(SymbolType type_arg, set<pair<int, int> > &result) const;
virtual void collectTemporary_terms(const temporary_terms_t &temporary_terms, temporary_terms_inuse_t &temporary_terms_inuse, int Curr_Block) const;
static double eval_opcode(UnaryOpcode op_code, double v) throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
static double eval_opcode(UnaryOpcode op_code, double v) noexcept(false);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
virtual void compile(ostream &CompileCode, unsigned int &instruction_number, bool lhs_rhs, const temporary_terms_t &temporary_terms, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic, const deriv_node_temp_terms_t &tef_terms) const;
//! Returns operand
expr_t
......@@ -882,8 +882,8 @@ public:
virtual void collectVARLHSVariable(set<expr_t> &result) const;
virtual void collectDynamicVariables(SymbolType type_arg, set<pair<int, int> > &result) const;
virtual void collectTemporary_terms(const temporary_terms_t &temporary_terms, temporary_terms_inuse_t &temporary_terms_inuse, int Curr_Block) const;
static double eval_opcode(double v1, BinaryOpcode op_code, double v2, int derivOrder) throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
static double eval_opcode(double v1, BinaryOpcode op_code, double v2, int derivOrder) noexcept(false);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
virtual void compile(ostream &CompileCode, unsigned int &instruction_number, bool lhs_rhs, const temporary_terms_t &temporary_terms, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic, const deriv_node_temp_terms_t &tef_terms) const;
virtual expr_t Compute_RHS(expr_t arg1, expr_t arg2, int op, int op_type) const;
//! Returns first operand
......@@ -1016,8 +1016,8 @@ public:
virtual void collectVARLHSVariable(set<expr_t> &result) const;
virtual void collectDynamicVariables(SymbolType type_arg, set<pair<int, int> > &result) const;
virtual void collectTemporary_terms(const temporary_terms_t &temporary_terms, temporary_terms_inuse_t &temporary_terms_inuse, int Curr_Block) const;
static double eval_opcode(double v1, TrinaryOpcode op_code, double v2, double v3) throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
static double eval_opcode(double v1, TrinaryOpcode op_code, double v2, double v3) noexcept(false);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
virtual void compile(ostream &CompileCode, unsigned int &instruction_number, bool lhs_rhs, const temporary_terms_t &temporary_terms, const map_idx_t &map_idx, bool dynamic, bool steady_dynamic, const deriv_node_temp_terms_t &tef_terms) const;
virtual expr_t toStatic(DataTree &static_datatree) const;
virtual void computeXrefs(EquationInfo &ei) const;
......@@ -1085,7 +1085,7 @@ protected:
//! Returns true if the given external function has been written as a temporary term
bool alreadyWrittenAsTefTerm(int the_symb_id, const deriv_node_temp_terms_t &tef_terms) const;
//! Returns the index in the tef_terms map of this external function
int getIndxInTefTerms(int the_symb_id, const deriv_node_temp_terms_t &tef_terms) const throw (UnknownFunctionNameAndArgs);
int getIndxInTefTerms(int the_symb_id, const deriv_node_temp_terms_t &tef_terms) const noexcept(false);
//! Helper function to write output arguments of any given external function
void writeExternalFunctionArguments(ostream &output, ExprNodeOutputType output_type, const temporary_terms_t &temporary_terms, const temporary_terms_idxs_t &temporary_terms_idxs, const deriv_node_temp_terms_t &tef_terms) const;
void writeJsonExternalFunctionArguments(ostream &output, const temporary_terms_t &temporary_terms, const deriv_node_temp_terms_t &tef_terms, const bool isdynamic) const;
......@@ -1124,7 +1124,7 @@ public:
virtual void collectVARLHSVariable(set<expr_t> &result) const;
virtual void collectDynamicVariables(SymbolType type_arg, set<pair<int, int> > &result) const;
virtual void collectTemporary_terms(const temporary_terms_t &temporary_terms, temporary_terms_inuse_t &temporary_terms_inuse, int Curr_Block) const;
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
unsigned int compileExternalFunctionArguments(ostream &CompileCode, unsigned int &instruction_number,
bool lhs_rhs, const temporary_terms_t &temporary_terms,
const map_idx_t &map_idx, bool dynamic, bool steady_dynamic,
......@@ -1341,7 +1341,7 @@ public:
virtual expr_t computeDerivative(int deriv_id);
virtual expr_t getChainRuleDerivative(int deriv_id, const map<int, expr_t> &recursive_variables);
virtual bool containsExternalFunction() const;
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
virtual void computeXrefs(EquationInfo &ei) const;
virtual expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const;
virtual expr_t substituteEndoLagGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const;
......@@ -1426,7 +1426,7 @@ public:
virtual expr_t computeDerivative(int deriv_id);
virtual expr_t getChainRuleDerivative(int deriv_id, const map<int, expr_t> &recursive_variables);
virtual bool containsExternalFunction() const;
virtual double eval(const eval_context_t &eval_context) const throw (EvalException, EvalExternalFunctionException);
virtual double eval(const eval_context_t &eval_context) const noexcept(false);
virtual void computeXrefs(EquationInfo &ei) const;
virtual expr_t substituteEndoLeadGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs, bool deterministic_model) const;
virtual expr_t substituteEndoLagGreaterThanTwo(subst_table_t &subst_table, vector<BinaryOpNode *> &neweqs) const;
......
......@@ -69,11 +69,11 @@ public:
//! See if the function exists in the External Functions Table
inline bool exists(int symb_id) const;
//! Get the number of arguments for a given external function
inline int getNargs(int symb_id) const throw (UnknownExternalFunctionSymbolIDException);
inline int getNargs(int symb_id) const noexcept(false);
//! Get the symbol_id of the first derivative function
inline int getFirstDerivSymbID(int symb_id) const throw (UnknownExternalFunctionSymbolIDException);
inline int getFirstDerivSymbID(int symb_id) const noexcept(false);
//! Get the symbol_id of the second derivative function
inline int getSecondDerivSymbID(int symb_id) const throw (UnknownExternalFunctionSymbolIDException);
inline int getSecondDerivSymbID(int symb_id) const noexcept(false);
//! Returns the total number of unique external functions declared or used in the .mod file
inline int get_total_number_of_unique_model_block_external_functions() const;
};
......@@ -86,7 +86,7 @@ ExternalFunctionsTable::exists(int symb_id) const
}
inline int
ExternalFunctionsTable::getNargs(int symb_id) const throw (UnknownExternalFunctionSymbolIDException)
ExternalFunctionsTable::getNargs(int symb_id) const noexcept(false)
{
if (exists(symb_id))
return externalFunctionTable.find(symb_id)->second.nargs;
......@@ -95,7 +95,7 @@ ExternalFunctionsTable::getNargs(int symb_id) const throw (UnknownExternalFuncti
}
inline int
ExternalFunctionsTable::getFirstDerivSymbID(int symb_id) const throw (UnknownExternalFunctionSymbolIDException)
ExternalFunctionsTable::getFirstDerivSymbID(int symb_id) const noexcept(false)
{
if (exists(symb_id))
return externalFunctionTable.find(symb_id)->second.firstDerivSymbID;
......@@ -104,7 +104,7 @@ ExternalFunctionsTable::getFirstDerivSymbID(int symb_id) const throw (UnknownExt
}
inline int
ExternalFunctionsTable::getSecondDerivSymbID(int symb_id) const throw (UnknownExternalFunctionSymbolIDException)
ExternalFunctionsTable::getSecondDerivSymbID(int symb_id) const noexcept(false)
{
if (exists(symb_id))
return externalFunctionTable.find(symb_id)->second.secondDerivSymbID;
......
......@@ -1759,7 +1759,7 @@ ModelTree::addAuxEquation(expr_t eq)
}
void
ModelTree::addTrendVariables(vector<int> trend_vars, expr_t growth_factor) throw (TrendException)
ModelTree::addTrendVariables(vector<int> trend_vars, expr_t growth_factor) noexcept(false)
{
while (!trend_vars.empty())
if (trend_symbols_map.find(trend_vars.back()) != trend_symbols_map.end())
......@@ -1772,7 +1772,7 @@ ModelTree::addTrendVariables(vector<int> trend_vars, expr_t growth_factor) throw
}
void
ModelTree::addNonstationaryVariables(vector<int> nonstationary_vars, bool log_deflator, expr_t deflator) throw (TrendException)
ModelTree::addNonstationaryVariables(vector<int> nonstationary_vars, bool log_deflator, expr_t deflator) noexcept(false)
{
while (!nonstationary_vars.empty())
if (nonstationary_symbols_map.find(nonstationary_vars.back()) != nonstationary_symbols_map.end())
......
......@@ -337,9 +337,9 @@ public:
//! Returns the number of equations in the model
int equation_number() const;
//! Adds a trend variable with its growth factor
void addTrendVariables(vector<int> trend_vars, expr_t growth_factor) throw (TrendException);
void addTrendVariables(vector<int> trend_vars, expr_t growth_factor) noexcept(false);
//! Adds a nonstationary variables with their (common) deflator
void addNonstationaryVariables(vector<int> nonstationary_vars, bool log_deflator, expr_t deflator) throw (TrendException);
void addNonstationaryVariables(vector<int> nonstationary_vars, bool log_deflator, expr_t deflator) noexcept(false);
//! Is a given variable non-stationary?
bool isNonstationary(int symb_id) const;
void set_cutoff_to_zero();
......
......@@ -21,14 +21,14 @@
#include "SigmaeInitialization.hh"
SigmaeStatement::SigmaeStatement(matrix_t matrix_arg) throw (MatrixFormException) :
SigmaeStatement::SigmaeStatement(matrix_t matrix_arg) noexcept(false) :
matrix(move(matrix_arg)),
matrix_form(determineMatrixForm(matrix))
{
}
SigmaeStatement::matrix_form_t
SigmaeStatement::determineMatrixForm(const matrix_t &matrix) throw (MatrixFormException)
SigmaeStatement::determineMatrixForm(const matrix_t &matrix) noexcept(false)
{
size_t nbe;
int inc;
......
......@@ -53,10 +53,10 @@ private:
//! Returns the type (upper or lower triangular) of a given matrix
/*! Throws an exception if it is neither upper triangular nor lower triangular */
static matrix_form_t determineMatrixForm(const matrix_t &matrix) throw (MatrixFormException);
static matrix_form_t determineMatrixForm(const matrix_t &matrix) noexcept(false);
public:
SigmaeStatement(matrix_t matrix_arg) throw (MatrixFormException);
SigmaeStatement(matrix_t matrix_arg) noexcept(false);
virtual void writeOutput(ostream &output, const string &basename, bool minimal_workspace) const;
};
......
......@@ -2152,7 +2152,7 @@ StaticModel::writeOutput(ostream &output, bool block) const
}
SymbolType
StaticModel::getTypeByDerivID(int deriv_id) const throw (UnknownDerivIDException)
StaticModel::getTypeByDerivID(int deriv_id) const noexcept(false)
{
if (deriv_id < symbol_table.endo_nbr())
return eEndogenous;
......@@ -2163,13 +2163,13 @@ StaticModel::getTypeByDerivID(int deriv_id) const throw (UnknownDerivIDException
}
int
StaticModel::getLagByDerivID(int deriv_id) const throw (UnknownDerivIDException)
StaticModel::getLagByDerivID(int deriv_id) const noexcept(false)
{
return 0;
}
int
StaticModel::getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDException)
StaticModel::getSymbIDByDerivID(int deriv_id) const noexcept(false)
{
if (deriv_id < symbol_table.endo_nbr())
return symbol_table.getID(eEndogenous, deriv_id);
......@@ -2180,7 +2180,7 @@ StaticModel::getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDExcepti
}
int
StaticModel::getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException)
StaticModel::getDerivID(int symb_id, int lag) const noexcept(false)
{
if (symbol_table.getType(symb_id) == eEndogenous)
return symbol_table.getTypeSpecificID(symb_id);
......
......@@ -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 throw (UnknownDerivIDException);
virtual SymbolType getTypeByDerivID(int deriv_id) const noexcept(false);
//! Get the lag corresponding to a derivation ID
virtual int getLagByDerivID(int deriv_id) const throw (UnknownDerivIDException);
virtual int getLagByDerivID(int deriv_id) const noexcept(false);
//! Get the symbol ID corresponding to a derivation ID
virtual int getSymbIDByDerivID(int deriv_id) const throw (UnknownDerivIDException);
virtual int getSymbIDByDerivID(int deriv_id) const noexcept(false);
//! Compute the column indices of the static Jacobian
void computeStatJacobianCols();
//! return a map on the block jacobian
......@@ -208,7 +208,7 @@ public:
//! See #1264
bool exoPresentInEqs() const;
virtual int getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException);
virtual int getDerivID(int symb_id, int lag) const noexcept(false);
virtual void addAllParamDerivId(set<int> &deriv_id_set);
//! Return the number of blocks
......
......@@ -42,7 +42,7 @@ SymbolTable::SymbolTable()
= default;
int
SymbolTable::addSymbol(const string &name, SymbolType type, const string &tex_name, const vector<pair<string *, string *> *> *partition_value) throw (AlreadyDeclaredException, FrozenException)
SymbolTable::addSymbol(const string &name, SymbolType type, const string &tex_name, const vector<pair<string *, string *> *> *partition_value) noexcept(false)
{
if (frozen)
throw FrozenException();
......@@ -94,13 +94,13 @@ SymbolTable::addSymbol(const string &name, SymbolType type, const string &tex_na
}
int
SymbolTable::addSymbol(const string &name, SymbolType type) throw (AlreadyDeclaredException, FrozenException)
SymbolTable::addSymbol(const string &name, SymbolType type) noexcept(false)
{
return addSymbol(name, type, "", NULL);
}
void
SymbolTable::freeze() throw (FrozenException)
SymbolTable::freeze() noexcept(false)
{
if (frozen)
throw FrozenException();
......@@ -148,7 +148,7 @@ SymbolTable::unfreeze()
}
void
SymbolTable::changeType(int id, SymbolType newtype) throw (UnknownSymbolIDException, FrozenException)
SymbolTable::changeType(int id, SymbolType newtype) noexcept(false)
{
if (frozen)
throw FrozenException();
......@@ -159,7 +159,7 @@ SymbolTable::changeType(int id, SymbolType newtype) throw (UnknownSymbolIDExcept
}
int
SymbolTable::getID(SymbolType type, int tsid) const throw (UnknownTypeSpecificIDException, NotYetFrozenException)
SymbolTable::getID(SymbolType type, int tsid) const noexcept(false)
{
if (!frozen)
throw NotYetFrozenException();
......@@ -192,7 +192,7 @@ SymbolTable::getID(SymbolType type, int tsid) const throw (UnknownTypeSpecificID
}
map<string, map<int, string> >
SymbolTable::getPartitionsForType(enum SymbolType st) const throw (UnknownSymbolIDException)
SymbolTable::getPartitionsForType(enum SymbolType st) const noexcept(false)
{
map<string, map<int, string> > partitions;
for (const auto & it : partition_value_map)
......@@ -208,7 +208,7 @@ SymbolTable::getPartitionsForType(enum SymbolType st) const throw (UnknownSymbol
}
void
SymbolTable::writeOutput(ostream &output) const throw (NotYetFrozenException)
SymbolTable::writeOutput(ostream &output) const noexcept(false)
{
if (!frozen)
throw NotYetFrozenException();
......@@ -418,7 +418,7 @@ SymbolTable::writeOutput(ostream &output) const throw (NotYetFrozenException)
}
void