diff --git a/preprocessor/DynamicModel.cc b/preprocessor/DynamicModel.cc
index 186dbbd0cff33da44f90a0d3f0920f35668e54ec..38f57595d9b61d852022cb698f5f926b3dfaea95 100644
--- a/preprocessor/DynamicModel.cc
+++ b/preprocessor/DynamicModel.cc
@@ -45,9 +45,7 @@ DynamicModel::DynamicModel(SymbolTable &symbol_table_arg,
max_exo_lag(0), max_exo_lead(0),
max_exo_det_lag(0), max_exo_det_lead(0),
dynJacobianColsNbr(0),
- global_temporary_terms(true),
- cutoff(1e-15),
- mfs(0)
+ global_temporary_terms(true)
{
}
@@ -83,16 +81,6 @@ DynamicModel::compileChainRuleDerivative(ofstream &code_file, unsigned int &inst
}
}
-void
-DynamicModel::initializeVariablesAndEquations()
-{
- for (int j = 0; j < equation_number(); j++)
- {
- equation_reordered.push_back(j);
- variable_reordered.push_back(j);
- }
-}
-
void
DynamicModel::computeTemporaryTermsOrdered()
{
@@ -3978,9 +3966,3 @@ DynamicModel::fillEvalContext(eval_context_t &eval_context) const
it != trendVars.end(); it++)
eval_context[*it] = 2; //not <= 0 bc of log, not 1 bc of powers
}
-
-void
-DynamicModel::set_cutoff_to_zero()
-{
- cutoff = 0;
-}
diff --git a/preprocessor/DynamicModel.hh b/preprocessor/DynamicModel.hh
index 9e7382162672c3a467f40bf8a1d78437e692b7a3..8298ece8d5635e11671c7d92d11a291a27d06fc2 100644
--- a/preprocessor/DynamicModel.hh
+++ b/preprocessor/DynamicModel.hh
@@ -194,9 +194,6 @@ private:
//! Indicate if the temporary terms are computed for the overall model (true) or not (false). Default value true
bool global_temporary_terms;
- //! vector of block reordered variables and equations
- vector<int> equation_reordered, variable_reordered, inv_equation_reordered, inv_variable_reordered;
-
//! Vector describing equations: BlockSimulationType, if BlockSimulationType == EVALUATE_s then a expr_t on the new normalized equation
equation_type_and_normalized_equation_t equation_type_and_normalized_equation;
@@ -244,17 +241,7 @@ public:
//! Adds a variable node
/*! This implementation allows for non-zero lag */
virtual VariableNode *AddVariable(int symb_id, int lag = 0);
- //! Absolute value under which a number is considered to be zero
- double cutoff;
- //! Compute the minimum feedback set in the dynamic model:
- /*! 0 : all endogenous variables are considered as feedback variables
- 1 : the variables belonging to non normalized equation are considered as feedback variables
- 2 : the variables belonging to a non linear equation are considered as feedback variables
- 3 : the variables belonging to a non normalizable non linear equation are considered as feedback variables
- default value = 0 */
- int mfs;
- //! the file containing the model and the derivatives code
- ofstream code_file;
+
//! Execute computations (variable sorting + derivation)
/*!
\param jacobianExo whether derivatives w.r. to exo and exo_det should be in the Jacobian (derivatives w.r. to endo are always computed)
@@ -292,9 +279,6 @@ public:
//! Writes LaTeX file with the equations of the dynamic model
void writeLatexFile(const string &basename) const;
- //! Initialize equation_reordered & variable_reordered
- void initializeVariablesAndEquations();
-
virtual int getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException);
virtual int getDynJacobianCol(int deriv_id) const throw (UnknownDerivIDException);
virtual void addAllParamDerivId(set<int> &deriv_id_set);
@@ -338,8 +322,6 @@ public:
//! Fills eval context with values of model local variables and auxiliary variables
void fillEvalContext(eval_context_t &eval_context) const;
- void set_cutoff_to_zero();
-
//! Return the number of blocks
virtual unsigned int
getNbBlocks() const
diff --git a/preprocessor/ModelTree.cc b/preprocessor/ModelTree.cc
index 53ba7d3a548c22678ed01bfba7d9db2b077db20a..5060b1430ca911db519872e35af9533710e75c43 100644
--- a/preprocessor/ModelTree.cc
+++ b/preprocessor/ModelTree.cc
@@ -957,7 +957,10 @@ ModelTree::BlockLinear(const blocks_derivatives_t &blocks_derivatives, const vec
ModelTree::ModelTree(SymbolTable &symbol_table_arg,
NumericalConstants &num_constants_arg,
ExternalFunctionsTable &external_functions_table_arg) :
- DataTree(symbol_table_arg, num_constants_arg, external_functions_table_arg)
+ DataTree(symbol_table_arg, num_constants_arg, external_functions_table_arg),
+ cutoff(1e-15),
+ mfs(0)
+
{
for (int i = 0; i < 3; i++)
NNZDerivatives[i] = 0;
@@ -1405,3 +1408,19 @@ ModelTree::addNonstationaryVariables(vector<int> nonstationary_vars, expr_t defl
nonstationary_vars.pop_back();
}
}
+
+void
+ModelTree::initializeVariablesAndEquations()
+{
+ for (int j = 0; j < equation_number(); j++)
+ {
+ equation_reordered.push_back(j);
+ variable_reordered.push_back(j);
+ }
+}
+
+void
+ModelTree::set_cutoff_to_zero()
+{
+ cutoff = 0;
+}
diff --git a/preprocessor/ModelTree.hh b/preprocessor/ModelTree.hh
index 346212df17c02c738ce998a0dcdcfacf69c96001..72fddb753cd0af6bd7bfe6cf5735f770f551d6ae 100644
--- a/preprocessor/ModelTree.hh
+++ b/preprocessor/ModelTree.hh
@@ -99,6 +99,12 @@ protected:
//! Nonstationary variables and their deflators
trend_symbols_map_t nonstationary_symbols_map;
+ //! vector of block reordered variables and equations
+ vector<int> equation_reordered, variable_reordered, inv_equation_reordered, inv_variable_reordered;
+
+ //! the file containing the model and the derivatives code
+ ofstream code_file;
+
//! Computes 1st derivatives
/*! \param vars the derivation IDs w.r. to which compute the derivatives */
void computeJacobian(const set<int> &vars);
@@ -230,8 +236,19 @@ protected:
virtual int getBlockInitialDetExogenousID(int block_number, int variable_number) const = 0;
//! 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 = 0;
+ //! Initialize equation_reordered & variable_reordered
+ void initializeVariablesAndEquations();
public:
ModelTree(SymbolTable &symbol_table_arg, NumericalConstants &num_constants_arg, ExternalFunctionsTable &external_functions_table_arg);
+ //! Absolute value under which a number is considered to be zero
+ double cutoff;
+ //! Compute the minimum feedback set
+ /*! 0 : all endogenous variables are considered as feedback variables
+ 1 : the variables belonging to non normalized equation are considered as feedback variables
+ 2 : the variables belonging to a non linear equation are considered as feedback variables
+ 3 : the variables belonging to a non normalizable non linear equation are considered as feedback variables
+ default value = 0 */
+ int mfs;
//! Declare a node as an equation of the model
void addEquation(expr_t eq);
//! Adds tags to equation number i
@@ -244,7 +261,8 @@ public:
void addTrendVariables(vector<int> trend_vars, expr_t growth_factor) throw (TrendException);
//! Adds a nonstationary variable with its deflator
void addNonstationaryVariables(vector<int> nonstationary_vars, expr_t deflator) throw (TrendException);
-
+ void set_cutoff_to_zero();
+
inline static std::string
c_Equation_Type(int type)
{
diff --git a/preprocessor/StaticModel.cc b/preprocessor/StaticModel.cc
index b6fcb571a38130b903a61324ccf869edb00e2054..0fe9a37901f1a368083ba443c203818ab95a0a2a 100644
--- a/preprocessor/StaticModel.cc
+++ b/preprocessor/StaticModel.cc
@@ -39,9 +39,7 @@ StaticModel::StaticModel(SymbolTable &symbol_table_arg,
NumericalConstants &num_constants_arg,
ExternalFunctionsTable &external_functions_table_arg) :
ModelTree(symbol_table_arg, num_constants_arg, external_functions_table_arg),
- global_temporary_terms(true),
- cutoff(1e-15),
- mfs(0)
+ global_temporary_terms(true)
{
}
@@ -71,16 +69,6 @@ StaticModel::compileChainRuleDerivative(ofstream &code_file, unsigned int &instr
}
}
-void
-StaticModel::initializeVariablesAndEquations()
-{
- for (int j = 0; j < equation_number(); j++)
- {
- equation_reordered.push_back(j);
- variable_reordered.push_back(j);
- }
-}
-
void
StaticModel::computeTemporaryTermsOrdered()
{
@@ -1611,9 +1599,3 @@ StaticModel::writeAuxVarInitval(ostream &output, ExprNodeOutputType output_type)
output << ";" << endl;
}
}
-
-void
-StaticModel::set_cutoff_to_zero()
-{
- cutoff = 0;
-}
diff --git a/preprocessor/StaticModel.hh b/preprocessor/StaticModel.hh
index f40b552ec30dbd4068a5ab7438222a5f9c845005..2f8bd36f3765e7d60962a249f79c3556d1cec338 100644
--- a/preprocessor/StaticModel.hh
+++ b/preprocessor/StaticModel.hh
@@ -123,9 +123,6 @@ protected:
//! Indicate if the temporary terms are computed for the overall model (true) or not (false). Default value true
bool global_temporary_terms;
- //! vector of block reordered variables and equations
- vector<int> equation_reordered, variable_reordered, inv_equation_reordered, inv_variable_reordered;
-
//! Vector describing equations: BlockSimulationType, if BlockSimulationType == EVALUATE_s then a expr_t on the new normalized equation
equation_type_and_normalized_equation_t equation_type_and_normalized_equation;
@@ -169,16 +166,6 @@ public:
//! Writes information on block decomposition when relevant
void writeOutput(ostream &output, bool block) const;
- //! Absolute value under which a number is considered to be zero
- double cutoff;
- //! Compute the minimum feedback set in the static model:
- /*! 0 : all endogenous variables are considered as feedback variables
- 1 : the variables belonging to a non linear equation are considered as feedback variables
- 2 : the variables belonging to a non normalizable non linear equation are considered as feedback variables
- default value = 0 */
- int mfs;
- //! the file containing the model and the derivatives code
- ofstream code_file;
//! Execute computations (variable sorting + derivation)
/*!
\param jacobianExo whether derivatives w.r. to exo and exo_det should be in the Jacobian (derivatives w.r. to endo are always computed)
@@ -203,13 +190,8 @@ public:
//! Writes initializations in oo_.steady_state or steady state file for the auxiliary variables
void writeAuxVarInitval(ostream &output, ExprNodeOutputType output_type) const;
- //! Initialize equation_reordered & variable_reordered
- void initializeVariablesAndEquations();
-
virtual int getDerivID(int symb_id, int lag) const throw (UnknownDerivIDException);
- void set_cutoff_to_zero();
-
//! Return the number of blocks
virtual unsigned int
getNbBlocks() const