Fix size of dynamic derivatives (legacy representation) when there are unused exogenous and “nostrict” option is given
parent
c47d91c20b
commit
4f9241442c
|
@ -60,6 +60,7 @@ DynamicModel::DynamicModel(const DynamicModel &m) :
|
|||
deriv_id_table{m.deriv_id_table},
|
||||
inv_deriv_id_table{m.inv_deriv_id_table},
|
||||
dyn_jacobian_cols_table{m.dyn_jacobian_cols_table},
|
||||
dyn_jacobian_ncols{m.dyn_jacobian_ncols},
|
||||
max_lag{m.max_lag},
|
||||
max_lead{m.max_lead},
|
||||
max_endo_lag{m.max_endo_lag},
|
||||
|
@ -104,6 +105,7 @@ DynamicModel::operator=(const DynamicModel &m)
|
|||
deriv_id_table = m.deriv_id_table;
|
||||
inv_deriv_id_table = m.inv_deriv_id_table;
|
||||
dyn_jacobian_cols_table = m.dyn_jacobian_cols_table;
|
||||
dyn_jacobian_ncols = m.dyn_jacobian_ncols;
|
||||
max_lag = m.max_lag;
|
||||
max_lead = m.max_lead;
|
||||
max_endo_lag = m.max_endo_lag;
|
||||
|
@ -2931,6 +2933,10 @@ DynamicModel::computeDynJacobianCols()
|
|||
else if (type == SymbolType::exogenousDet)
|
||||
dyn_jacobian_cols_table[deriv_id] = ordered_dyn_endo.size() + symbol_table.exo_nbr() + tsid;
|
||||
}
|
||||
|
||||
/* NB: the following could differ from dyn_jacobian_cols_table.size() if
|
||||
there are unused exogenous (and “nostrict” option is given) */
|
||||
dyn_jacobian_ncols = ordered_dyn_endo.size() + symbol_table.exo_nbr() + symbol_table.exo_det_nbr();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -67,6 +67,8 @@ private:
|
|||
representation.
|
||||
Contains only endogenous, exogenous and exogenous deterministic */
|
||||
map<int, int> dyn_jacobian_cols_table;
|
||||
// Number of columns of the dynamic Jacobian (legacy representation)
|
||||
int dyn_jacobian_ncols;
|
||||
|
||||
//! Maximum lag and lead over all types of variables (positive values)
|
||||
/*! Set by computeDerivIDs() */
|
||||
|
@ -471,7 +473,7 @@ public:
|
|||
{
|
||||
return sparse ?
|
||||
3*symbol_table.endo_nbr() + symbol_table.exo_nbr() + symbol_table.exo_det_nbr() :
|
||||
dyn_jacobian_cols_table.size();
|
||||
dyn_jacobian_ncols;
|
||||
}
|
||||
|
||||
void addAllParamDerivId(set<int> &deriv_id_set) override;
|
||||
|
|
Loading…
Reference in New Issue