Remove more stuff related to unfinished decomposition in linear and nonlinear blocks
Ref. #39, dynare!1626issue#70
parent
af9bd8f109
commit
7468b4d8d7
|
@ -144,7 +144,6 @@ ModelTree::ModelTree(const ModelTree &m) :
|
||||||
blocks{m.blocks},
|
blocks{m.blocks},
|
||||||
endo2block{m.endo2block},
|
endo2block{m.endo2block},
|
||||||
eq2block{m.eq2block},
|
eq2block{m.eq2block},
|
||||||
is_equation_linear{m.is_equation_linear},
|
|
||||||
endo2eq{m.endo2eq},
|
endo2eq{m.endo2eq},
|
||||||
cutoff{m.cutoff},
|
cutoff{m.cutoff},
|
||||||
mfs{m.mfs}
|
mfs{m.mfs}
|
||||||
|
@ -186,7 +185,6 @@ ModelTree::operator=(const ModelTree &m)
|
||||||
eq2block = m.eq2block;
|
eq2block = m.eq2block;
|
||||||
blocks_temporary_terms.clear();
|
blocks_temporary_terms.clear();
|
||||||
blocks_temporary_terms_idxs.clear();
|
blocks_temporary_terms_idxs.clear();
|
||||||
is_equation_linear = m.is_equation_linear;
|
|
||||||
endo2eq = m.endo2eq;
|
endo2eq = m.endo2eq;
|
||||||
cutoff = m.cutoff;
|
cutoff = m.cutoff;
|
||||||
mfs = m.mfs;
|
mfs = m.mfs;
|
||||||
|
@ -351,34 +349,6 @@ ModelTree::evaluateAndReduceJacobian(const eval_context_t &eval_context) const
|
||||||
return contemporaneous_jacobian;
|
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>
|
pair<int, int>
|
||||||
ModelTree::computePrologueAndEpilogue()
|
ModelTree::computePrologueAndEpilogue()
|
||||||
{
|
{
|
||||||
|
|
|
@ -210,9 +210,6 @@ protected:
|
||||||
the vector of all temporary terms */
|
the vector of all temporary terms */
|
||||||
temporary_terms_idxs_t blocks_temporary_terms_idxs;
|
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
|
//! Computes derivatives
|
||||||
/*! \param order the derivation order
|
/*! \param order the derivation order
|
||||||
\param vars the derivation IDs w.r.t. which compute the derivatives */
|
\param vars the derivation IDs w.r.t. which compute the derivatives */
|
||||||
|
@ -296,8 +293,6 @@ protected:
|
||||||
The resulting normalization is stored in endo2eq.
|
The resulting normalization is stored in endo2eq.
|
||||||
*/
|
*/
|
||||||
void computeNonSingularNormalization(const jacob_map_t &contemporaneous_jacobian);
|
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
|
//! Evaluate the jacobian (w.r.t. endogenous) and suppress all the elements below the cutoff
|
||||||
/*! Returns the contemporaneous_jacobian.
|
/*! Returns the contemporaneous_jacobian.
|
||||||
Elements below the cutoff are discarded. External functions are evaluated to 1. */
|
Elements below the cutoff are discarded. External functions are evaluated to 1. */
|
||||||
|
|
Loading…
Reference in New Issue