dynare/mex/sources/k_order_perturbation
Sébastien Villemot 144bdf34ba
k-order MEX: fix crash on Octave when higher-order derivatives have numerical zero
In Octave, when some values given to the sparse() function are numerically
zero, then the nzmax of the generated sparse matrix is shrinked accordingly;
while under MATLAB, the nzmax is the length of the vector of values, zeros
included.

The check at the top of
DynamicModelMFile::unpackSparseMatrixAndCopyIntoTwoDMatData() would then fail
under Octave if some higher-derivatives had an element which is symbolically
non-zero but numerically zero.

We therefore relax the check, and accordingly adapt the code that handles
numerical zeros.

This bug was uncovered by tests/pruning/AnSchorfheide_pruned_state_space.mod,
which was failing under Octave.
2020-02-18 12:18:39 +01:00
..
tests Global reindentation of MEX sources 2019-12-20 16:30:24 +01:00
dynamic_abstract_class.hh Global reindentation of MEX sources 2019-12-20 16:30:24 +01:00
dynamic_dll.cc k-order DLL: fix compilation error on Windows introduced by b1ba53ce0 2019-04-16 12:13:30 +02:00
dynamic_dll.hh Global reindentation of MEX sources 2019-12-20 16:30:24 +01:00
dynamic_m.cc k-order MEX: fix crash on Octave when higher-order derivatives have numerical zero 2020-02-18 12:18:39 +01:00
dynamic_m.hh Use Unicode copyright symbol (in UTF-8 encoding) 2019-04-16 11:42:16 +02:00
k_ord_dynare.cc Global reindentation of MEX sources 2019-12-20 16:30:24 +01:00
k_ord_dynare.hh k_order_perturbation MEX: small simplification in handling of NameLists 2019-07-09 17:33:14 +02:00
k_order_perturbation.cc Remove workaround for errors in MEX files 2020-01-10 18:33:11 +01:00