Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dynare
preprocessor
Commits
7d9072a2
Commit
7d9072a2
authored
Aug 22, 2018
by
Houtan Bastani
Browse files
var_expectation: rename var_model_name to aux_model_name
parent
a406c185
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/ComputingTasks.cc
View file @
7d9072a2
...
...
@@ -4851,10 +4851,14 @@ GenerateIRFsStatement::writeJsonOutput(ostream &output) const
output
<<
"}"
;
}
VarExpectationModelStatement
::
VarExpectationModelStatement
(
string
model_name_arg
,
string
variable_arg
,
string
var_model_name_arg
,
string
horizon_arg
,
expr_t
discount_arg
,
const
SymbolTable
&
symbol_table_arg
)
:
VarExpectationModelStatement
::
VarExpectationModelStatement
(
string
model_name_arg
,
string
variable_arg
,
string
aux_model_name_arg
,
string
horizon_arg
,
expr_t
discount_arg
,
const
SymbolTable
&
symbol_table_arg
)
:
model_name
{
move
(
model_name_arg
)},
variable
{
move
(
variable_arg
)},
var
_model_name
{
move
(
var
_model_name_arg
)},
horizon
{
move
(
horizon_arg
)},
aux
_model_name
{
move
(
aux
_model_name_arg
)},
horizon
{
move
(
horizon_arg
)},
discount
{
discount_arg
},
symbol_table
{
symbol_table_arg
}
{
}
...
...
@@ -4863,7 +4867,7 @@ void
VarExpectationModelStatement
::
writeOutput
(
ostream
&
output
,
const
string
&
basename
,
bool
minimal_workspace
)
const
{
string
mstruct
=
"M_.var_expectation."
+
model_name
;
output
<<
mstruct
<<
".auxiliary_model_name = '"
<<
var
_model_name
<<
"';"
<<
endl
output
<<
mstruct
<<
".auxiliary_model_name = '"
<<
aux
_model_name
<<
"';"
<<
endl
<<
mstruct
<<
".horizon = "
<<
horizon
<<
';'
<<
endl
<<
mstruct
<<
".variable = '"
<<
variable
<<
"';"
<<
endl
<<
mstruct
<<
".variable_id = "
<<
symbol_table
.
getTypeSpecificID
(
variable
)
+
1
<<
";"
<<
endl
;
...
...
@@ -4888,7 +4892,7 @@ VarExpectationModelStatement::writeJsonOutput(ostream &output) const
output
<<
"{
\"
statementName
\"
:
\"
var_expectation_model
\"
,"
<<
"
\"
model_name
\"
:
\"
"
<<
model_name
<<
"
\"
, "
<<
"
\"
variable
\"
:
\"
"
<<
variable
<<
"
\"
, "
<<
"
\"
var
_model_name
\"
:
\"
"
<<
var
_model_name
<<
"
\"
, "
<<
"
\"
aux
_model_name
\"
:
\"
"
<<
aux
_model_name
<<
"
\"
, "
<<
"
\"
horizon
\"
:
\"
"
<<
horizon
<<
"
\"
, "
<<
"
\"
discount
\"
:
\"
"
;
discount
->
writeOutput
(
output
);
...
...
src/ComputingTasks.hh
View file @
7d9072a2
...
...
@@ -1182,14 +1182,14 @@ public:
class
VarExpectationModelStatement
:
public
Statement
{
public:
const
string
model_name
,
variable
,
var
_model_name
,
horizon
;
const
string
model_name
,
variable
,
aux
_model_name
,
horizon
;
const
expr_t
discount
;
const
SymbolTable
&
symbol_table
;
// List of generated auxiliary param ids, in variable-major order
vector
<
int
>
aux_params_ids
;
// TODO: move this to some new VarModelTable object
public:
VarExpectationModelStatement
(
string
model_name_arg
,
string
variable_arg
,
string
var
_model_name_arg
,
VarExpectationModelStatement
(
string
model_name_arg
,
string
variable_arg
,
string
aux
_model_name_arg
,
string
horizon_arg
,
expr_t
discount_arg
,
const
SymbolTable
&
symbol_table_arg
);
void
writeOutput
(
ostream
&
output
,
const
string
&
basename
,
bool
minimal_workspace
)
const
override
;
void
writeJsonOutput
(
ostream
&
output
)
const
override
;
...
...
src/ModFile.cc
View file @
7d9072a2
...
...
@@ -517,20 +517,20 @@ ModFile::transformPass(bool nostrict, bool stochastic, bool compute_xrefs, const
int
max_lag
;
vector
<
int
>
lhs
;
auto
&
model_name
=
vems
->
model_name
;
if
(
var_model_table
.
isExistingVarModelName
(
vems
->
var
_model_name
))
if
(
var_model_table
.
isExistingVarModelName
(
vems
->
aux
_model_name
))
{
max_lag
=
var_model_table
.
getMaxLag
(
vems
->
var
_model_name
);
lhs
=
var_model_table
.
getLhs
(
vems
->
var
_model_name
);
max_lag
=
var_model_table
.
getMaxLag
(
vems
->
aux
_model_name
);
lhs
=
var_model_table
.
getLhs
(
vems
->
aux
_model_name
);
}
else
if
(
trend_component_model_table
.
isExistingTrendComponentModelName
(
vems
->
var
_model_name
))
else
if
(
trend_component_model_table
.
isExistingTrendComponentModelName
(
vems
->
aux
_model_name
))
{
max_lag
=
trend_component_model_table
.
getMaxLag
(
vems
->
var
_model_name
);
lhs
=
trend_component_model_table
.
getLhs
(
vems
->
var
_model_name
);
max_lag
=
trend_component_model_table
.
getMaxLag
(
vems
->
aux
_model_name
);
lhs
=
trend_component_model_table
.
getLhs
(
vems
->
aux
_model_name
);
}
else
{
cerr
<<
"ERROR: var_expectation_model "
<<
model_name
<<
" refers to nonexistent auxiliary model "
<<
vems
->
var
_model_name
<<
endl
;
<<
" refers to nonexistent auxiliary model "
<<
vems
->
aux
_model_name
<<
endl
;
exit
(
EXIT_FAILURE
);
}
...
...
Write
Preview
Supports
Markdown
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