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
Willi Mutschler
preprocessor
Commits
7468b4d8
Unverified
Commit
7468b4d8
authored
Jan 25, 2021
by
Sébastien Villemot
Browse files
Remove more stuff related to unfinished decomposition in linear and nonlinear blocks
Ref. #39, dynare!1626
parent
af9bd8f1
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/ModelTree.cc
View file @
7468b4d8
...
...
@@ -144,7 +144,6 @@ ModelTree::ModelTree(const ModelTree &m) :
blocks
{
m
.
blocks
},
endo2block
{
m
.
endo2block
},
eq2block
{
m
.
eq2block
},
is_equation_linear
{
m
.
is_equation_linear
},
endo2eq
{
m
.
endo2eq
},
cutoff
{
m
.
cutoff
},
mfs
{
m
.
mfs
}
...
...
@@ -186,7 +185,6 @@ ModelTree::operator=(const ModelTree &m)
eq2block
=
m
.
eq2block
;
blocks_temporary_terms
.
clear
();
blocks_temporary_terms_idxs
.
clear
();
is_equation_linear
=
m
.
is_equation_linear
;
endo2eq
=
m
.
endo2eq
;
cutoff
=
m
.
cutoff
;
mfs
=
m
.
mfs
;
...
...
@@ -351,34 +349,6 @@ ModelTree::evaluateAndReduceJacobian(const eval_context_t &eval_context) const
return
contemporaneous_jacobian
;
}
bool
ModelTree
::
computeNaturalNormalization
()
{
bool
bool_result
=
true
;
set
<
pair
<
int
,
int
>>
result
;
endo2eq
.
resize
(
equations
.
size
());
for
(
int
eq
=
0
;
eq
<
static_cast
<
int
>
(
equations
.
size
());
eq
++
)
if
(
!
is_equation_linear
[
eq
])
{
BinaryOpNode
*
eq_node
=
equations
[
eq
];
expr_t
lhs
=
eq_node
->
arg1
;
result
.
clear
();
lhs
->
collectDynamicVariables
(
SymbolType
::
endogenous
,
result
);
if
(
result
.
size
()
==
1
&&
result
.
begin
()
->
second
==
0
)
{
//check if the endogenous variable has not been already used in an other match !
if
(
find
(
endo2eq
.
begin
(),
endo2eq
.
end
(),
result
.
begin
()
->
first
)
==
endo2eq
.
end
())
endo2eq
[
result
.
begin
()
->
first
]
=
eq
;
else
{
bool_result
=
false
;
break
;
}
}
}
return
bool_result
;
}
pair
<
int
,
int
>
ModelTree
::
computePrologueAndEpilogue
()
{
...
...
src/ModelTree.hh
View file @
7468b4d8
...
...
@@ -210,9 +210,6 @@ protected:
the vector of all temporary terms */
temporary_terms_idxs_t
blocks_temporary_terms_idxs
;
//! Vector indicating if the equation is linear in endogenous variable (true) or not (false)
vector
<
bool
>
is_equation_linear
;
//! Computes derivatives
/*! \param order the derivation order
\param vars the derivation IDs w.r.t. which compute the derivatives */
...
...
@@ -296,8 +293,6 @@ protected:
The resulting normalization is stored in endo2eq.
*/
void
computeNonSingularNormalization
(
const
jacob_map_t
&
contemporaneous_jacobian
);
//! Try to find a natural normalization if all equations are matched to an endogenous variable on the LHS
bool
computeNaturalNormalization
();
//! Evaluate the jacobian (w.r.t. endogenous) and suppress all the elements below the cutoff
/*! Returns the contemporaneous_jacobian.
Elements below the cutoff are discarded. External functions are evaluated to 1. */
...
...
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