Commit Graph

12 Commits (c6a7801ba8fbed6db79626ac7cfb55e8894d9f3a)

Author SHA1 Message Date
Sébastien Villemot c6a7801ba8
clang-format configuration: set “PackConstructorInitializers: NextLine” 2023-11-30 14:37:05 +01:00
Sébastien Villemot ed332e3ba1
MEX files: reformat C++ source code using clang-format 15 2023-11-29 19:00:51 +01:00
Sébastien Villemot bf9434f95f
Remove warnings about cast between incompatible function types (-Wcast-function-type) under Windows 2023-09-22 14:22:47 +02:00
Sébastien Villemot c3e1480a52
C++17 modernization: use std::extent_v to get raw arrays size
This can prevent mistakes when the array is modified.
2023-01-24 13:43:02 +01:00
Sébastien Villemot 7922fc011e
perfect_foresight_problem MEX: move to the sparse representation
Ref. #1859
2023-01-24 13:43:00 +01:00
Sébastien Villemot 8a0eb76b1b
Use operator""s to replace some calls to std::string constructor
By the way, remove other unnecessary calls to that constructor.
2022-06-22 12:51:08 +02:00
Sébastien Villemot d5472d2338
Tighten input sanity checks of various MEX files
Note that the unitary test in lyapunov_solver.m that checks sparse matrix input
had to be removed. Previously, this test was passing by chance (because the
sparse test matrices had actually no zero element, hence the internal double
float storage was the same as in the dense case). Now it consistently fails
with the additional checks in disclyap_fast MEX.
2022-03-18 22:49:46 +01:00
Sébastien Villemot 0c68e7336b
perfect_foresight_problem MEX: error out properly when called MATLAB function triggers an exception
Closes: #1832
2022-01-03 18:11:31 +01:00
Sébastien Villemot 766fff88f6
Use secure URL for link to GNU licenses 2021-06-09 17:35:05 +02:00
Sébastien Villemot 42f172dec3
perfect_foresight_problem MEX: optimization for linear models
When the model is linear, there is no need to reevaluate the Jacobian for each
time period, since it is invariant.

Closes: #1662
2019-11-14 14:45:10 +01:00
Sébastien Villemot 7347554db5
perfect_foresight_problem MEX: fix compilation under Windows 2019-06-25 11:14:01 +02:00
Sébastien Villemot 5b591fac42
New perfect_foresight_problem MEX file
It constructs the stacked residuals and jacobian of the perfect foresight
problem.

It is an almost perfect replacement for the perfect_foresight_problem.m
routine, while being much more efficient.

Note however that the DLL never return complex numbers (it instead puts NaNs at
the place where there would have been complex). This may create problems for
some MOD files; the algorithms will need to be adapted to use a more
line-search method.
2019-06-24 17:53:59 +02:00