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
50c26f49
Verified
Commit
50c26f49
authored
Mar 15, 2019
by
Houtan Bastani
Browse files
further simplifications related to AR matrices
parent
f1d1c1e1
Pipeline
#982
passed with stage
in 1 minute and 30 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/ExprNode.cc
View file @
50c26f49
...
...
@@ -5872,21 +5872,10 @@ BinaryOpNode::fillAutoregressiveRow(int eqn, const vector<int> &lhs, map<tuple<i
}
if (vid >= 0)
{
int vidineq = vid;
while (datatree.symbol_table.isAuxiliaryVariable(vid))
try
{
vid = datatree.symbol_table.getOrigSymbIdForAuxVar(vid);
}
catch (...)
{
break;
}
if (vidineq != vid)
if (datatree.symbol_table.isDiffAuxiliaryVariable(vid))
{
vid
= datatree.symbol_table.getOrig
SymbId
ForDiffAuxVar(vid
ineq
);
lag
=
-
datatree.symbol_table.getOrig
LeadLag
ForDiffAuxVar(vid
ineq
);
lag
=
-
datatree.symbol_table.getOrig
LeadLag
ForDiffAuxVar(vid);
vid
= datatree.symbol_table.getOrig
SymbId
ForDiffAuxVar(vid);
}
if (find(lhs.begin(), lhs.end(), vid) == lhs.end())
...
...
src/SymbolTable.cc
View file @
50c26f49
...
...
@@ -1091,6 +1091,18 @@ SymbolTable::isAuxiliaryVariableButNotMultiplier(int symb_id) const
return
false
;
}
bool
SymbolTable
::
isDiffAuxiliaryVariable
(
int
symb_id
)
const
{
for
(
const
auto
&
aux_var
:
aux_vars
)
if
(
aux_var
.
get_symb_id
()
==
symb_id
&&
(
aux_var
.
get_type
()
==
AuxVarType
::
diff
||
aux_var
.
get_type
()
==
AuxVarType
::
diffLag
||
aux_var
.
get_type
()
==
AuxVarType
::
diffLead
))
return
true
;
return
false
;
}
set
<
int
>
SymbolTable
::
getOrigEndogenous
()
const
{
...
...
src/SymbolTable.hh
View file @
50c26f49
...
...
@@ -408,6 +408,8 @@ public:
bool
isAuxiliaryVariable
(
int
symb_id
)
const
;
//! Is a given symbol an auxiliary variable but not a Lagrange multiplier
bool
isAuxiliaryVariableButNotMultiplier
(
int
symb_id
)
const
;
//! Is a given symbol a diff, diff lead, or diff lag auxiliary variable
bool
isDiffAuxiliaryVariable
(
int
symb_id
)
const
;
//! Get list of endogenous variables without aux vars
set
<
int
>
getOrigEndogenous
()
const
;
};
...
...
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