Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Dynare
preprocessor
Commits
85dbb649
Commit
85dbb649
authored
Sep 14, 2018
by
Houtan Bastani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move trend_component_table and var_model_table to DynamicModel as they are only used there
parent
eb74d483
Pipeline
#23
passed with stage
in 1 minute and 17 seconds
Changes
14
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
27 additions
and
56 deletions
+27
-56
src/ComputingTasks.cc
src/ComputingTasks.cc
+2
-5
src/ComputingTasks.hh
src/ComputingTasks.hh
+1
-3
src/DataTree.cc
src/DataTree.cc
+2
-6
src/DataTree.hh
src/DataTree.hh
+2
-7
src/DynamicModel.cc
src/DynamicModel.cc
+3
-2
src/DynamicModel.hh
src/DynamicModel.hh
+5
-0
src/ModFile.cc
src/ModFile.cc
+4
-8
src/ModelEquationBlock.cc
src/ModelEquationBlock.cc
+1
-4
src/ModelEquationBlock.hh
src/ModelEquationBlock.hh
+0
-2
src/ModelTree.cc
src/ModelTree.cc
+2
-5
src/ModelTree.hh
src/ModelTree.hh
+1
-3
src/ParsingDriver.cc
src/ParsingDriver.cc
+1
-3
src/StaticModel.cc
src/StaticModel.cc
+2
-5
src/StaticModel.hh
src/StaticModel.hh
+1
-3
No files found.
src/ComputingTasks.cc
View file @
85dbb649
...
...
@@ -2061,11 +2061,8 @@ ModelComparisonStatement::writeJsonOutput(ostream &output) const
PlannerObjectiveStatement
::
PlannerObjectiveStatement
(
SymbolTable
&
symbol_table
,
NumericalConstants
&
num_constants
,
ExternalFunctionsTable
&
external_functions_table
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
)
:
model_tree
{
symbol_table
,
num_constants
,
external_functions_table
,
trend_component_model_table_arg
,
var_model_table_arg
}
ExternalFunctionsTable
&
external_functions_table
)
:
model_tree
{
symbol_table
,
num_constants
,
external_functions_table
}
{
}
...
...
src/ComputingTasks.hh
View file @
85dbb649
...
...
@@ -510,9 +510,7 @@ private:
public:
PlannerObjectiveStatement
(
SymbolTable
&
symbol_table
,
NumericalConstants
&
num_constants
,
ExternalFunctionsTable
&
external_functions_table
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
);
ExternalFunctionsTable
&
external_functions_table
);
/*! \todo check there are only endogenous variables at the current period in the objective
(no exogenous, no lead/lag) */
void
checkPass
(
ModFileStructure
&
mod_file_struct
,
WarningConsolidation
&
warnings
)
override
;
...
...
src/DataTree.cc
View file @
85dbb649
...
...
@@ -28,14 +28,10 @@
DataTree
::
DataTree
(
SymbolTable
&
symbol_table_arg
,
NumericalConstants
&
num_constants_arg
,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
)
:
ExternalFunctionsTable
&
external_functions_table_arg
)
:
symbol_table
(
symbol_table_arg
),
num_constants
(
num_constants_arg
),
external_functions_table
(
external_functions_table_arg
),
trend_component_model_table
(
trend_component_model_table_arg
),
var_model_table
(
var_model_table_arg
)
external_functions_table
(
external_functions_table_arg
)
{
Zero
=
AddNonNegativeConstant
(
"0"
);
One
=
AddNonNegativeConstant
(
"1"
);
...
...
src/DataTree.hh
View file @
85dbb649
...
...
@@ -45,10 +45,6 @@ public:
NumericalConstants
&
num_constants
;
//! A reference to the external functions table
ExternalFunctionsTable
&
external_functions_table
;
//! A reference to the trend component model table
TrendComponentModelTable
&
trend_component_model_table
;
//! A reference to the VAR model table
VarModelTable
&
var_model_table
;
protected:
//! num_constant_id -> NumConstNode
...
...
@@ -122,9 +118,8 @@ private:
public:
DataTree
(
SymbolTable
&
symbol_table_arg
,
NumericalConstants
&
num_constants_arg
,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
);
ExternalFunctionsTable
&
external_functions_table_arg
);
virtual
~
DataTree
();
...
...
src/DynamicModel.cc
View file @
85dbb649
...
...
@@ -36,8 +36,9 @@ DynamicModel::DynamicModel(SymbolTable &symbol_table_arg,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
)
:
ModelTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
,
trend_component_model_table_arg
,
var_model_table_arg
),
ModelTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
),
trend_component_model_table
(
trend_component_model_table_arg
),
var_model_table
(
var_model_table_arg
),
max_lag
(
0
),
max_lead
(
0
),
max_endo_lag
(
0
),
max_endo_lead
(
0
),
max_exo_lag
(
0
),
max_exo_lead
(
0
),
...
...
src/DynamicModel.hh
View file @
85dbb649
...
...
@@ -30,6 +30,11 @@ using namespace std;
//! Stores a dynamic model
class
DynamicModel
:
public
ModelTree
{
public:
//! A reference to the trend component model table
TrendComponentModelTable
&
trend_component_model_table
;
//! A reference to the VAR model table
VarModelTable
&
var_model_table
;
private:
constexpr
static
double
zero_band
{
1e-8
};
...
...
src/ModFile.cc
View file @
85dbb649
...
...
@@ -32,8 +32,7 @@
ModFile
::
ModFile
(
WarningConsolidation
&
warnings_arg
)
:
var_model_table
(
symbol_table
),
trend_component_model_table
(
symbol_table
),
expressions_tree
(
symbol_table
,
num_constants
,
external_functions_table
,
trend_component_model_table
,
var_model_table
),
expressions_tree
(
symbol_table
,
num_constants
,
external_functions_table
),
original_model
(
symbol_table
,
num_constants
,
external_functions_table
,
trend_component_model_table
,
var_model_table
),
dynamic_model
(
symbol_table
,
num_constants
,
external_functions_table
,
...
...
@@ -46,12 +45,9 @@ ModFile::ModFile(WarningConsolidation &warnings_arg)
trend_component_model_table
,
var_model_table
),
epilogue
(
symbol_table
,
num_constants
,
external_functions_table
,
trend_component_model_table
,
var_model_table
),
static_model
(
symbol_table
,
num_constants
,
external_functions_table
,
trend_component_model_table
,
var_model_table
),
steady_state_model
(
symbol_table
,
num_constants
,
external_functions_table
,
trend_component_model_table
,
var_model_table
,
static_model
),
diff_static_model
(
symbol_table
,
num_constants
,
external_functions_table
,
trend_component_model_table
,
var_model_table
),
static_model
(
symbol_table
,
num_constants
,
external_functions_table
),
steady_state_model
(
symbol_table
,
num_constants
,
external_functions_table
,
static_model
),
diff_static_model
(
symbol_table
,
num_constants
,
external_functions_table
),
linear
(
false
),
block
(
false
),
byte_code
(
false
),
use_dll
(
false
),
no_static
(
false
),
differentiate_forward_vars
(
false
),
nonstationary_variables
(
false
),
param_used_with_lead_lag
(
false
),
warnings
(
warnings_arg
)
...
...
src/ModelEquationBlock.cc
View file @
85dbb649
...
...
@@ -25,11 +25,8 @@
SteadyStateModel
::
SteadyStateModel
(
SymbolTable
&
symbol_table_arg
,
NumericalConstants
&
num_constants_arg
,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
,
const
StaticModel
&
static_model_arg
)
:
DataTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
,
trend_component_model_table_arg
,
var_model_table_arg
),
DataTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
),
static_model
(
static_model_arg
)
{
}
...
...
src/ModelEquationBlock.hh
View file @
85dbb649
...
...
@@ -39,8 +39,6 @@ public:
SteadyStateModel
(
SymbolTable
&
symbol_table_arg
,
NumericalConstants
&
num_constants_arg
,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
,
const
StaticModel
&
static_model_arg
);
//! Add an expression of the form "var = expr;"
void
addDefinition
(
int
symb_id
,
expr_t
expr
);
...
...
src/ModelTree.cc
View file @
85dbb649
...
...
@@ -1003,11 +1003,8 @@ 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
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
)
:
DataTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
,
trend_component_model_table_arg
,
var_model_table_arg
),
ExternalFunctionsTable
&
external_functions_table_arg
)
:
DataTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
),
cutoff
(
1e-15
),
mfs
(
0
)
...
...
src/ModelTree.hh
View file @
85dbb649
...
...
@@ -323,9 +323,7 @@ protected:
public:
ModelTree
(
SymbolTable
&
symbol_table_arg
,
NumericalConstants
&
num_constants_arg
,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
);
ExternalFunctionsTable
&
external_functions_table_arg
);
//! Absolute value under which a number is considered to be zero
double
cutoff
;
//! Compute the minimum feedback set
...
...
src/ParsingDriver.cc
View file @
85dbb649
...
...
@@ -2136,9 +2136,7 @@ ParsingDriver::begin_planner_objective()
{
planner_objective_statement
=
make_unique
<
PlannerObjectiveStatement
>
(
mod_file
->
symbol_table
,
mod_file
->
num_constants
,
mod_file
->
external_functions_table
,
mod_file
->
trend_component_model_table
,
mod_file
->
var_model_table
);
mod_file
->
external_functions_table
);
set_current_data_tree
(
&
planner_objective_statement
->
getPlannerObjective
());
}
...
...
src/StaticModel.cc
View file @
85dbb649
...
...
@@ -31,11 +31,8 @@
StaticModel
::
StaticModel
(
SymbolTable
&
symbol_table_arg
,
NumericalConstants
&
num_constants_arg
,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
)
:
ModelTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
,
trend_component_model_table_arg
,
var_model_table_arg
),
ExternalFunctionsTable
&
external_functions_table_arg
)
:
ModelTree
(
symbol_table_arg
,
num_constants_arg
,
external_functions_table_arg
),
global_temporary_terms
(
true
)
{
}
...
...
src/StaticModel.hh
View file @
85dbb649
...
...
@@ -162,9 +162,7 @@ protected:
public:
StaticModel
(
SymbolTable
&
symbol_table_arg
,
NumericalConstants
&
num_constants
,
ExternalFunctionsTable
&
external_functions_table_arg
,
TrendComponentModelTable
&
trend_component_model_table_arg
,
VarModelTable
&
var_model_table_arg
);
ExternalFunctionsTable
&
external_functions_table_arg
);
//! Writes information on block decomposition when relevant
void
writeOutput
(
ostream
&
output
,
bool
block
)
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment